修改活动报名显示问题,升级版本bug,支付正在开发
This commit is contained in:
@@ -112,6 +112,9 @@
|
||||
import {
|
||||
getPushSingle
|
||||
} from '/pageSubPack/api/api.js'
|
||||
import {
|
||||
getBankMiniProgramParams
|
||||
} from '/pageSubPack/api/apiSub.js'
|
||||
|
||||
// 响应式数据
|
||||
const outstandingPayment = ref(true)
|
||||
@@ -128,7 +131,17 @@
|
||||
})
|
||||
|
||||
// 从支付收银台返回时检查支付结果
|
||||
onShow(() => {
|
||||
onShow((options) => {
|
||||
// 检查是否有从日照银行小程序返回的支付结果
|
||||
if (options && options.referrerInfo && options.referrerInfo.extraData) {
|
||||
const extraData = options.referrerInfo.extraData
|
||||
if (extraData.payResult === 'success') {
|
||||
currentStep.value = 2
|
||||
sendPaySuccessPush()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const paySuccess = uni.getStorageSync('paySuccess')
|
||||
if (paySuccess) {
|
||||
uni.removeStorageSync('paySuccess')
|
||||
@@ -160,8 +173,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 立即缴费 — 跳转到支付收银台选择支付方式
|
||||
const handlePay = () => {
|
||||
// 立即缴费 — 通过微信拉起日照银行小程序进行支付
|
||||
const handlePay = async () => {
|
||||
if (!payNum.value || Number(payNum.value) <= 0) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的缴费金额',
|
||||
@@ -169,14 +182,54 @@
|
||||
})
|
||||
return
|
||||
}
|
||||
uni.setStorageSync('payData', {
|
||||
amount: payNum.value,
|
||||
deviceCode: paymentItem.deviceCode,
|
||||
type: paymentItem.type,
|
||||
name: paymentItem.name,
|
||||
fullAddress: paymentItem.fullAddress
|
||||
})
|
||||
uni.navigateTo({ url: '/pageSubPack/payment-list/yinlianPayTn' })
|
||||
|
||||
try {
|
||||
uni.showLoading({ title: '加载中...' })
|
||||
|
||||
// 设备类型映射:电费→1(电表),水费→2(水表)
|
||||
const deviceTypeMap = { '电费': '1', '水费': '2' }
|
||||
const mappedDeviceType = deviceTypeMap[paymentItem.type] || paymentItem.deviceType || ''
|
||||
|
||||
const res = await getBankMiniProgramParams({
|
||||
acct: uni.getStorageSync('userId'), // 用户userId
|
||||
orderType: '20', // 水电费等手输金额
|
||||
orderAmount: String(Math.round(Number(payNum.value) * 100)), // 金额,单位:分
|
||||
deviceCode: paymentItem.deviceCode || '',
|
||||
deviceType: mappedDeviceType, // 1-电表,2-水表
|
||||
billId: paymentItem.billId || '', // 账单明细ID
|
||||
residentUserId: uni.getStorageSync('userId'),
|
||||
goodName: paymentItem.name || '' // 商品名称
|
||||
})
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
if (res.code !== 200 || !res.data) {
|
||||
uni.showToast({ title: res.msg || '获取支付参数失败', icon: 'none' })
|
||||
return
|
||||
}
|
||||
console.log('resres返回数据',res)
|
||||
console.log('resres',res.data)
|
||||
|
||||
const { appId, path, extraData } = res.data
|
||||
|
||||
uni.navigateToMiniProgram({
|
||||
appId: appId,
|
||||
path: path || '',
|
||||
extraData: extraData || {},
|
||||
envVersion: 'release',
|
||||
success: () => {
|
||||
console.log('成功拉起日照银行小程序')
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('拉起日照银行小程序失败', err)
|
||||
uni.showToast({ title: err.msg ||'拉起支付小程序失败', icon: 'none' })
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
uni.hideLoading()
|
||||
console.error('获取支付参数异常', err)
|
||||
uni.showToast({ title: err.msg || '请求异常,请重试', icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
// 缴费成功推送通知
|
||||
|
||||
Reference in New Issue
Block a user