修改活动报名显示问题,升级版本bug,支付正在开发
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"appid" : "__UNI__29C3D60",
|
"appid" : "__UNI__29C3D60",
|
||||||
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
||||||
"versionName" : "1.0.1",
|
"versionName" : "1.0.1",
|
||||||
"versionCode" : 107,
|
"versionCode" : 109,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"uniCloud" : {
|
"uniCloud" : {
|
||||||
"provider" : "aliyun",
|
"provider" : "aliyun",
|
||||||
@@ -30,7 +30,8 @@
|
|||||||
"Barcode" : {},
|
"Barcode" : {},
|
||||||
"Payment" : {},
|
"Payment" : {},
|
||||||
"Bluetooth" : {},
|
"Bluetooth" : {},
|
||||||
"Maps" : {}
|
"Maps" : {},
|
||||||
|
"Share" : {}
|
||||||
},
|
},
|
||||||
/* 应用发布信息 */
|
/* 应用发布信息 */
|
||||||
"distribute" : {
|
"distribute" : {
|
||||||
@@ -72,7 +73,15 @@
|
|||||||
},
|
},
|
||||||
"urltypes" : "uppaylyhuts",
|
"urltypes" : "uppaylyhuts",
|
||||||
"urlschemewhitelist" : "bocom,bankabc,cmbmobilebank,cmblife,com.icbc.iphoneclient,spdbbank,citicbankpay,credit,com.cebbank.ebank,BankOfShangHai,boscgdlf,cmbc,cibmb,bocmbankpsn,bankofbjpay",
|
"urlschemewhitelist" : "bocom,bankabc,cmbmobilebank,cmblife,com.icbc.iphoneclient,spdbbank,citicbankpay,credit,com.cebbank.ebank,BankOfShangHai,boscgdlf,cmbc,cibmb,bocmbankpsn,bankofbjpay",
|
||||||
"idfa" : false
|
"idfa" : false,
|
||||||
|
"capabilities" : {
|
||||||
|
"entitlements" : {
|
||||||
|
"com.apple.developer.associated-domains" : [
|
||||||
|
"applinks:static-mp-2d1912d1-5d25-47a9-a4c5-2669573cd0c2.next.bspapp.com",
|
||||||
|
"applinks:verification.ckdzkj.com"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
/* SDK配置 */
|
/* SDK配置 */
|
||||||
"sdkConfigs" : {
|
"sdkConfigs" : {
|
||||||
@@ -101,8 +110,8 @@
|
|||||||
},
|
},
|
||||||
"share" : {
|
"share" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "",
|
"appid" : "wx2255a0821859ef43",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : "https://verification.ckdzkj.com/uni-universallinks/__UNI__29C3D60/"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"payment" : {
|
"payment" : {
|
||||||
@@ -117,7 +126,7 @@
|
|||||||
"oauth" : {
|
"oauth" : {
|
||||||
"weixin" : {
|
"weixin" : {
|
||||||
"appid" : "",
|
"appid" : "",
|
||||||
"UniversalLinks" : ""
|
"UniversalLinks" : "https://verification.ckdzkj.com/uni-universallinks/__UNI__29C3D60/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -209,5 +218,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"_spaceID" : "mp-2d1912d1-5d25-47a9-a4c5-2669573cd0c2"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,7 +322,7 @@ const formatDate = (date) => {
|
|||||||
*/
|
*/
|
||||||
const signupActivity = (activity) => {
|
const signupActivity = (activity) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied}`
|
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied}&statusText=${activity.statusText || ''}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +332,7 @@ const signupActivity = (activity) => {
|
|||||||
*/
|
*/
|
||||||
const cancelActivity = (activity) => {
|
const cancelActivity = (activity) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied}`
|
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied}&statusText=${activity.statusText || ''}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,7 +342,7 @@ const cancelActivity = (activity) => {
|
|||||||
*/
|
*/
|
||||||
const viewActivityDetail = (activity) => {
|
const viewActivityDetail = (activity) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied}`
|
url: `/pageSubPack/activity-list/activityListDetails?id=${activity.id}&title=${activity.title}&applied=${activity.applied}&statusText=${activity.statusText || ''}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -150,9 +150,9 @@
|
|||||||
|
|
||||||
<!-- 底部操作栏 -->
|
<!-- 底部操作栏 -->
|
||||||
<view class="bottom-bar">
|
<view class="bottom-bar">
|
||||||
<!-- 活动已结束且未报名,显示不可点击的结束按钮 -->
|
<!-- 活动已结束,显示不可点击的结束按钮 -->
|
||||||
<button
|
<button
|
||||||
v-if="isActivityEnded && !hasSigned && activeTab === 'detail'"
|
v-if="isActivityEnded && activeTab === 'detail'"
|
||||||
class="action-btn ended-btn"
|
class="action-btn ended-btn"
|
||||||
disabled
|
disabled
|
||||||
>
|
>
|
||||||
@@ -168,9 +168,9 @@
|
|||||||
报名
|
报名
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- 已报名状态显示取消报名按钮 -->
|
<!-- 已报名状态显示取消报名按钮(活动已结束则隐藏) -->
|
||||||
<button
|
<button
|
||||||
v-if="hasSigned && activeTab === 'detail'"
|
v-if="hasSigned && !isActivityEnded && activeTab === 'detail'"
|
||||||
class="action-btn cancel-btn"
|
class="action-btn cancel-btn"
|
||||||
@tap="handleCancelSignup"
|
@tap="handleCancelSignup"
|
||||||
>
|
>
|
||||||
@@ -178,7 +178,7 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<!-- 活动实况页显示添加实况按钮 -->
|
<!-- 活动实况页显示添加实况按钮 -->
|
||||||
<button class="action-btn add-status-btn" v-if="hasSigned &&activeTab === 'status'" @click="liveClick">添加实况</button>
|
<button class="action-btn add-status-btn" v-if="hasSigned && !isActivityEnded && activeTab === 'status'" @click="liveClick">添加实况</button>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 报名确认模态框 -->
|
<!-- 报名确认模态框 -->
|
||||||
@@ -235,33 +235,23 @@ const newStatusContent = ref('')
|
|||||||
const navTitle = ref('')
|
const navTitle = ref('')
|
||||||
const curActivityId = ref('') // 当前活动的id
|
const curActivityId = ref('') // 当前活动的id
|
||||||
const activityConent = ref({}) // 获取详情数据
|
const activityConent = ref({}) // 获取详情数据
|
||||||
|
// 实况记录数据
|
||||||
|
const liveRecords = ref([])
|
||||||
|
|
||||||
// 判断活动是否已结束
|
// 判断活动是否已结束
|
||||||
const isActivityEnded = computed(() => {
|
const isActivityEnded = computed(() => {
|
||||||
// 优先使用后端返回的状态字段(status: '2' 或 statusText: '已结束')
|
// 优先使用列表页传入的statusText
|
||||||
if (activityConent.value.status === '2' || activityConent.value.statusText === '已结束') return true
|
if (statusTextFromParam.value === '已结束') return true
|
||||||
// 备选:通过 endTime 时间判断
|
// 其次使用后端详情接口返回的状态字段
|
||||||
if (!activityConent.value.applyDeadline) return false
|
// if (activityConent.value.statusText === '已结束') return true
|
||||||
return moment().isAfter(moment(activityConent.value.applyDeadline))
|
// 报名截止时间已过
|
||||||
|
if (activityConent.value.applyDeadline && moment().isAfter(moment(activityConent.value.applyDeadline))) return true
|
||||||
|
// 活动结束时间已过
|
||||||
|
if (activityConent.value.endTime && moment().isAfter(moment(activityConent.value.endTime))) return true
|
||||||
|
return false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 实况记录数据
|
|
||||||
const liveRecords = ref([
|
|
||||||
// {
|
|
||||||
// id: 1,
|
|
||||||
// user: '微信用户',
|
|
||||||
// time: '2023-08-20 16:00:02',
|
|
||||||
// content: '参与活动打卡',
|
|
||||||
// images: []
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// id: 2,
|
|
||||||
// user: '微信用户',
|
|
||||||
// time: '2023-08-20 16:20:02',
|
|
||||||
// content: '目前现场的互动氛围很好',
|
|
||||||
// images: ['http://47.104.199.163:9090/images/logo.png', 'http://47.104.199.163:9090/images/repair/house1.png']
|
|
||||||
// }
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
// ========方法=====
|
// ========方法=====
|
||||||
@@ -272,11 +262,13 @@ const formatTime = (timeStr) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---接收参数---
|
// ---接收参数---
|
||||||
|
const statusTextFromParam = ref('') // 从列表页传入的活动状态文本
|
||||||
onLoad((option) =>{
|
onLoad((option) =>{
|
||||||
navTitle.value = option?.title
|
navTitle.value = option?.title
|
||||||
curActivityId.value = option?.id
|
curActivityId.value = option?.id
|
||||||
// 处理applied参数(可能是字符串类型,需要转布尔)
|
statusTextFromParam.value = option?.statusText || ''
|
||||||
hasSigned.value = option?.applied === 'true' || option?.applied === true
|
// 处理applied参数
|
||||||
|
hasSigned.value = option?.applied === true
|
||||||
// console.log('hasSigned.value',hasSigned.value)
|
// console.log('hasSigned.value',hasSigned.value)
|
||||||
// 2. 初始化数据
|
// 2. 初始化数据
|
||||||
if (curActivityId.value) {
|
if (curActivityId.value) {
|
||||||
|
|||||||
@@ -167,6 +167,10 @@ export const getopenIdByCode = (data) => {
|
|||||||
export const getUnionPayTn = (data) => {
|
export const getUnionPayTn = (data) => {
|
||||||
return post('/api/topUp/unionPay/getTn', data)
|
return post('/api/topUp/unionPay/getTn', data)
|
||||||
}
|
}
|
||||||
|
// 获取日照银行小程序拉起参数
|
||||||
|
export const getBankMiniProgramParams = (data) => {
|
||||||
|
return post('/api/pay/yidang/create', data)
|
||||||
|
}
|
||||||
// 缴费记录查询
|
// 缴费记录查询
|
||||||
export const getTopupRecordWithStat = (data) => {
|
export const getTopupRecordWithStat = (data) => {
|
||||||
return get(
|
return get(
|
||||||
@@ -244,8 +248,8 @@ export const getOwnerList = (data) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询版本信息
|
// 查询版本信息
|
||||||
export const getAppVersion = (platform, channel) => {
|
export const getAppVersion = (platform, channel,appChannel) => {
|
||||||
return get(`/api/app/version/${platform}/${channel}`)
|
return get(`/api/app/version/${platform}/${channel}/${appChannel}`)
|
||||||
}
|
}
|
||||||
// 检查是否需要更新
|
// 检查是否需要更新
|
||||||
export const checkAppUpdate = (data) => {
|
export const checkAppUpdate = (data) => {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
let baseUrl = '';
|
let baseUrl = '';
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
baseUrl = 'http://192.168.1.222:8080'; // 开发环境
|
baseUrl = 'http://192.168.1.222:8080'; // 开发环境
|
||||||
|
// baseUrl = 'http://wuyeapi.ckdzkj.com';
|
||||||
} else {
|
} else {
|
||||||
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,16 +134,52 @@
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 跳转到应用商店更新
|
||||||
|
const openAppStore = (downloadUrl, platform) => {
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
if (downloadUrl) {
|
||||||
|
// 优先使用服务端返回的应用商店地址
|
||||||
|
const pkgName = plus.runtime.appid || ''
|
||||||
|
console.log('包名---------',pkgName)
|
||||||
|
// 无论返回哪种 downloadUrl,都在后面拼接包名
|
||||||
|
const finalUrl = downloadUrl + pkgName
|
||||||
|
plus.runtime.openURL(finalUrl)
|
||||||
|
} else if (platform === 'ios') {
|
||||||
|
// iOS: 打开 App Store(需在 Apple Developer 后台获取 Apple ID)
|
||||||
|
plus.runtime.openURL('itms-apps://itunes.apple.com/app/id' + plus.runtime.appid)
|
||||||
|
} else {
|
||||||
|
// Android: 通过 market 协议唤起手机自带应用商店
|
||||||
|
const packageName = plus.runtime.appid || ''
|
||||||
|
plus.runtime.openURL('market://details?id=' + packageName, () => {
|
||||||
|
// market 协议失败时的回调,提示用户手动前往应用商店
|
||||||
|
uni.showToast({ title: '请前往应用商店更新', icon: 'none' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// #endif
|
||||||
|
// #ifndef APP-PLUS
|
||||||
|
uni.showToast({ title: '请在应用商店更新', icon: 'none' })
|
||||||
|
// #endif
|
||||||
|
}
|
||||||
|
|
||||||
// 检查版本更新
|
// 检查版本更新
|
||||||
const checkVersionUpdate = async () => {
|
const checkVersionUpdate = async () => {
|
||||||
uni.showLoading({ title: '检查中...', mask: true })
|
uni.showLoading({ title: '检查中...', mask: true })
|
||||||
|
// #ifdef APP-PLUS
|
||||||
|
// const channel = plus.runtime.channel; // 云打包自动写入,自定义包为空
|
||||||
|
// const channel = 'xioami'
|
||||||
|
// console.log('channel',channel)
|
||||||
|
// #endif
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const systemInfo = uni.getSystemInfoSync()
|
const systemInfo = uni.getSystemInfoSync()
|
||||||
const platform = systemInfo.platform === 'ios' ? 'ios' : 'android'
|
const platform = systemInfo.platform === 'android' ? 'android':'ios'
|
||||||
const channel = 'resident'
|
const appChannel = 'resident'
|
||||||
|
const channel = 'xiaomi'
|
||||||
|
// const channel = plus.runtime.channel;
|
||||||
|
|
||||||
// 1. 查询最新版本
|
// 1. 查询最新版本
|
||||||
const versionRes = await getAppVersion(platform, channel)
|
const versionRes = await getAppVersion(platform, channel, appChannel)
|
||||||
|
console.log('查询最新版本',versionRes.data)
|
||||||
if (versionRes.code === 200 && versionRes.data) {
|
if (versionRes.code === 200 && versionRes.data) {
|
||||||
const latestVersion = versionRes.data.versionName || ''
|
const latestVersion = versionRes.data.versionName || ''
|
||||||
const latestVersionCode = versionRes.data.versionCode || 0
|
const latestVersionCode = versionRes.data.versionCode || 0
|
||||||
@@ -152,23 +188,31 @@
|
|||||||
const checkRes = await checkAppUpdate({
|
const checkRes = await checkAppUpdate({
|
||||||
platform: platform,
|
platform: platform,
|
||||||
channel: channel,
|
channel: channel,
|
||||||
|
appChannel: appChannel,
|
||||||
currentVersionCode: currentVersionCode.value
|
currentVersionCode: currentVersionCode.value
|
||||||
})
|
})
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|
||||||
if (checkRes.code === 200 && checkRes.data) {
|
if (checkRes.code === 200 && checkRes.data) {
|
||||||
|
console.log('是否需要更新',checkRes.data)
|
||||||
const needUpdate = checkRes.data.needUpdate !== false
|
const needUpdate = checkRes.data.needUpdate !== false
|
||||||
if (needUpdate) {
|
if (needUpdate) {
|
||||||
|
// 如果版本号一致,直接提示已是最新版本
|
||||||
|
if (compareVersion(currentVersion.value, latestVersion) >= 0) {
|
||||||
|
uni.showToast({ title: '已是最新版本', icon: 'success' })
|
||||||
|
return
|
||||||
|
}
|
||||||
const updateType = checkRes.data.updateType || versionRes.data.updateType || 'optional'
|
const updateType = checkRes.data.updateType || versionRes.data.updateType || 'optional'
|
||||||
const isForce = updateType === 'force'
|
const isForce = updateType === 'force'
|
||||||
|
const downloadUrl = versionRes.data.downloadUrl || ''
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: isForce ? '强制更新' : '发现新版本',
|
title: isForce ? '强制更新' : '发现新版本',
|
||||||
content: `当前版本:${currentVersion.value}\n最新版本:${latestVersion}${versionRes.data.releaseNotes || versionRes.data.updateDesc ? '\n\n更新内容:' + (versionRes.data.releaseNotes || versionRes.data.updateDesc) : ''}`,
|
content: `当前版本:${currentVersion.value}\n最新版本:${latestVersion}${versionRes.data.releaseNotes ? '\n\n更新内容:' + (versionRes.data.releaseNotes) : ''}`,
|
||||||
showCancel: !isForce,
|
showCancel: !isForce,
|
||||||
confirmText: '立即更新',
|
confirmText: '立即更新',
|
||||||
cancelText: '稍后',
|
cancelText: '稍后',
|
||||||
success: (modalRes) => {
|
success: (modalRes) => {
|
||||||
if (modalRes.confirm && versionRes.data.downloadUrl) {
|
if (modalRes.confirm) {
|
||||||
// 记录更新日志
|
// 记录更新日志
|
||||||
const userId = uni.getStorageSync('userId')
|
const userId = uni.getStorageSync('userId')
|
||||||
if (userId) {
|
if (userId) {
|
||||||
@@ -179,12 +223,8 @@
|
|||||||
toVersion: latestVersionCode
|
toVersion: latestVersionCode
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// #ifdef APP-PLUS
|
// 跳转到应用商店更新
|
||||||
plus.runtime.openURL(versionRes.data.downloadUrl)
|
openAppStore(downloadUrl, platform)
|
||||||
// #endif
|
|
||||||
// #ifndef APP-PLUS
|
|
||||||
uni.showToast({ title: '请在应用商店更新', icon: 'none' })
|
|
||||||
// #endif
|
|
||||||
} else if (isForce && !modalRes.confirm) {
|
} else if (isForce && !modalRes.confirm) {
|
||||||
// 强制更新时用户点取消,退出应用
|
// 强制更新时用户点取消,退出应用
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
@@ -197,15 +237,15 @@
|
|||||||
uni.showToast({ title: '已是最新版本', icon: 'success' })
|
uni.showToast({ title: '已是最新版本', icon: 'success' })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: '检查失败', icon: 'none' })
|
uni.showToast({ title: '检查更新失败1', icon: 'none' })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({ title: '检查失败', icon: 'none' })
|
uni.showToast({ title: '检查更新失败2', icon: 'none' })
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({ title: '检查失败', icon: 'none' })
|
uni.showToast({ title: err.msg || '检查更新失败', icon: 'none' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,7 +320,7 @@
|
|||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: `${err}`,
|
title: err.msg,
|
||||||
icon: 'error'
|
icon: 'error'
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -112,6 +112,9 @@
|
|||||||
import {
|
import {
|
||||||
getPushSingle
|
getPushSingle
|
||||||
} from '/pageSubPack/api/api.js'
|
} from '/pageSubPack/api/api.js'
|
||||||
|
import {
|
||||||
|
getBankMiniProgramParams
|
||||||
|
} from '/pageSubPack/api/apiSub.js'
|
||||||
|
|
||||||
// 响应式数据
|
// 响应式数据
|
||||||
const outstandingPayment = ref(true)
|
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')
|
const paySuccess = uni.getStorageSync('paySuccess')
|
||||||
if (paySuccess) {
|
if (paySuccess) {
|
||||||
uni.removeStorageSync('paySuccess')
|
uni.removeStorageSync('paySuccess')
|
||||||
@@ -160,8 +173,8 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 立即缴费 — 跳转到支付收银台选择支付方式
|
// 立即缴费 — 通过微信拉起日照银行小程序进行支付
|
||||||
const handlePay = () => {
|
const handlePay = async () => {
|
||||||
if (!payNum.value || Number(payNum.value) <= 0) {
|
if (!payNum.value || Number(payNum.value) <= 0) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '请输入正确的缴费金额',
|
title: '请输入正确的缴费金额',
|
||||||
@@ -169,14 +182,54 @@
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.setStorageSync('payData', {
|
|
||||||
amount: payNum.value,
|
try {
|
||||||
deviceCode: paymentItem.deviceCode,
|
uni.showLoading({ title: '加载中...' })
|
||||||
type: paymentItem.type,
|
|
||||||
name: paymentItem.name,
|
// 设备类型映射:电费→1(电表),水费→2(水表)
|
||||||
fullAddress: paymentItem.fullAddress
|
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.navigateTo({ url: '/pageSubPack/payment-list/yinlianPayTn' })
|
|
||||||
|
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' })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 缴费成功推送通知
|
// 缴费成功推送通知
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
name: paymentItem.name,
|
name: paymentItem.name,
|
||||||
fullAddress: paymentItem.fullAddress
|
fullAddress: paymentItem.fullAddress
|
||||||
})
|
})
|
||||||
uni.navigateTo({ url: '/pageSubPack/payment-list/yinlianPayTn' })
|
// uni.navigateTo({ url: '/pageSubPack/payment-list/yinlianPayTn' })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 缴费成功推送通知
|
// 缴费成功推送通知
|
||||||
|
|||||||
Reference in New Issue
Block a user