From 08d5253fb1052a0ad2785641ec53ce47c2e9b4bd Mon Sep 17 00:00:00 2001 From: woody Date: Wed, 18 Jun 2025 15:26:16 +0800 Subject: [PATCH 1/4] =?UTF-8?q?feat(pay):=20=E6=94=AF=E4=BB=98=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/regiest.js | 105 +++-- config/request.js | 2 +- pages/other/index.vue | 28 +- pages/pay/index.vue | 882 ++++++++++++++++++++++-------------------- util/constant.js | 25 ++ 5 files changed, 552 insertions(+), 490 deletions(-) create mode 100644 util/constant.js diff --git a/config/regiest.js b/config/regiest.js index 16d2489..ddeca01 100644 --- a/config/regiest.js +++ b/config/regiest.js @@ -1,71 +1,104 @@ const http = uni.$u.http //幂等性 -export const generate = (params) => http.get('/system/api/idempotent/generate', { params }) +export const generate = params => + http.get('/system/api/idempotent/generate', { params }) //商品列表 -export const getAllGoods = (params) => http.post('/sale/api/wares/query-spe-wares', params) +export const getAllGoods = params => + http.post('/sale/api/wares/query-spe-wares', params) //商品详情 -export const waresDetail = (params) => http.post('/sale/api/wares/query-spe-wares-detail', params) +export const waresDetail = params => + http.post('/sale/api/wares/query-spe-wares-detail', params) //获取国家 -export const countryList = (params) => http.get('/system/api/country/list', { params }) +export const countryList = params => + http.get('/system/api/country/list', { params }) //发货 -export const deliveryList = (params) => http.get('/system/pub/enums/delivery-list', { params }) +export const deliveryList = params => + http.get('/system/pub/enums/delivery-list', { params }) //运输 -export const transportList = (params) => http.get('/system/pub/enums/transport-type', { params }) +export const transportList = params => + http.get('/system/pub/enums/transport-type', { params }) //行列表输 -export const bankList = (params) => http.get('/system/api/bank/list', { params }) +export const bankList = params => http.get('/system/api/bank/list', { params }) //购物车商品详情 -export const shoppingWaresDetail = (params) => http.post('/sale/api/shopping/get-shopping-wares-detail', params) +export const shoppingWaresDetail = params => + http.post('/sale/api/shopping/get-shopping-wares-detail', params) //一键注册 -export const quickReg = (params) => http.post('/sale/api/order/quick-reg', params) +export const quickReg = params => http.post('/sale/api/order/quick-reg', params) //获取会员等级 -export const memLevel = (params) => http.post('/sale/api/order/valid-mem-level', params) +export const memLevel = params => + http.post('/sale/api/order/valid-mem-level', params) //注册页面显示权限 -export const registerList = (params) => http.get('/system/api/register-page/list', { params }) +export const registerList = params => + http.get('/system/api/register-page/list', { params }) //获取地址列表 -export const addressList = (params) => http.get('/member/api/member-address/list', { params }) +export const addressList = params => + http.get('/member/api/member-address/list', { params }) //查询邮费 -export const queryPostage = (params) => http.post('/sale/api/order/query-order-postage', params) +export const queryPostage = params => + http.post('/sale/api/order/query-order-postage', params) //确认注册订单-生成待支付订单 -export const confirmRegOrder = (params) => http.post('/sale/api/order/confirm-reg-order', params) +export const confirmRegOrder = params => + http.post('/sale/api/order/confirm-reg-order', params) //根据推荐人编号获取安置信息 -export const validPcode = (params) => http.post('/sale/api/order/valid-p-code', params) +export const validPcode = params => + http.post('/sale/api/order/valid-p-code', params) //注册订单验证安置人编号 -export const validPPcode = (params) => http.post('/sale/api/order/valid-p-p-code', params) +export const validPPcode = params => + http.post('/sale/api/order/valid-p-p-code', params) //注册订单验证手机号 -export const validPhone = (params) => http.post('/sale/api/order/valid-phone', params) +export const validPhone = params => + http.post('/sale/api/order/valid-phone', params) //获取name -export const upgRel = (params) => http.post('/sale/api/order/validate-upg-rel', params) +export const upgRel = params => + http.post('/sale/api/order/validate-upg-rel', params) //升级复购单确认 -export const confirmOthOrder = (params) => http.post('/sale/api/order/confirm-oth-order', params) +export const confirmOthOrder = params => + http.post('/sale/api/order/confirm-oth-order', params) //嗨粉确认订单 -export const confirmFunOrder = (params) => http.post('/sale/api/order/confirm-fun-order', params) +export const confirmFunOrder = params => + http.post('/sale/api/order/confirm-fun-order', params) //协议 -export const waresAgreement = (params) => http.post('/sale/api/wares/get-wares-agreement', params) +export const waresAgreement = params => + http.post('/sale/api/wares/get-wares-agreement', params) //海粉订单详情 -export const waresinfo = (params) => http.post('/sale/api/wares/query-confirm-waresinfo', params) +export const waresinfo = params => + http.post('/sale/api/wares/query-confirm-waresinfo', params) //海粉订单确认 -export const confirmShareOrder = (params) => http.post('/sale/api/order/confirm-share-order', params) +export const confirmShareOrder = params => + http.post('/sale/api/order/confirm-share-order', params) //删除地址 -export const delAddress = (data) => http.delete('/member/api/member-address/' + data) +export const delAddress = data => + http.delete('/member/api/member-address/' + data) //省市区 -export const areaList = (params) => http.get('system/api/area/get-level-list', { params }) +export const areaList = params => + http.get('system/api/area/get-level-list', { params }) //创客空间选择 -export const list_maker = (data) => http.post('/member/api/maker-space/list-maker?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize, data ) +export const list_maker = data => + http.post( + '/member/api/maker-space/list-maker?pageNum=' + + data.pageNum + + '&pageSize=' + + data.pageSize, + data + ) // 礼包获取邮费 -export const queryAdressPostage = (params) => http.post('/sale/api/order/self-order-postage', params) +export const queryAdressPostage = params => + http.post('/sale/api/order/self-order-postage', params) // 特殊会员完善信息 -export const saveSpecial = (params) => http.post('/member/api/member-special/save-special', params) +export const saveSpecial = params => + http.post('/member/api/member-special/save-special', params) // 下载 -export const specialExport = (params) => http.post('/member/api/member-special/special-export', params,{header: { 'Content-Type': 'application/x-www-form-urlencoded' }, -responseType: 'blob',}) +export const specialExport = params => + http.post('/member/api/member-special/special-export', params, { + header: { 'Content-Type': 'application/x-www-form-urlencoded' }, + responseType: 'blob', + }) //特殊信息列表 -export const specialList = (params) => http.get('/member/api/member-special/special-list', { params }) - +export const specialList = params => + http.get('/member/api/member-special/special-list', { params }) // 创客空间接口 -export const queryCard = (params) => http.post('/sale/api/wares/query-cabin-card', params) - -//复购特殊商品列表 -export const makerList = (params) => http.get('/sale/api/order/list-maker-ware', { params }) \ No newline at end of file +export const queryCard = params => + http.post('/sale/api/wares/query-cabin-card', params) diff --git a/config/request.js b/config/request.js index 87a834b..7c691d2 100644 --- a/config/request.js +++ b/config/request.js @@ -20,7 +20,7 @@ module.exports = vm => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = '/prod-api' + config.baseURL = 'http://192.168.0.104:8080' //#endif //#ifdef QA_SERVER diff --git a/pages/other/index.vue b/pages/other/index.vue index 4a56ad0..5d00135 100644 --- a/pages/other/index.vue +++ b/pages/other/index.vue @@ -819,35 +819,9 @@ export default { ) { this.getMember() } - // 判断特殊商品 - if (this.specialArea == 3) { - this.checkGoods() - } }) }, - checkGoods() { - // 判断特殊商品 - api.makerList().then(res => { - if (res.data.length > 0) { - let isYes = 0 - res.data.forEach(item => { - if ( - this.allGoodsData.orderItemsParams.some( - ctem => ctem.waresCode == item - ) - ) { - isYes++ - } - }) - if (isYes != 0) { - this.howSure = true - if (this.howSure) { - this.getQueryCard() - } - } - } - }) - }, + transPass(rule, value, callback) { if (this.isDeliveryWay) { if (!value) { diff --git a/pages/pay/index.vue b/pages/pay/index.vue index e1126a7..d8d0366 100644 --- a/pages/pay/index.vue +++ b/pages/pay/index.vue @@ -1,42 +1,42 @@ - @@ -756,6 +746,7 @@ import * as api from '@/config/pay.js' import QRCode from 'qrcodejs2' import successDialog from '@/components/successDialog.vue' import * as act from '@/config/activity.js' +import { PAY_REDIRECT_URL, PAY_TYPE, PAY_CHANEL } from '@/util/constant.js' var payStatus export default { components: { @@ -763,6 +754,7 @@ export default { }, data() { return { + PAY_TYPE, payList: {}, isNoBind: false, isLoading: false, @@ -873,7 +865,7 @@ export default { .unBind({ bindCode: this.unBindCode, }) - .then((res) => { + .then(res => { if (res.code == 200) { uni.showToast({ title: '解绑成功', @@ -901,7 +893,7 @@ export default { pkBaseId: this.luckydrawData.pkBaseId, payNum: this.luckydrawData.payNum, }) - .then((res) => { + .then(res => { if (res.code == 200) { this.orderData.orderAmount = res.data.toBePaidMoney this.payDetail = res.data @@ -971,7 +963,7 @@ export default { specialArea: this.specialArea, payPwd: this.codeValue, pkSettleCountry: this.pkCountry, - makerSpaceMember: this.paramsPost?.makerSpaceMember||'', + makerSpaceMember: this.paramsPost?.makerSpaceMember || '', } } if (this.paramsPost?.orderType === 4) { @@ -982,7 +974,7 @@ export default { pkBaseId: this.luckydrawData.pkBaseId, pkSettleCountry: this.pkCountry, } - api.payDrawGift(obj).then((res) => { + api.payDrawGift(obj).then(res => { if (res.code == 200) { // this.$message({ // message: res.msg, @@ -998,7 +990,7 @@ export default { } }) } else { - url(obj).then((res) => { + url(obj).then(res => { if (res.code == 200) { this.isPw = false if ( @@ -1050,24 +1042,30 @@ export default { } if (this.activeNames == 2) { // 非银行卡 - if (typeof this.whatPay == 'number') { + if ( + ![ + PAY_TYPE.HUI_FU_BANK_CARD, + PAY_TYPE.JING_DONG_BANK_CARD, + PAY_TYPE.TONG_LIAN_BANK_CARD, + ].includes(this.whatPay) + ) { if (cz) { //充值 api .preCharge({ rechargeAmount: this.czJe, }) - .then((res) => { + .then(res => { this.paramsPost = res.data this.orderCode = res.orderCode if (this.whatPay == 11) { - this.scanPayBfWxJump(5) + this.weChatPay(5) } else if (this.whatPay == 12) { this.scanPayBfWx(5) } else if (this.whatPay == 13) { this.scanPayBfWx(6) } else if (this.whatPay == 32) { - this.scanPayTlWxJump(3) + this.weChatPay(3) } else if (this.whatPay == 73) { this.scanPayWx(7) } else if (this.whatPay == 74) { @@ -1075,22 +1073,27 @@ export default { } }) } else { - if (this.whatPay == 11) { - this.scanPayBfWxJump(5) - } else if (this.whatPay == 12) { + if ( + [ + PAY_TYPE.BAO_FU_WECHAT, + PAY_TYPE.TONG_LIAN_WECHAT, + PAY_TYPE.JING_DONG_WECHAT, + ].includes(this.whatPay) + ) { + console.log(PAY_CHANEL[this.whatPay], this.whatPay, PAY_CHANEL) + this.weChatPay(PAY_CHANEL[this.whatPay]) + } else if (this.whatPay == PAY_TYPE.BAO_FU_WECHAT_SCAN) { this.scanPayBfWx(5) - } else if (this.whatPay == 13) { + } else if (this.whatPay == PAY_TYPE.HUI_FU_WECHAT) { this.scanPayBfWx(6) - } else if (this.whatPay == 32) { - this.scanPayTlWxJump(3) - } else if (this.whatPay == 73) { + } else if (this.whatPay == PAY_TYPE.WECHAT_PAY) { this.scanPayWx(7) - } else if (this.whatPay == 74) { + } else if (this.whatPay == PAY_TYPE.ALI_PAY) { this.scanPayAl(7) } } } else { - if (this.whatPay.slice(0, 2) == 'hf') { + if (this.whatPay.slice(0, 2) == PAY_TYPE.HUI_FU_BANK_CARD) { let indexed = this.whatPay.slice(2, 4) if (!cz) { let params = { @@ -1100,8 +1103,8 @@ export default { payType: 3, //银行卡 bindCode: this.hfList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { - this.isBank = 'hf' + api.unifiedorder(params).then(response => { + this.isBank = PAY_TYPE.HUI_FU_BANK_CARD this.bindCode = this.hfList[indexed].bindCode this.isPw = true }) @@ -1111,7 +1114,7 @@ export default { .preCharge({ rechargeAmount: this.czJe, }) - .then((res) => { + .then(res => { let params = { businessType: 3, //订单类型充值 businessCode: res.orderCode, @@ -1119,8 +1122,8 @@ export default { payType: 3, //银行卡 bindCode: this.hfList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { - this.isBank = 'hf' + api.unifiedorder(params).then(response => { + this.isBank = PAY_TYPE.HUI_FU_BANK_CARD this.bindCode = this.hfList[indexed].bindCode this.orderCode = res.orderCode @@ -1129,7 +1132,7 @@ export default { }) this.checkPayStatus(params) } - } else if (this.whatPay.slice(0, 2) == 'jd') { + } else if (this.whatPay.slice(0, 2) == PAY_TYPE.JING_DONG_BANK_CARD) { let indexed = this.whatPay.slice(2, 4) if (!cz) { let params = { @@ -1139,8 +1142,8 @@ export default { payType: 3, //银行卡 bindCode: this.jdList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { - this.isBank = 'jd' + api.unifiedorder(params).then(response => { + this.isBank = PAY_TYPE.JING_DONG_BANK_CARD this.bindCode = this.jdList[indexed].bindCode this.isPw = true }) @@ -1150,7 +1153,7 @@ export default { .preCharge({ rechargeAmount: this.czJe, }) - .then((res) => { + .then(res => { let params = { businessType: 3, //订单类型充值 businessCode: res.orderCode, @@ -1158,8 +1161,8 @@ export default { payType: 3, //银行卡 bindCode: this.jdList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { - this.isBank = 'jd' + api.unifiedorder(params).then(response => { + this.isBank = PAY_TYPE.JING_DONG_BANK_CARD this.bindCode = this.jdList[indexed].bindCode this.orderCode = res.orderCode this.isPw = true @@ -1167,7 +1170,7 @@ export default { }) this.checkPayStatus(params) } - } else if (this.whatPay.slice(0, 2) == 'tl') { + } else if (this.whatPay.slice(0, 2) == PAY_TYPE.TONG_LIAN_BANK_CARD) { let indexed = this.whatPay.slice(2, 4) if (!cz) { let params = { @@ -1177,8 +1180,8 @@ export default { payType: 3, //银行卡 bindCode: this.tlList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { - this.isBank = 'tl' + api.unifiedorder(params).then(response => { + this.isBank = PAY_TYPE.TONG_LIAN_BANK_CARD this.bindCode = this.tlList[indexed].bindCode this.isPw = true }) @@ -1188,7 +1191,7 @@ export default { .preCharge({ rechargeAmount: this.czJe, }) - .then((res) => { + .then(res => { let params = { businessType: 3, //订单类型充值 businessCode: res.orderCode, @@ -1196,8 +1199,8 @@ export default { payType: 3, //银行卡 bindCode: this.tlList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { - this.isBank = 'tl' + api.unifiedorder(params).then(response => { + this.isBank = PAY_TYPE.TONG_LIAN_BANK_CARD this.bindCode = this.tlList[indexed].bindCode this.orderCode = res.orderCode this.isPw = true @@ -1208,30 +1211,11 @@ export default { } } } else { - if (cz) { - //充值 - api - .preCharge({ - rechargeAmount: this.czJe, - }) - .then((res) => { - this.paramsPost = res.data - this.orderCode = res.orderCode - if (this.whatPay == 12) { - this.scanPayBfWx(5) - } else if (this.whatPay == 13) { - this.scanPayBfWx(6) - } - }) - this.isBank = '' - this.isPw = true - } else { - api.generate().then((res) => { - uni.setStorageSync('mToken', res.msg) - }) - this.isBank = '' - this.isPw = true - } + api.generate().then(res => { + uni.setStorageSync('mToken', res.msg) + }) + this.isBank = '' + this.isPw = true } }, scanPayBfWx(val) { @@ -1251,7 +1235,7 @@ export default { payType: 2, } } - api.unifiedorder(params).then((res) => { + api.unifiedorder(params).then(res => { this.wxPopup = true let that = this this.$nextTick(() => { @@ -1295,7 +1279,7 @@ export default { payType: 2, } } - api.unifiedorder(params).then((res) => { + api.unifiedorder(params).then(res => { this.wxPopup = true let that = this this.$nextTick(() => { @@ -1339,7 +1323,7 @@ export default { payType: 1, } } - api.unifiedorder(params).then((res) => { + api.unifiedorder(params).then(res => { this.wxPopup1 = true let that = this this.$nextTick(() => { @@ -1365,66 +1349,98 @@ export default { }) this.checkPayStatus(params) }, + getPayAuthToken(payChannel) { + return new Promise((resolve, reject) => { + const params = { + payChannel: payChannel, + payType: 2, + appletFlag: 0, + businessType: this.ifcz ? 3 : this.businessType, + businessCode: this.orderCode, + } + api.unifiedorder(params).then(res => { + if (res.code === 200) { + resolve(res.data) + this.checkPayStatus(params) + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + }) + reject(res.msg) + } + }) + }) + }, + weChatPay(payChannel) { + this.getPayAuthToken(payChannel) + .then(res => { + const url = PAY_REDIRECT_URL + '&state=' + res + '&payment=0' + window.open(url) + }) + .catch(_ => { + const url = PAY_REDIRECT_URL + '&state=' + 'eroor' + '&payment=0' + // window.open(url) + window.location.href = url + uni.showToast({ + title: url, + icon: 'none', + }) + }) + }, // 宝付微信支付 - scanPayBfWxJump(val) { - let params - if (this.ifcz) { - params = { - businessType: 3, //订单类型充值 - businessCode: this.orderCode, - payChannel: val, - payType: 2, - appletFlag: 0, - } - } else { - params = { - businessType: this.businessType, //订单类型充值 - businessCode: this.orderCode, - payChannel: val, - payType: 2, - appletFlag: 0, - } - } - api.unifiedorder(params).then((res) => { - let url = - 'https://clooud1-5g23d3je04dda65b-1326540601.tcloudbaseapp.com/jump_mp.html?sign=20f03b022bc39e837056bdbe475632c8&t=1715569339&state=' + - res.data + '&payment=0' - // https://clooud1-5g23d3je04dda65b-1326540601.tcloudbaseapp.com/jump_mp.html?sign=812bf9ab54292b1fb7161a3a6f7fa0f6&t=1715570889&state=' + - // res.data + '&payment=0' - window.open(url) - }) - this.checkPayStatus(params) - }, - // 通联微信支付 - scanPayTlWxJump(val) { - let params - if (this.ifcz) { - params = { - businessType: 3, //订单类型充值 - businessCode: this.orderCode, - payChannel: val, - payType: 2, - appletFlag: 0, - } - } else { - params = { - businessType: this.businessType, //订单类型充值 - businessCode: this.orderCode, - payChannel: val, - payType: 2, - appletFlag: 0, - } - } - api.unifiedorder(params).then((res) => { - let url = - 'https://clooud1-5g23d3je04dda65b-1326540601.tcloudbaseapp.com/jump_mp.html?sign=20f03b022bc39e837056bdbe475632c8&t=1715569339&state=' + - res.data+ '&payment=1' - // https://clooud1-5g23d3je04dda65b-1326540601.tcloudbaseapp.com/jump_mp.html?sign=812bf9ab54292b1fb7161a3a6f7fa0f6&t=1715570889&state=' + - // res.data + '&payment=1' - window.open(url) - }) - this.checkPayStatus(params) - }, + // scanPayBfWxJump(val) { + // let params + // if (this.ifcz) { + // params = { + // businessType: 3, //订单类型充值 + // businessCode: this.orderCode, + // payChannel: val, + // payType: 2, + // appletFlag: 0, + // } + // } else { + // params = { + // businessType: this.businessType, //订单类型充值 + // businessCode: this.orderCode, + // payChannel: val, + // payType: 2, + // appletFlag: 0, + // } + // } + // api.unifiedorder(params).then(res => { + // const url = PAY_REDIRECT_URL + '&state=' + res.data + '&payment=0' + // console.log(url) + // window.open(url) + // }) + // this.checkPayStatus(params) + // }, + // // 通联微信支付 + // scanPayTlWxJump(val) { + // let params + // if (this.ifcz) { + // params = { + // businessType: 3, //订单类型充值 + // businessCode: this.orderCode, + // payChannel: val, + // payType: 2, + // appletFlag: 0, + // } + // } else { + // params = { + // businessType: this.businessType, //订单类型充值 + // businessCode: this.orderCode, + // payChannel: val, + // payType: 2, + // appletFlag: 0, + // } + // } + // api.unifiedorder(params).then(res => { + // const url = PAY_REDIRECT_URL + '&state=' + res.data + '&payment=1' + // window.open(url) + // }) + // this.checkPayStatus(params) + // }, change(e) { this.activeNames = e }, @@ -1436,12 +1452,12 @@ export default { } }, getPayConfig() { - api.payConfig().then((res) => { + api.payConfig().then(res => { this.payList = res.data }) }, getBankList() { - api.jdBankList().then((res) => { + api.jdBankList().then(res => { this.jdList = res.data }) // api.hfBankList().then((res) => { @@ -1462,7 +1478,7 @@ export default { orderCode: this.orderCode, pkSettleCountry: this.pkCountry, }) - .then((res) => { + .then(res => { this.orderData = res.data this.downTime() }) @@ -1484,7 +1500,7 @@ export default { orderCode: this.orderCode, pkSettleCountry: this.pkCountry, }) - .then((res) => { + .then(res => { // this.payDetail = res.data this.$set(this, 'payDetail', res.data) this.$nextTick(() => { @@ -1494,7 +1510,7 @@ export default { }) }, reset() { - this.$store.dispatch('GetInfo').then((res) => { + this.$store.dispatch('GetInfo').then(res => { uni.reLaunch({ url: '/pages/index/index', }) @@ -1513,7 +1529,7 @@ export default { this.specialArea == 7 || this.specialArea == 24 ) { - api.registerInfo(this.orderCode).then((res) => { + api.registerInfo(this.orderCode).then(res => { this.$refs.successDialog.showSuccess(res.data) }) } else { @@ -1522,7 +1538,7 @@ export default { this.showSucce = true } } else { - api.payStatus(data).then((res) => { + api.payStatus(data).then(res => { that.sucPay = res.data }) } @@ -1563,7 +1579,9 @@ export default { .tit { font-size: 24px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; text-align: center; color: #333333; @@ -1572,7 +1590,9 @@ export default { .tit1 { font-size: 24px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #e02b26; text-align: center; @@ -1581,7 +1601,9 @@ export default { .tit2 { font-size: 11px; - font-family: PingFang SC-Regular, PingFang SC; + font-family: + PingFang SC-Regular, + PingFang SC; font-weight: 400; color: #666666; display: flex; @@ -1608,7 +1630,9 @@ export default { display: flex; align-items: center; font-size: 12px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #333333; @@ -1646,7 +1670,9 @@ export default { display: flex; align-items: center; font-size: 12px; - font-family: PingFang SC-Regular, PingFang SC; + font-family: + PingFang SC-Regular, + PingFang SC; font-weight: 400; color: #333333; @@ -1773,14 +1799,18 @@ export default { justify-content: space-between; color: #666; font-size: 12px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #999; } .tTit { font-size: 12px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #666; } diff --git a/util/constant.js b/util/constant.js new file mode 100644 index 0000000..5b22082 --- /dev/null +++ b/util/constant.js @@ -0,0 +1,25 @@ +export const PAY_REDIRECT_URL = + 'https://cloud1-8g5amgy6c173b906-1362517604.tcloudbaseapp.com/bd-pay-web/jump-mp.html?sign=c2d1fa4dcee3f77accfd22b480128c02&t=1749175241' + +export const PAY_TYPE = { + BAO_FU_WECHAT: 'BAO_FU_WECHAT', + BAO_FU_WECHAT_SCAN: 'BAO_FU_WECHAT_SCAN', + HUI_FU_WECHAT: 'HUI_FU_WECHAT', + HUI_FU_BANK_CARD: 'hf', + WECHAT_PAY: 'WECHAT_PAY', + ALI_PAY: 'ALI_PAY', + TONG_LIAN_WECHAT: 'TONG_LIAN_WECHAT', + TONG_LIAN_BANK_CARD: 'tl', + JING_DONG_BANK_CARD: 'jd', + JING_DONG_WECHAT: 'JING_DONG_WECHAT', +} + +export const PAY_CHANEL = { + BAO_FU_WECHAT: 5, + JING_DONG_WECHAT: 4, + BAO_FU_WECHAT_SCAN: 5, + HUI_FU_WECHAT: 6, + WECHAT_PAY: 7, + ALI_PAY: 7, + TONG_LIAN_WECHAT: 3, +} From 492dd0465706a9d14c0d987aa19c84bd0f077f51 Mon Sep 17 00:00:00 2001 From: woody Date: Thu, 3 Jul 2025 09:40:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?feat(pay):=20=E6=B7=BB=E5=8A=A0=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=88=90=E5=8A=9F=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/request.js | 2 +- manifest.json | 11 +- pages.json | 8 +- pages/mine/balance/index.vue | 659 +++++++++-------- pages/pay/hiPay.vue | 336 +++++---- pages/pay/index.vue | 570 +++++++-------- pages/pay/success.vue | 348 +++++++++ pages/pay/treePay.vue | 1291 ++++++++++++++++++---------------- util/constant.js | 32 +- 9 files changed, 1818 insertions(+), 1439 deletions(-) create mode 100644 pages/pay/success.vue diff --git a/config/request.js b/config/request.js index 7c691d2..eba2da2 100644 --- a/config/request.js +++ b/config/request.js @@ -20,7 +20,7 @@ module.exports = vm => { //#ifdef DEV_SERVER console.log('DEV_SERVER') - config.baseURL = 'http://192.168.0.104:8080' + config.baseURL = 'https://b747-218-57-66-5.ngrok-free.app' //#endif //#ifdef QA_SERVER diff --git a/manifest.json b/manifest.json index 1febbaf..a903045 100644 --- a/manifest.json +++ b/manifest.json @@ -93,13 +93,18 @@ }, "devServer": { "https": false, + "port": 8000, + "disableHostCheck": true, "proxy": { "/prod-api": { - "target": "http://t-app.beida666.com", - "changeOrigin": true + "target": "http://192.168.0.104:8080", + "changeOrigin": true, + "pathRewrite": { + "^/prod-api": "" + } } } } }, "fallbackLocale": "zh-Hans" -} \ No newline at end of file +} diff --git a/pages.json b/pages.json index 90206cf..85c040f 100644 --- a/pages.json +++ b/pages.json @@ -5,7 +5,6 @@ "style": { "navigationBarTitleText": "首页", "navigationBarBackgroundColor": "#fff", - // "enablePullDownRefresh": true, "navigationBarHidden": true, "navigationStyle": "custom" } @@ -364,6 +363,13 @@ "navigationBarTitleText": "绑定银行卡" } }, + { + "path": "pages/pay/success", + "style": { + "navigationBarTitleText": "支付成功", + "navigationBarBackgroundColor": "#fff" + } + }, { "path": "pages/mine/order/index", "style": { diff --git a/pages/mine/balance/index.vue b/pages/mine/balance/index.vue index 7044bc5..800cf08 100644 --- a/pages/mine/balance/index.vue +++ b/pages/mine/balance/index.vue @@ -1,333 +1,370 @@ \ No newline at end of file + .balance_line { + display: flex; + align-items: center; + justify-content: space-between; + font-size: 24rpx; + font-family: Source Han Sans CN; + font-weight: 400; + color: #333333; + margin-top: 5rpx; + } + } + } +} + diff --git a/pages/pay/hiPay.vue b/pages/pay/hiPay.vue index 001f437..4848cc1 100644 --- a/pages/pay/hiPay.vue +++ b/pages/pay/hiPay.vue @@ -6,193 +6,168 @@ --> @@ -300,7 +272,7 @@ export default { content: '支付成功', wxPopup: false, luckydrawData: {}, - ifcz: false, + isRecharge: false, czJe: '', tlList: [], } @@ -314,8 +286,8 @@ export default { ) this.pkCountry = uni.getStorageSync('pkCountry') - // if (this.paramsPost.ifcz) { - // this.ifcz = this.paramsPost.ifcz + // if (this.paramsPost.isRecharge) { + // this.isRecharge = this.paramsPost.isRecharge // this.businessType = 3 // uni.setNavigationBarTitle({ // title: '充值' @@ -324,7 +296,7 @@ export default { // uni.setNavigationBarTitle({ // title: '订单支付' // }); - // this.ifcz = false + // this.isRecharge = false // if (JSON.parse(options.paramsPost).orderType == 4) { this.orderCode = this.paramsPost.orderCode // this.luckydrawData = this.paramsPost.luckydrawData @@ -374,7 +346,7 @@ export default { pkBaseId: this.luckydrawData.pkBaseId, payNum: this.luckydrawData.payNum, }) - .then((res) => { + .then(res => { if (res.code == 200) { this.orderData.orderAmount = res.data.toBePaidMoney this.payDetail = res.data @@ -411,7 +383,7 @@ export default { }) }, fansOrder() { - api.fansOrder(this.orderCode).then((res) => { + api.fansOrder(this.orderCode).then(res => { this.isLoading = false this.isPw = false removeToken() @@ -436,7 +408,7 @@ export default { pkSettleCountry: this.pkCountry, } this.isLoading = true - url(obj).then((res) => { + url(obj).then(res => { if (res.code == 200) { // this.isPw = false // this.$refs.hiSuccess.showSuccess(res.data) @@ -481,7 +453,7 @@ export default { payType: 3, //银行卡 bindCode: this.hfList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { + api.unifiedorder(params).then(response => { this.isBank = 'hf' this.bindCode = this.hfList[indexed].bindCode this.isPw = true @@ -497,7 +469,7 @@ export default { payType: 3, //银行卡 bindCode: this.jdList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { + api.unifiedorder(params).then(response => { this.isBank = 'jd' this.bindCode = this.jdList[indexed].bindCode this.isPw = true @@ -512,7 +484,7 @@ export default { payType: 3, //银行卡 bindCode: this.tlList[indexed].bindCode, } - api.unifiedorder(params).then((response) => { + api.unifiedorder(params).then(response => { this.isBank = 'tl' this.bindCode = this.tlList[indexed].bindCode this.isPw = true @@ -530,7 +502,7 @@ export default { payType: 2, appletFlag: 0, } - api.unifiedorder(params).then((res) => { + api.unifiedorder(params).then(res => { let url = 'https://cloud1-8gp1n6uofa17e2e2-1315820965.tcloudbaseapp.com/jump_mp.html?sign=8587800b05c859700944247c03eeae1c&t=1698224973&state=' + res.data @@ -547,7 +519,7 @@ export default { payType: 2, appletFlag: 0, } - api.unifiedorder(params).then((res) => { + api.unifiedorder(params).then(res => { let url = 'https://cloud1-1gql8u3v1fe85a37-1322999719.tcloudbaseapp.com/jump_mp.html?sign=d77deffc9e8aecd2b721f8430c376370&t=1705374125&state=' + res.data @@ -562,7 +534,7 @@ export default { payChannel: val, payType: 2, } - api.unifiedorder(params).then((res) => { + api.unifiedorder(params).then(res => { this.wxPopup = true this.$nextTick(() => { new QRCode( @@ -593,7 +565,7 @@ export default { } }, getPayConfig() { - api.payConfig().then((res) => { + api.payConfig().then(res => { this.payList = res.data this.$nextTick(() => { this.$refs.collapse.init() @@ -602,7 +574,7 @@ export default { }) }, getBankList() { - api.jdBankList().then((res) => { + api.jdBankList().then(res => { this.jdList = res.data }) // api.hfBankList().then((res) => { @@ -623,7 +595,7 @@ export default { orderCode: this.orderCode, pkSettleCountry: this.pkCountry, }) - .then((res) => { + .then(res => { this.orderData = res.data this.downTime() }) @@ -645,13 +617,13 @@ export default { orderCode: this.orderCode, pkSettleCountry: this.pkCountry, }) - .then((res) => { + .then(res => { // this.payDetail = res.data this.$set(this, 'payDetail', res.data) }) }, reset() { - this.$store.dispatch('GetInfo').then((res) => { + this.$store.dispatch('GetInfo').then(res => { uni.reLaunch({ url: '/pages/index/index', }) @@ -669,7 +641,7 @@ export default { // this.showSucce = true this.fansOrder() } else { - api.payStatus(data).then((res) => { + api.payStatus(data).then(res => { that.sucPay = res.data }) } @@ -710,7 +682,9 @@ export default { .tit { font-size: 24px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; text-align: center; color: #333333; @@ -719,7 +693,9 @@ export default { .tit1 { font-size: 24px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #e02b26; text-align: center; @@ -728,7 +704,9 @@ export default { .tit2 { font-size: 11px; - font-family: PingFang SC-Regular, PingFang SC; + font-family: + PingFang SC-Regular, + PingFang SC; font-weight: 400; color: #666666; display: flex; @@ -755,7 +733,9 @@ export default { display: flex; align-items: center; font-size: 12px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #333333; @@ -793,7 +773,9 @@ export default { display: flex; align-items: center; font-size: 12px; - font-family: PingFang SC-Regular, PingFang SC; + font-family: + PingFang SC-Regular, + PingFang SC; font-weight: 400; color: #333333; @@ -915,14 +897,18 @@ export default { justify-content: space-between; color: #666; font-size: 12px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #999; } .tTit { font-size: 12px; - font-family: PingFang SC-Semibold, PingFang SC; + font-family: + PingFang SC-Semibold, + PingFang SC; font-weight: 600; color: #666; } diff --git a/pages/pay/index.vue b/pages/pay/index.vue index d8d0366..a8550ef 100644 --- a/pages/pay/index.vue +++ b/pages/pay/index.vue @@ -3,9 +3,9 @@ -