修改活动报名显示问题,升级版本bug,支付正在开发
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"appid" : "__UNI__29C3D60",
|
||||
"description" : "智慧社区居民端面向小区业主使用,支持注册、验证码、账号密码多种登录方式,提供密码找回功能,账号使用安全便捷。支持多小区切换,首页设有轮播 banner、社区公告,集成远程开门、生活缴费、在线报修、访客邀请、社区活动常用服务。全服务板块统一涵盖门禁开门、线上缴费、报修申报、访客预约、投诉反馈、问卷调研、活动报名、社区公示、一键联系物业功能。个人中心可管理房屋、住户、车位、车辆信息,支持更换手机号、修改密码、消息通知设置、版本更新及账号退出,一站式满足业主居家生活、社区服务、房产车辆管理需求,实现社区生活数字化、便捷化。",
|
||||
"versionName" : "1.0.1",
|
||||
"versionCode" : 107,
|
||||
"versionCode" : 109,
|
||||
"transformPx" : false,
|
||||
"uniCloud" : {
|
||||
"provider" : "aliyun",
|
||||
@@ -30,7 +30,8 @@
|
||||
"Barcode" : {},
|
||||
"Payment" : {},
|
||||
"Bluetooth" : {},
|
||||
"Maps" : {}
|
||||
"Maps" : {},
|
||||
"Share" : {}
|
||||
},
|
||||
/* 应用发布信息 */
|
||||
"distribute" : {
|
||||
@@ -72,7 +73,15 @@
|
||||
},
|
||||
"urltypes" : "uppaylyhuts",
|
||||
"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配置 */
|
||||
"sdkConfigs" : {
|
||||
@@ -101,8 +110,8 @@
|
||||
},
|
||||
"share" : {
|
||||
"weixin" : {
|
||||
"appid" : "",
|
||||
"UniversalLinks" : ""
|
||||
"appid" : "wx2255a0821859ef43",
|
||||
"UniversalLinks" : "https://verification.ckdzkj.com/uni-universallinks/__UNI__29C3D60/"
|
||||
}
|
||||
},
|
||||
"payment" : {
|
||||
@@ -117,7 +126,7 @@
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"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) => {
|
||||
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) => {
|
||||
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) => {
|
||||
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">
|
||||
<!-- 活动已结束且未报名,显示不可点击的结束按钮 -->
|
||||
<!-- 活动已结束,显示不可点击的结束按钮 -->
|
||||
<button
|
||||
v-if="isActivityEnded && !hasSigned && activeTab === 'detail'"
|
||||
v-if="isActivityEnded && activeTab === 'detail'"
|
||||
class="action-btn ended-btn"
|
||||
disabled
|
||||
>
|
||||
@@ -168,9 +168,9 @@
|
||||
报名
|
||||
</button>
|
||||
|
||||
<!-- 已报名状态显示取消报名按钮 -->
|
||||
<!-- 已报名状态显示取消报名按钮(活动已结束则隐藏) -->
|
||||
<button
|
||||
v-if="hasSigned && activeTab === 'detail'"
|
||||
v-if="hasSigned && !isActivityEnded && activeTab === 'detail'"
|
||||
class="action-btn cancel-btn"
|
||||
@tap="handleCancelSignup"
|
||||
>
|
||||
@@ -178,7 +178,7 @@
|
||||
</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>
|
||||
|
||||
<!-- 报名确认模态框 -->
|
||||
@@ -235,33 +235,23 @@ const newStatusContent = ref('')
|
||||
const navTitle = ref('')
|
||||
const curActivityId = ref('') // 当前活动的id
|
||||
const activityConent = ref({}) // 获取详情数据
|
||||
// 实况记录数据
|
||||
const liveRecords = ref([])
|
||||
|
||||
// 判断活动是否已结束
|
||||
const isActivityEnded = computed(() => {
|
||||
// 优先使用后端返回的状态字段(status: '2' 或 statusText: '已结束')
|
||||
if (activityConent.value.status === '2' || activityConent.value.statusText === '已结束') return true
|
||||
// 备选:通过 endTime 时间判断
|
||||
if (!activityConent.value.applyDeadline) return false
|
||||
return moment().isAfter(moment(activityConent.value.applyDeadline))
|
||||
// 优先使用列表页传入的statusText
|
||||
if (statusTextFromParam.value === '已结束') return true
|
||||
// 其次使用后端详情接口返回的状态字段
|
||||
// if (activityConent.value.statusText === '已结束') return true
|
||||
// 报名截止时间已过
|
||||
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) =>{
|
||||
navTitle.value = option?.title
|
||||
curActivityId.value = option?.id
|
||||
// 处理applied参数(可能是字符串类型,需要转布尔)
|
||||
hasSigned.value = option?.applied === 'true' || option?.applied === true
|
||||
statusTextFromParam.value = option?.statusText || ''
|
||||
// 处理applied参数
|
||||
hasSigned.value = option?.applied === true
|
||||
// console.log('hasSigned.value',hasSigned.value)
|
||||
// 2. 初始化数据
|
||||
if (curActivityId.value) {
|
||||
|
||||
@@ -167,6 +167,10 @@ export const getopenIdByCode = (data) => {
|
||||
export const getUnionPayTn = (data) => {
|
||||
return post('/api/topUp/unionPay/getTn', data)
|
||||
}
|
||||
// 获取日照银行小程序拉起参数
|
||||
export const getBankMiniProgramParams = (data) => {
|
||||
return post('/api/pay/yidang/create', data)
|
||||
}
|
||||
// 缴费记录查询
|
||||
export const getTopupRecordWithStat = (data) => {
|
||||
return get(
|
||||
@@ -244,8 +248,8 @@ export const getOwnerList = (data) => {
|
||||
}
|
||||
|
||||
// 查询版本信息
|
||||
export const getAppVersion = (platform, channel) => {
|
||||
return get(`/api/app/version/${platform}/${channel}`)
|
||||
export const getAppVersion = (platform, channel,appChannel) => {
|
||||
return get(`/api/app/version/${platform}/${channel}/${appChannel}`)
|
||||
}
|
||||
// 检查是否需要更新
|
||||
export const checkAppUpdate = (data) => {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
let baseUrl = '';
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
baseUrl = 'http://192.168.1.222:8080'; // 开发环境
|
||||
// baseUrl = 'http://wuyeapi.ckdzkj.com';
|
||||
} else {
|
||||
baseUrl = 'https://wuyeapi.ckdzkj.com'; // 生产环境
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
authLogout, getUserProfile, getUserNotify, changeUserNotify, getAppVersion, checkAppUpdate, postUpdateLog
|
||||
} from '/pageSubPack/api/apiSub.js'
|
||||
|
||||
//
|
||||
//
|
||||
const statusBarHeight = ref(20)
|
||||
const cacheSize = ref(0)
|
||||
const currentVersion = ref('1.0.0')
|
||||
@@ -134,16 +134,52 @@
|
||||
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 () => {
|
||||
uni.showLoading({ title: '检查中...', mask: true })
|
||||
// #ifdef APP-PLUS
|
||||
// const channel = plus.runtime.channel; // 云打包自动写入,自定义包为空
|
||||
// const channel = 'xioami'
|
||||
// console.log('channel',channel)
|
||||
// #endif
|
||||
|
||||
try {
|
||||
const systemInfo = uni.getSystemInfoSync()
|
||||
const platform = systemInfo.platform === 'ios' ? 'ios' : 'android'
|
||||
const channel = 'resident'
|
||||
|
||||
const platform = systemInfo.platform === 'android' ? 'android':'ios'
|
||||
const appChannel = 'resident'
|
||||
const channel = 'xiaomi'
|
||||
// const channel = plus.runtime.channel;
|
||||
|
||||
// 1. 查询最新版本
|
||||
const versionRes = await getAppVersion(platform, channel)
|
||||
const versionRes = await getAppVersion(platform, channel, appChannel)
|
||||
console.log('查询最新版本',versionRes.data)
|
||||
if (versionRes.code === 200 && versionRes.data) {
|
||||
const latestVersion = versionRes.data.versionName || ''
|
||||
const latestVersionCode = versionRes.data.versionCode || 0
|
||||
@@ -152,23 +188,31 @@
|
||||
const checkRes = await checkAppUpdate({
|
||||
platform: platform,
|
||||
channel: channel,
|
||||
appChannel: appChannel,
|
||||
currentVersionCode: currentVersionCode.value
|
||||
})
|
||||
uni.hideLoading()
|
||||
|
||||
if (checkRes.code === 200 && checkRes.data) {
|
||||
console.log('是否需要更新',checkRes.data)
|
||||
const needUpdate = checkRes.data.needUpdate !== false
|
||||
if (needUpdate) {
|
||||
// 如果版本号一致,直接提示已是最新版本
|
||||
if (compareVersion(currentVersion.value, latestVersion) >= 0) {
|
||||
uni.showToast({ title: '已是最新版本', icon: 'success' })
|
||||
return
|
||||
}
|
||||
const updateType = checkRes.data.updateType || versionRes.data.updateType || 'optional'
|
||||
const isForce = updateType === 'force'
|
||||
const downloadUrl = versionRes.data.downloadUrl || ''
|
||||
uni.showModal({
|
||||
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,
|
||||
confirmText: '立即更新',
|
||||
cancelText: '稍后',
|
||||
success: (modalRes) => {
|
||||
if (modalRes.confirm && versionRes.data.downloadUrl) {
|
||||
if (modalRes.confirm) {
|
||||
// 记录更新日志
|
||||
const userId = uni.getStorageSync('userId')
|
||||
if (userId) {
|
||||
@@ -179,12 +223,8 @@
|
||||
toVersion: latestVersionCode
|
||||
})
|
||||
}
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.openURL(versionRes.data.downloadUrl)
|
||||
// #endif
|
||||
// #ifndef APP-PLUS
|
||||
uni.showToast({ title: '请在应用商店更新', icon: 'none' })
|
||||
// #endif
|
||||
// 跳转到应用商店更新
|
||||
openAppStore(downloadUrl, platform)
|
||||
} else if (isForce && !modalRes.confirm) {
|
||||
// 强制更新时用户点取消,退出应用
|
||||
// #ifdef APP-PLUS
|
||||
@@ -197,19 +237,19 @@
|
||||
uni.showToast({ title: '已是最新版本', icon: 'success' })
|
||||
}
|
||||
} else {
|
||||
uni.showToast({ title: '检查失败', icon: 'none' })
|
||||
uni.showToast({ title: '检查更新失败1', icon: 'none' })
|
||||
}
|
||||
} else {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '检查失败', icon: 'none' })
|
||||
uni.showToast({ title: '检查更新失败2', icon: 'none' })
|
||||
}
|
||||
} catch (err) {
|
||||
uni.hideLoading()
|
||||
uni.showToast({ title: '检查失败', icon: 'none' })
|
||||
uni.showToast({ title: err.msg || '检查更新失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
const onItemClick = (item) => {
|
||||
if (item.title == '更改手机号码') {
|
||||
uni.redirectTo({
|
||||
@@ -280,7 +320,7 @@
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
uni.showToast({
|
||||
title: `${err}`,
|
||||
title: err.msg,
|
||||
icon: 'error'
|
||||
});
|
||||
})
|
||||
@@ -438,4 +478,4 @@
|
||||
.no-cross-switch>>>.uni-switch-input-checked {
|
||||
background-color: #007aff !important;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -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' })
|
||||
}
|
||||
}
|
||||
|
||||
// 缴费成功推送通知
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
name: paymentItem.name,
|
||||
fullAddress: paymentItem.fullAddress
|
||||
})
|
||||
uni.navigateTo({ url: '/pageSubPack/payment-list/yinlianPayTn' })
|
||||
// uni.navigateTo({ url: '/pageSubPack/payment-list/yinlianPayTn' })
|
||||
}
|
||||
|
||||
// 缴费成功推送通知
|
||||
|
||||
Reference in New Issue
Block a user