对接银联和日照银行分开页面

This commit is contained in:
zhouyanli
2026-09-21 14:07:37 +08:00
parent 4f209b8fb7
commit cf8e8263b7
9 changed files with 1357 additions and 100 deletions

View File

@@ -210,44 +210,31 @@ const canPay = computed(() => {
return billList.value[0].selected && selected.length > 0
})
// 批量缴费
// 批量缴费:跳转银联收银台选择支付方式
const handleBatchPay = () => {
const selected = billList.value.filter(m => m.selected)
if (!selected.length) return
const allIds = selected.flatMap(m => m.billIds)
const token = uni.getStorageSync('token') || ''
const allIds = selected.flatMap(m => m.billIds).filter(Boolean)
if (!allIds.length) {
uni.showToast({ title: '账单信息异常,请稍后重试', icon: 'none' })
return
}
const userId = uni.getStorageSync('userId') || ''
const query = [
['acct', userId],
['orderType', '10'],
['billIds', allIds.join(',')],
// ['deviceType', '3'],
['residentUserId', userId],
['token', token]
].map(([k, v]) => encodeURIComponent(k) + '=' + encodeURIComponent(v)).join('&')
console.log('往小程序传递的参数',query)
// #ifdef APP-PLUS
uni.showLoading({ title: '加载中...' })
plus.share.getServices((services) => {
const wx = services.find(s => s.id === 'weixin')
uni.hideLoading()
if (!wx) return uni.showToast({ title: '未检测到微信客户端', icon: 'none' })
if (!wx.launchMiniProgram) return uni.showToast({ title: '当前微信版本太低,不支持拉起小程序', icon: 'none' })
wx.launchMiniProgram({
id: 'gh_a765aef0172c',
type: 0,//0正式版,1开发版,2体验版
path: 'pages/arrearsPayment/arrearsPayment?' + query,
}, (res) => {
console.log('小程序回调:', JSON.stringify(res))
}, (err) => {
console.error('拉起失败:', JSON.stringify(err))
uni.showToast({ title: '拉起支付小程序失败', icon: 'none' })
})
// 收银台页面(yinlianPayTn)从 payData 中取参数
uni.setStorageSync('payData', {
...cacheItem,
amount: selectedTotal.value.toFixed(2),
billIds: allIds,
type: cacheItem.type || cacheItem.name || '物业费',
residentUserId: userId
})
uni.navigateTo({
url: '/pageSubPack/payment-list/yinlianPayTn'
})
// #endif
}
</script>