@@ -633,7 +707,7 @@
:loading="isLoading"
loadingText="支付中"
:disabled="payBtnDisabled"
- @tap="quickPay(ifcz)"
+ @tap="quickPay(isRecharge)"
color="linear-gradient(to right, #005BAC, #005BAC )"
>
{{ '立即支付' }}
@@ -668,7 +742,12 @@
-
+
{{ '支付宝支付' }}
@@ -701,6 +780,12 @@ 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,
+ PAY_AUTH,
+} from '@/util/constant.js'
var payStatus
export default {
components: {
@@ -708,6 +793,8 @@ export default {
},
data() {
return {
+ PAY_TYPE,
+ PAY_AUTH,
payList: {},
isNoBind: false,
isLoading: false,
@@ -738,10 +825,10 @@ export default {
sucPay: 0,
content: '支付成功',
wxPopup: false,
- wxPopup1: false,
+ aliQrCodeVisible: false,
luckydrawData: {},
- ifcz: false,
- czJe: '',
+ isRecharge: false,
+ rechargeAmount: '',
qrcodeimg: '',
onlinePay: true,
unBindCode: '',
@@ -749,22 +836,20 @@ export default {
},
computed: {
payBtnDisabled() {
- if (this.ifcz) {
+ if (this.isRecharge) {
return !Object.values(this.payList).some(val => val)
}
return false
},
},
onLoad(options) {
- this.paramsPost = JSON.parse(options.paramsPost)
- console.log(
- '%c [ this.paramsPost ]-734',
- 'font-size:13px; background:#777244; color:#bbb688;',
- this.paramsPost
- )
+ this.paramsPost = JSON.parse(options.paramsPost || '{}')
+ this.getPayConfig()
+ clearInterval(this.clockTime)
+
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: '充值',
@@ -773,39 +858,28 @@ export default {
uni.setNavigationBarTitle({
title: '订单支付',
})
- this.ifcz = false
- if (JSON.parse(options.paramsPost).orderType == 4) {
- this.orderCode = this.paramsPost.orderCode
- this.luckydrawData = this.paramsPost.luckydrawData
- // 抽奖支付处理(查询订单支付信息以及显示等)
- this.businessType = 4 //抽奖
- this.specialArea = this.paramsPost.specialArea
- this.getLuckdrawDetail()
- } else {
- this.userInfo = uni.getStorageSync('User')
- if (this.userInfo.registerFans == 0) {
- this.isShare = true
- }
+ this.isRecharge = false
+ this.userInfo = uni.getStorageSync('User')
+ if (this.userInfo.registerFans == 0) {
+ this.isShare = true
+ }
- this.specialArea =
- this.paramsPost.specialArea || this.paramsPost.orderType
- this.orderCode = this.paramsPost.orderCode
- this.businessType = options.businessType
- this.onlinePay = this.stringToBoolean(options.onlinePay || 'true')
- // this.getInfo()
+ this.specialArea =
+ this.paramsPost.specialArea || this.paramsPost.orderType
+ this.orderCode = this.paramsPost.orderCode
+ this.businessType = options.businessType
+ this.onlinePay = this.stringToBoolean(options.onlinePay || 'true')
+ // this.getInfo()
- // 获取订单信息
- this.getOrderInfo()
- if (!this.isShare) {
- // 获取消费信息
- this.getSpendInfo()
- }
+ // 获取订单信息
+ this.getOrderInfo()
+ if (!this.isShare) {
+ // 获取消费信息
+ this.getSpendInfo()
}
}
// 获取支付配置
- this.getPayConfig()
- clearInterval(this.clockTime)
},
onShow() {
@@ -856,7 +930,7 @@ export default {
},
closewxPopup() {
this.wxPopup = false
- this.wxPopup1 = false
+ this.aliQrCodeVisible = false
this.$refs.qrCodeUrlWx.innerHTML = ''
clearInterval(payStatus)
},
@@ -960,7 +1034,7 @@ export default {
// this.$refs.successDialog.showSuccess(res.data)
// })
} else {
- if (this.ifcz) {
+ if (this.isRecharge) {
uni.showToast({
title: '充值成功',
icon: 'none',
@@ -984,9 +1058,9 @@ export default {
})
}
},
- quickPay(cz) {
- if (cz) {
- if (!this.czJe || this.czJe <= 0) {
+ async quickPay(isRecharge) {
+ if (isRecharge) {
+ if (!this.rechargeAmount || this.rechargeAmount <= 0) {
uni.showToast({
title: '请输入正确的充值金额',
})
@@ -995,383 +1069,271 @@ export default {
}
if (this.activeNames == 2) {
// 非银行卡
- if (typeof this.whatPay == 'number') {
- if (cz) {
+ if (
+ ![
+ PAY_TYPE.HUI_FU_BANK_CARD,
+ PAY_TYPE.JING_DONG_BANK_CARD,
+ PAY_TYPE.TONG_LIAN_BANK_CARD,
+ ].includes(this.whatPay.slice(0, 2))
+ ) {
+ if (isRecharge) {
//充值
api
.preCharge({
- rechargeAmount: this.czJe,
+ rechargeAmount: this.rechargeAmount,
})
.then(res => {
this.paramsPost = res.data
this.orderCode = res.orderCode
- if (this.whatPay == 11) {
- this.scanPayBfWxJump(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)
- } else if (this.whatPay == 73) {
- this.scanPayWx(7)
- } else if (this.whatPay == 74) {
- this.scanPayAl(7)
+ if (this.whatPay == PAY_TYPE.JING_DONG_H5) {
+ this.redirectPay(PAY_CHANEL[this.whatPay])
+ } else if (
+ [PAY_TYPE.BAO_FU_WECHAT, PAY_TYPE.HUI_FU_WECHAT].includes(
+ this.whatPay
+ )
+ ) {
+ this.scanPayBfWx(PAY_CHANEL[this.whatPay])
+ } else if (this.whatPay == PAY_TYPE.TONG_LIAN_WECHAT) {
+ this.weChatPay(PAY_CHANEL[this.whatPay])
}
})
} else {
- if (this.whatPay == 11) {
- this.scanPayBfWxJump(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)
- } else if (this.whatPay == 73) {
- this.scanPayWx(7)
- } else if (this.whatPay == 74) {
- this.scanPayAl(7)
+ if ([PAY_TYPE.JING_DONG_H5].includes(this.whatPay)) {
+ this.redirectPay(PAY_CHANEL[this.whatPay])
+ } else if (
+ [PAY_TYPE.BAO_FU_WECHAT_SCAN, PAY_TYPE.HUI_FU_WECHAT].includes(
+ this.whatPay
+ )
+ ) {
+ this.scanPayBfWx(PAY_CHANEL[this.whatPay])
+ } else if (this.whatPay == PAY_TYPE.WECHAT_PAY) {
+ this.scanPayWx(PAY_CHANEL[this.whatPay])
+ } else if (this.whatPay == PAY_TYPE.ALI_PAY) {
+ this.scanPayAl(PAY_CHANEL[this.whatPay])
}
}
} else {
- if (this.whatPay.slice(0, 2) == 'hf') {
- let indexed = this.whatPay.slice(2, 4)
- if (!cz) {
- let params = {
- businessType: this.businessType, //订单类型
- businessCode: this.orderCode,
- payChannel: 6, //汇付
- payType: 3, //银行卡
- bindCode: this.hfList[indexed].bindCode,
- }
- api.unifiedorder(params).then(response => {
- this.isBank = 'hf'
- this.bindCode = this.hfList[indexed].bindCode
- this.isPw = true
+ const indexed = this.whatPay.slice(2, 4)
+ const payTypeEnum = this.whatPay.slice(0, 2)
+ const bankListMap = {
+ [PAY_TYPE.HUI_FU_BANK_CARD]: this.hfList[indexed].bindCode,
+ [PAY_TYPE.JING_DONG_BANK_CARD]: this.jdList[indexed].bindCode,
+ [PAY_TYPE.TONG_LIAN_BANK_CARD]: this.tlList[indexed].bindCode,
+ }
+ this.bindCode = bankListMap[payTypeEnum]
+ const params = {
+ businessType: isRecharge ? 3 : this.businessType, //订单类型
+ payChannel: PAY_CHANEL[payTypeEnum],
+ payType: 3, //银行卡
+ bindCode: bankListMap[payTypeEnum],
+ }
+ if (!isRecharge) {
+ Object.assign(params, {
+ businessCode: this.orderCode,
+ })
+ } else {
+ try {
+ const orderCode = await this.preCharge()
+ Object.assign(params, {
+ businessCode: orderCode,
})
- this.checkPayStatus(params)
- } else {
- api
- .preCharge({
- rechargeAmount: this.czJe,
- })
- .then(res => {
- let params = {
- businessType: 3, //订单类型充值
- businessCode: res.orderCode,
- payChannel: 6, //汇付
- payType: 3, //银行卡
- bindCode: this.hfList[indexed].bindCode,
- }
- api.unifiedorder(params).then(response => {
- this.isBank = 'hf'
- this.bindCode = this.hfList[indexed].bindCode
- this.orderCode = res.orderCode
-
- this.isPw = true
- })
- })
- this.checkPayStatus(params)
- }
- } else if (this.whatPay.slice(0, 2) == 'jd') {
- let indexed = this.whatPay.slice(2, 4)
- if (!cz) {
- let params = {
- businessType: this.businessType, //订单类型
- businessCode: this.orderCode,
- payChannel: 4, //京东
- payType: 3, //银行卡
- bindCode: this.jdList[indexed].bindCode,
- }
- api.unifiedorder(params).then(response => {
- this.isBank = 'jd'
- this.bindCode = this.jdList[indexed].bindCode
- this.isPw = true
+ this.orderCode = orderCode
+ } catch (error) {
+ uni.showToast({
+ title: error,
+ icon: 'none',
})
- this.checkPayStatus(params)
- } else {
- api
- .preCharge({
- rechargeAmount: this.czJe,
- })
- .then(res => {
- let params = {
- businessType: 3, //订单类型充值
- businessCode: res.orderCode,
- payChannel: 4, //京东
- payType: 3, //银行卡
- bindCode: this.jdList[indexed].bindCode,
- }
- api.unifiedorder(params).then(response => {
- this.isBank = 'jd'
- this.bindCode = this.jdList[indexed].bindCode
- this.orderCode = res.orderCode
- this.isPw = true
- })
- })
- this.checkPayStatus(params)
- }
- } else if (this.whatPay.slice(0, 2) == 'tl') {
- let indexed = this.whatPay.slice(2, 4)
- if (!cz) {
- let params = {
- businessType: this.businessType, //订单类型
- businessCode: this.orderCode,
- payChannel: 3, //通联
- payType: 3, //银行卡
- bindCode: this.tlList[indexed].bindCode,
- }
- api.unifiedorder(params).then(response => {
- this.isBank = 'tl'
- this.bindCode = this.tlList[indexed].bindCode
- this.isPw = true
- })
- this.checkPayStatus(params)
- } else {
- api
- .preCharge({
- rechargeAmount: this.czJe,
- })
- .then(res => {
- let params = {
- businessType: 3, //订单类型充值
- businessCode: res.orderCode,
- payChannel: 3, //通联
- payType: 3, //银行卡
- bindCode: this.tlList[indexed].bindCode,
- }
- api.unifiedorder(params).then(response => {
- this.isBank = 'tl'
- this.bindCode = this.tlList[indexed].bindCode
- this.orderCode = res.orderCode
- this.isPw = true
- })
- })
- this.checkPayStatus(params)
+ return
}
}
+ api.unifiedorder(params).then(response => {
+ this.isBank = this.whatPay.slice(0, 2)
+ this.isPw = true
+ this.checkPayStatus(params)
+ })
}
} 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) {
let params
- if (this.ifcz) {
- params = {
- businessType: 3, //订单类型充值
- businessCode: this.orderCode,
- payChannel: val,
- payType: 2,
- }
- } else {
- params = {
- businessType: this.businessType, //订单类型充值
- businessCode: this.orderCode,
- payChannel: val,
- payType: 2,
- }
+ params = {
+ businessType: this.isRecharge ? 3 : this.businessType, //订单类型充值
+ businessCode: this.orderCode,
+ payChannel: val,
+ payType: 2,
}
api.unifiedorder(params).then(res => {
this.wxPopup = true
- let that = this
- this.$nextTick(() => {
- new QRCode(
- this.$refs.qrCodeUrlWx,
- {
- width: 280,
- height: 280,
- text: res.data,
- colorDark: '#000000',
- colorLight: '#ffffff',
- correctLevel: QRCode.CorrectLevel.Q,
- textAlign: 'center',
- },
- 1000
- )
- setTimeout(() => {
- let qrcodeEle = document.getElementById('qrCodeUrlWx')
- let cvs = qrcodeEle.querySelector('canvas')
- that.qrcodeimg = cvs.toDataURL('image/png')
- }, 1000)
- })
+ this.drawQrcode(res.data)
+ this.checkPayStatus(params)
})
- this.checkPayStatus(params)
},
// 微信支付
scanPayWx(val) {
- let params
- if (this.ifcz) {
- params = {
- businessType: 3, //订单类型充值
- businessCode: this.orderCode,
- payChannel: val,
- payType: 2,
- }
- } else {
- params = {
- businessType: this.businessType, //订单类型充值
- businessCode: this.orderCode,
- payChannel: val,
- payType: 2,
- }
+ const params = {
+ businessType: this.isRecharge ? 3 : this.businessType, //订单类型充值
+ businessCode: this.orderCode,
+ payChannel: val,
+ payType: 2,
}
api.unifiedorder(params).then(res => {
this.wxPopup = true
- let that = this
- this.$nextTick(() => {
- new QRCode(
- this.$refs.qrCodeUrlWx,
- {
- width: 280,
- height: 280,
- text: res.data,
- colorDark: '#000000',
- colorLight: '#ffffff',
- correctLevel: QRCode.CorrectLevel.Q,
- textAlign: 'center',
- },
- 1000
- )
- setTimeout(() => {
- let qrcodeEle = document.getElementById('qrCodeUrlWx')
- let cvs = qrcodeEle.querySelector('canvas')
- that.qrcodeimg = cvs.toDataURL('image/png')
- }, 1000)
- })
+ this.drawQrcode(res.data)
+ this.checkPayStatus(params)
})
- this.checkPayStatus(params)
},
// 支付宝支付
scanPayAl(val) {
- let params
- if (this.ifcz) {
- params = {
- businessType: 3, //订单类型充值
- businessCode: this.orderCode,
- payChannel: val,
- payType: 1,
- }
- } else {
- params = {
- businessType: this.businessType, //订单类型充值
- businessCode: this.orderCode,
- payChannel: val,
- payType: 1,
- }
+ const params = {
+ businessType: this.isRecharge ? 3 : this.businessType, //订单类型充值
+ businessCode: this.orderCode,
+ payChannel: val,
+ payType: 1,
}
api.unifiedorder(params).then(res => {
- this.wxPopup1 = true
- let that = this
- this.$nextTick(() => {
- new QRCode(
- this.$refs.qrCodeUrlWx,
- {
- width: 280,
- height: 280,
- text: res.data,
- colorDark: '#000000',
- colorLight: '#ffffff',
- correctLevel: QRCode.CorrectLevel.Q,
- textAlign: 'center',
- },
- 1000
- )
- setTimeout(() => {
- let qrcodeEle = document.getElementById('qrCodeUrlWx')
- let cvs = qrcodeEle.querySelector('canvas')
- that.qrcodeimg = cvs.toDataURL('image/png')
- }, 1000)
+ this.aliQrCodeVisible = true
+ this.drawQrcode(res.data)
+ this.checkPayStatus(params)
+ })
+ },
+ getPayAuthToken(payChannel) {
+ return new Promise((resolve, reject) => {
+ const extParam = {
+ source: !!this.isRecharge,
+ orderCode: this.orderCode,
+ specialArea: this.specialArea,
+ }
+ // 将extParam对象转换为JSON字符串,再转换为base64编码
+ const extParamBase64 = btoa(JSON.stringify(extParam))
+ const params = {
+ payChannel: payChannel,
+ payType: 2,
+ appletFlag: 0,
+ businessType: this.isRecharge ? 3 : this.businessType,
+ businessCode: this.orderCode,
+ extParam: extParamBase64,
+ }
+ 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)
+ }
})
})
- this.checkPayStatus(params)
+ },
+ drawQrcode(text) {
+ let that = this
+ this.$nextTick(() => {
+ new QRCode(
+ this.$refs.qrCodeUrlWx,
+ {
+ width: 280,
+ height: 280,
+ text,
+ colorDark: '#000000',
+ colorLight: '#ffffff',
+ correctLevel: QRCode.CorrectLevel.Q,
+ textAlign: 'center',
+ },
+ 1000
+ )
+ setTimeout(() => {
+ let qrcodeEle = document.getElementById('qrCodeUrlWx')
+ let cvs = qrcodeEle.querySelector('canvas')
+ that.qrcodeimg = cvs.toDataURL('image/png')
+ }, 1000)
+ })
+ },
+ redirectPay(payChannel) {
+ this.getPayAuthToken(payChannel).then(url => {
+ if (navigator.userAgent.includes('MicroMessenger')) {
+ window.location.href = url
+ } else {
+ window.open(url)
+ }
+ })
+ },
+ 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.isRecharge) {
+ // 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.isRecharge) {
+ // 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
},
@@ -1403,16 +1365,22 @@ export default {
this.$forceUpdate()
},
getOrderInfo() {
- api
- .orderInfo({
- specialArea: this.specialArea,
- orderCode: this.orderCode,
- pkSettleCountry: this.pkCountry,
- })
- .then(res => {
- this.orderData = res.data
- this.downTime()
- })
+ return new Promise((resolve, reject) => {
+ api
+ .orderInfo({
+ specialArea: this.specialArea,
+ orderCode: this.orderCode,
+ pkSettleCountry: this.pkCountry,
+ })
+ .then(res => {
+ this.orderData = res.data
+ resolve(res.data)
+ this.downTime()
+ })
+ .catch(err => {
+ reject(err)
+ })
+ })
},
downTime() {
let that = this
@@ -1465,7 +1433,7 @@ export default {
})
} else {
this.wxPopup = false
- this.wxPopup1 = false
+ this.aliQrCodeVisible = false
this.showSucce = true
}
} else {
@@ -1486,6 +1454,21 @@ export default {
// 作为返回值返回
return h + ':' + m + ':' + s
},
+ preCharge() {
+ return new Promise((resolve, reject) => {
+ api
+ .preCharge({
+ rechargeAmount: this.rechargeAmount,
+ })
+ .then(res => {
+ if (res.code == 200) {
+ resolve(res.orderCode)
+ } else {
+ reject(res.msg)
+ }
+ })
+ })
+ },
},
}
diff --git a/pages/pay/success.vue b/pages/pay/success.vue
new file mode 100644
index 0000000..3a19d8c
--- /dev/null
+++ b/pages/pay/success.vue
@@ -0,0 +1,345 @@
+
+
+
+
+
+
+
+
+
+ ✓
+
+
+
+
+
+
+
+
+ {{ paySuccessText }}
+ 您的订单已支付完成
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/pay/treePay.vue b/pages/pay/treePay.vue
index 22b6cad..596b389 100644
--- a/pages/pay/treePay.vue
+++ b/pages/pay/treePay.vue
@@ -189,7 +189,7 @@
shape="circle"
:loading="isLoading"
loadingText="支付中"
- @tap="quickPay(ifcz)"
+ @tap="quickPay(isRecharge)"
color="linear-gradient(to right, #005BAC, #005BAC )"
>{{ '立即支付' }}
@@ -262,7 +262,7 @@ export default {
content: '支付成功',
wxPopup: false,
luckydrawData: {},
- ifcz: false,
+ isRecharge: false,
czJe: '',
objTree: {},
account: {},
@@ -273,8 +273,8 @@ export default {
title: '订单支付',
})
// this.paramsPost = JSON.parse(options.paramsPost)
- // if (this.paramsPost.ifcz) {
- // this.ifcz = this.paramsPost.ifcz
+ // if (this.paramsPost.isRecharge) {
+ // this.isRecharge = this.paramsPost.isRecharge
// this.businessType = 3
// uni.setNavigationBarTitle({
// title: '充值'
@@ -284,7 +284,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
@@ -417,7 +417,7 @@ export default {
},
scanPayBfWx(val) {
let params
- if (this.ifcz) {
+ if (this.isRecharge) {
params = {
businessType: 3, //订单类型充值
businessCode: this.orderCode,
diff --git a/util/constant.js b/util/constant.js
new file mode 100644
index 0000000..c978f9d
--- /dev/null
+++ b/util/constant.js
@@ -0,0 +1,41 @@
+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_H5: 'JING_DONG_H5',
+}
+
+export const PAY_AUTH = {
+ [PAY_TYPE.BAO_FU_WECHAT]: 'pay11',
+ [PAY_TYPE.JING_DONG_H5]: 'pay5',
+ [PAY_TYPE.BAO_FU_WECHAT_SCAN]: 'pay12',
+ [PAY_TYPE.HUI_FU_WECHAT]: 'pay13',
+ [PAY_TYPE.WECHAT_PAY]: 'pay73',
+ [PAY_TYPE.ALI_PAY]: 'pay74',
+ [PAY_TYPE.TONG_LIAN_WECHAT]: 'pay32',
+ [PAY_TYPE.HUI_FU_BANK_CARD]: 'pay15',
+ [PAY_TYPE.TONG_LIAN_BANK_CARD]: 'pay33',
+ [PAY_TYPE.JING_DONG_BANK_CARD]: 'pay4',
+}
+
+export const PAY_CHANEL = {
+ [PAY_TYPE.BAO_FU_WECHAT]: 5,
+ [PAY_TYPE.JING_DONG_H5]: 4,
+ [PAY_TYPE.BAO_FU_WECHAT_SCAN]: 5,
+ [PAY_TYPE.HUI_FU_WECHAT]: 6,
+ [PAY_TYPE.WECHAT_PAY]: 7,
+ [PAY_TYPE.ALI_PAY]: 7,
+ [PAY_TYPE.TONG_LIAN_WECHAT]: 3,
+ [PAY_TYPE.HUI_FU_BANK_CARD]: 6,
+ [PAY_TYPE.TONG_LIAN_BANK_CARD]: 3,
+ [PAY_TYPE.JING_DONG_BANK_CARD]: 4,
+}