-
![]()
+
+
+
-
-
+
+
@@ -755,14 +762,24 @@
import * as api from '@/config/pay.js'
import QRCode from 'qrcodejs2'
import successDialog from '@/components/successDialog.vue'
+import QuickRechargePanel from '@/components/QuickRechargePanel.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: {
successDialog,
+ QuickRechargePanel,
},
data() {
return {
+ PAY_TYPE,
+ PAY_AUTH,
payList: {},
isNoBind: false,
isLoading: false,
@@ -793,33 +810,48 @@ export default {
sucPay: 0,
content: '支付成功',
wxPopup: false,
- wxPopup1: false,
+ aliQrCodeVisible: false,
luckydrawData: {},
- ifcz: false,
- czJe: '',
+ isRecharge: false,
+ rechargeAmount: '',
qrcodeimg: '',
onlinePay: true,
unBindCode: '',
+ quickAmounts: [330, 990, 4950, 10000, 30000, 50000], // 快速充值金额选项
+ isQuickSelected: false, // 标记是否是快速选择触发的金额变化
}
},
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
- )
+ watch: {
+ rechargeAmount(newVal, oldVal) {
+ // 当充值金额变化时,如果不是快速选择触发的,则清空快速选择状态
+ if (!this.isQuickSelected && newVal && this.$refs.quickRechargePanel) {
+ this.$refs.quickRechargePanel.clear()
+ }
+ // 重置标志位
+ this.isQuickSelected = false
+ },
+ },
+ async onLoad(options) {
+ this.paramsPost = JSON.parse(options.paramsPost || '{}')
+ await this.getPayConfig()
+ clearInterval(this.clockTime)
+
this.pkCountry = uni.getStorageSync('pkCountry')
- if (this.paramsPost.ifcz) {
- this.ifcz = this.paramsPost.ifcz
+ if (this.paramsPost.isRecharge) {
+ this.activeNames = '2'
+ const auth = Object.keys(this.payList).find(key => this.payList[key])
+ this.whatPay = Object.keys(this.PAY_AUTH).find(
+ key => this.PAY_AUTH[key] === auth
+ )
+ this.isRecharge = this.paramsPost.isRecharge
this.businessType = 3
uni.setNavigationBarTitle({
title: '充值',
@@ -828,39 +860,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.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.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() {
@@ -870,20 +891,20 @@ export default {
methods: {
toUnBind() {
api
- .unBind({
- bindCode: this.unBindCode,
- })
- .then((res) => {
- if (res.code == 200) {
- uni.showToast({
- title: '解绑成功',
- icon: 'none',
- })
- this.whatPay = ''
- }
+ .unBind({
+ bindCode: this.unBindCode,
+ })
+ .then(res => {
+ if (res.code == 200) {
+ uni.showToast({
+ title: '解绑成功',
+ icon: 'none',
+ })
+ this.whatPay = ''
+ }
- this.getBankList()
- })
+ this.getBankList()
+ })
this.isNoBind = false
},
fixBind(item) {
@@ -893,25 +914,30 @@ export default {
stringToBoolean(str) {
return str === 'true' ? true : false
},
+ // 处理快速充值金额选择
+ onAmountSelected(data) {
+ this.isQuickSelected = true // 标记这是快速选择触发的
+ this.rechargeAmount = data.amount.toString()
+ },
//查询充值抽奖次数
getLuckdrawDetail() {
// 抽奖支付处理(查询订单支付信息以及显示等)
act
- .getLuckdrawDetail({
- pkBaseId: this.luckydrawData.pkBaseId,
- payNum: this.luckydrawData.payNum,
- })
- .then((res) => {
- if (res.code == 200) {
- this.orderData.orderAmount = res.data.toBePaidMoney
- this.payDetail = res.data
- // this.downTime()
- }
- })
+ .getLuckdrawDetail({
+ pkBaseId: this.luckydrawData.pkBaseId,
+ payNum: this.luckydrawData.payNum,
+ })
+ .then(res => {
+ if (res.code == 200) {
+ this.orderData.orderAmount = res.data.toBePaidMoney
+ this.payDetail = res.data
+ // this.downTime()
+ }
+ })
},
closewxPopup() {
this.wxPopup = false
- this.wxPopup1 = false
+ this.aliQrCodeVisible = false
this.$refs.qrCodeUrlWx.innerHTML = ''
clearInterval(payStatus)
},
@@ -940,11 +966,11 @@ export default {
let url, obj
// 银行卡
if (this.isBank) {
- if (this.isBank == 'hf') {
+ if (this.isBank == PAY_TYPE.HUI_FU_BANK_CARD) {
url = api.payConfirmHf
- } else if (this.isBank == 'jd') {
+ } else if (this.isBank == PAY_TYPE.JING_DONG_BANK_CARD) {
url = api.payConfirmJd
- } else if (this.isBank == 'tl') {
+ } else if (this.isBank == PAY_TYPE.TONG_LIAN_BANK_CARD) {
url = api.payConfirmTl
}
obj = {
@@ -958,9 +984,9 @@ export default {
// 钱包支付
if (
- this.specialArea == 1 ||
- this.specialArea == 7 ||
- this.specialArea == 24
+ this.specialArea == 1 ||
+ this.specialArea == 7 ||
+ this.specialArea == 24
) {
url = api.payRegOrder
} else {
@@ -971,7 +997,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 +1008,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,13 +1024,13 @@ export default {
}
})
} else {
- url(obj).then((res) => {
+ url(obj).then(res => {
if (res.code == 200) {
this.isPw = false
if (
- this.specialArea == 1 ||
- this.specialArea == 7 ||
- this.specialArea == 24
+ this.specialArea == 1 ||
+ this.specialArea == 7 ||
+ this.specialArea == 24
) {
if (this.isBank) {
this.isPw = false
@@ -1015,7 +1041,7 @@ export default {
// this.$refs.successDialog.showSuccess(res.data)
// })
} else {
- if (this.ifcz) {
+ if (this.isRecharge) {
uni.showToast({
title: '充值成功',
icon: 'none',
@@ -1039,392 +1065,293 @@ 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({
+ icon: 'none',
title: '请输入正确的充值金额',
})
return
}
+ if (!this.whatPay) {
+ uni.showToast({
+ icon: 'none',
+ title: '请选择支付方式',
+ })
+ return
+ }
}
+ console.log(this.activeNames, '....this.activeNames')
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,
- })
- .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)
- }
- })
+ .preCharge({
+ rechargeAmount: this.rechargeAmount,
+ })
+ .then(res => {
+ this.paramsPost = res.data
+ this.orderCode = res.orderCode
+ 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) => {
+ 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) => {
+ 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(
+ api.unifiedorder(params).then(res => {
+ this.aliQrCodeVisible = true
+ this.drawQrcode(res.data)
+ this.checkPayStatus(params)
+ })
+ },
+ getPayAuthToken(payChannel) {
+ return new Promise((resolve, reject) => {
+ const extParam = {
+ isRecharge: !!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)
+ }
+ })
+ })
+ },
+ drawQrcode(text) {
+ let that = this
+ this.$nextTick(() => {
+ new QRCode(
this.$refs.qrCodeUrlWx,
{
width: 280,
height: 280,
- text: res.data,
+ 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)
- })
+ )
+ setTimeout(() => {
+ let qrcodeEle = document.getElementById('qrCodeUrlWx')
+ let cvs = qrcodeEle.querySelector('canvas')
+ that.qrcodeimg = cvs.toDataURL('image/png')
+ }, 1000)
})
- this.checkPayStatus(params)
+ },
+ redirectPay(payChannel) {
+ this.getPayAuthToken(payChannel).then(url => {
+ if (navigator.userAgent.includes('MicroMessenger')) {
+ window.location.href = url
+ } else {
+ requestAnimationFrame(()=>{
+ 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
},
@@ -1432,16 +1359,21 @@ export default {
if (e == 1) {
this.activeNames = 2
} else {
+ if (this.isRecharge) return
this.activeNames = 1
}
},
getPayConfig() {
- api.payConfig().then((res) => {
- this.payList = res.data
+ return new Promise((resolve, reject) => {
+ api.payConfig().then(res => {
+ this.payList = res.data
+ console.log(this.payList)
+ resolve(res.data)
+ })
})
},
getBankList() {
- api.jdBankList().then((res) => {
+ api.jdBankList().then(res => {
this.jdList = res.data
})
// api.hfBankList().then((res) => {
@@ -1456,16 +1388,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
@@ -1479,22 +1417,22 @@ export default {
},
getSpendInfo() {
api
- .spendDetails({
- specialArea: this.specialArea,
- orderCode: this.orderCode,
- pkSettleCountry: this.pkCountry,
- })
- .then((res) => {
- // this.payDetail = res.data
- this.$set(this, 'payDetail', res.data)
- this.$nextTick(() => {
- this.$refs.collapse.init()
+ .spendDetails({
+ specialArea: this.specialArea,
+ orderCode: this.orderCode,
+ pkSettleCountry: this.pkCountry,
+ })
+ .then(res => {
+ // this.payDetail = res.data
+ this.$set(this, 'payDetail', res.data)
+ this.$nextTick(() => {
+ this.$refs.collapse.init()
+ })
+ this.$forceUpdate()
})
- this.$forceUpdate()
- })
},
reset() {
- this.$store.dispatch('GetInfo').then((res) => {
+ this.$store.dispatch('GetInfo').then(res => {
uni.reLaunch({
url: '/pages/index/index',
})
@@ -1509,20 +1447,20 @@ export default {
// 清除定时器
clearInterval(payStatus)
if (
- this.specialArea == 1 ||
- this.specialArea == 7 ||
- this.specialArea == 24
+ this.specialArea == 1 ||
+ 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 {
this.wxPopup = false
- this.wxPopup1 = false
+ this.aliQrCodeVisible = false
this.showSucce = true
}
} else {
- api.payStatus(data).then((res) => {
+ api.payStatus(data).then(res => {
that.sucPay = res.data
})
}
@@ -1539,6 +1477,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)
+ }
+ })
+ })
+ },
},
}
@@ -1556,14 +1509,16 @@ export default {
}
.contxt {
- margin-top: -220rpx;
- padding: 0 26rpx;
+ // margin-top: -220rpx;
+ padding: 40rpx 26rpx 0;
padding-bottom: 300rpx;
}
.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 +1527,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 +1538,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;
@@ -1607,8 +1566,10 @@ export default {
.pf {
display: flex;
align-items: center;
- font-size: 12px;
- font-family: PingFang SC-Semibold, PingFang SC;
+ font-size: 28rpx;
+ font-family:
+ PingFang SC-Semibold,
+ PingFang SC;
font-weight: 600;
color: #333333;
@@ -1645,8 +1606,10 @@ export default {
.flex_ac_i {
display: flex;
align-items: center;
- font-size: 12px;
- font-family: PingFang SC-Regular, PingFang SC;
+ font-size: 28rpx;
+ font-family:
+ PingFang SC-Regular,
+ PingFang SC;
font-weight: 400;
color: #333333;
@@ -1773,14 +1736,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;
}
@@ -1807,4 +1774,9 @@ export default {
justify-content: space-between;
padding-bottom: 15px;
}
+.recharge-input {
+ ::v-deep .uni-input-placeholder {
+ font-size: 48rpx;
+ }
+}