From 9ebe66cacb4ecb93a81c4b9d9f12fc47bc6e4bc0 Mon Sep 17 00:00:00 2001 From: zhouyanli <593579392@qq.com> Date: Sat, 25 Jul 2026 11:38:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- huakai-app/App.vue | 59 +- huakai-app/pageSubPack/api/api.js | 143 +-- huakai-app/pageSubPack/api/apiSub.js | 205 +---- huakai-app/pageSubPack/api/appLaunch.js | 78 ++ huakai-app/pageSubPack/api/request.js | 28 - huakai-app/pageSubPack/api/useImageUpload.js | 190 ---- huakai-app/pageSubPack/loginSub/login.vue | 4 +- huakai-app/pageSubPack/loginSub/pwd-login.vue | 4 +- .../payment-list/addHydropower.vue | 2 +- .../pageSubPack/payment-list/addPayment.vue | 2 +- .../payment-list/addPaymentSuccess.vue | 2 +- .../payment-list/arrearsPayment.vue | 819 ++---------------- .../payment-list/noArrearsPayment.vue | 2 +- .../payment-list/paymentRecord.vue | 2 +- .../payment-list/selectPaymentEntity.vue | 2 +- huakai-app/pages.json | 383 +------- huakai-app/pages/index/index.vue | 8 - huakai-app/pages/login/login.vue | 8 - huakai-app/pages/navigation/navigation.vue | 243 ------ .../pages/paymentIndex/paymentIndex.vue | 33 +- 20 files changed, 238 insertions(+), 1979 deletions(-) create mode 100644 huakai-app/pageSubPack/api/appLaunch.js delete mode 100644 huakai-app/pageSubPack/api/useImageUpload.js delete mode 100644 huakai-app/pages/index/index.vue delete mode 100644 huakai-app/pages/login/login.vue delete mode 100644 huakai-app/pages/navigation/navigation.vue diff --git a/huakai-app/App.vue b/huakai-app/App.vue index 13d0db7..87de236 100644 --- a/huakai-app/App.vue +++ b/huakai-app/App.vue @@ -1,73 +1,50 @@ diff --git a/huakai-app/pageSubPack/api/api.js b/huakai-app/pageSubPack/api/api.js index 9a9f54f..5edfddd 100644 --- a/huakai-app/pageSubPack/api/api.js +++ b/huakai-app/pageSubPack/api/api.js @@ -1,141 +1,22 @@ -import request,{get,post,upload} from "./request.js" - +import request, { get, post } from "./request.js" // =======账号密码登录======== -export const getLoginPassword = (data) =>{ - return post('/api/resident/auth/loginByPassword',data) +export const getLoginPassword = (data) => { + return post('/api/resident/auth/loginByPassword', data) } -// 注册新用户获取验证码 -export const getSendCode = (data) =>{ - return post('/api/resident/auth/sendSmsCode',data) +// 获取验证码 +export const getSendCode = (data) => { + return post('/api/resident/auth/sendSmsCode', data) } // 注册新用户 -export const getRegisterUser = (data) =>{ - return post('/api/resident/auth/register',data) +export const getRegisterUser = (data) => { + return post('/api/resident/auth/register', data) } // 短信验证码登录 -export const getLoginBySms = (data) =>{ - return post('/api/resident/auth/loginBySms',data) +export const getLoginBySms = (data) => { + return post('/api/resident/auth/loginBySms', data) } // 忘记密码接口 -export const getResetPassword = (data) =>{ - return post('/api/resident/auth/resetPassword',data) +export const getResetPassword = (data) => { + return post('/api/resident/auth/resetPassword', data) } -// =========首页======= -// 获取bannar图 -export const getBannarList = (data) =>{ - return get('/resident/banner',data) -} -// 首页最新公告 -export const getNoticeLatest = () =>{ - return get('/api/resident/notice/latest') -} - -// 查询已认证的小区 -export const getVillageList = (data) =>{ - return get('/api/resident/village/myList', data) -} -// 获取当前小区 -export const getCurrentVillage = () =>{ - return get('/api/resident/village/current') -} -// 切换小区 -export const getVillageSwitch = (data)=>{ - return post('/api/resident/village/switch',data) -} -// 首页最新活动列表 -export const getActivitylatest = () =>{ - return get('/api/resident/activity/latest') -} - -// ========公告列表====== -// 获取公告列表 -export const getNoticeList = (data) =>{ - return get('/api/resident/notice/list',data) -} -// 获取公告详情 -export const getNoticeDetails = (noticeId) =>{ - return get(`/api/resident/notice/${noticeId}`) -} -// =========键开门=============== -// 查询门禁列表 -export const getAccessDevices = (data) =>{ - return get("/api/resident/access/devices",data) -} -// 确认开门 -export const getAccessOpen = (data) =>{ - return post("/api/resident/access/open",data) -} -// ==========活动列表=========== -// 获取活动列表 -export const getActivityList = (data) =>{ - return get("/api/resident/activity/list",data) -} -// 获取活动列表详情 -export const getActivityDetails = (id) =>{ - return get(`/api/resident/activity/${id}`) -} -// 确认报名 -export const confirmResident = (id) =>{ - return post(`/api/resident/activity/${id}/apply`) -} -// 取消报名 -export const cancelActivity = (id) =>{ - return post(`/api/resident/activity/${id}/cancel`) -} -// =========我的活动======== -export const getMyActivityList = (data) =>{ - return get("/api/resident/activity/my",data) -} -// ===========活动实况============ -// 活动实况列表 -export const getActivityLive = (id) =>{ - return get(`/api/resident/activity/${id}/live`) -} -// 添加实况 -export const addActivityLive = (id, data) =>{ - return post(`/api/resident/activity/${id}/live`, data) -} -// 签到 -export const signinActivityLive = (id, data) =>{ - return post(`/api/resident/activity/${id}/signin`, data) -} -// ==============在线报修======== -// 添加报修工单 -export const addQueryRepair = (data) =>{ - return post("/repairOrder/addRepair",data) -} -// 获取公共维修项目列表 -export const getRepairProjectList = (data) =>{ - return get("/repairOrder/list",data) -} -// 获取报修列表 -export const getQueryRepair = (data) =>{ - return get("/repairOrder/queryRepair",data) -} -// 获取房屋列表 -export const getHouseList = (data) =>{ - return get('/api/resident/my/house/list',data) -} -// 报修详情 -export const getRepairDetail = (data) =>{ - return get('/repairOrder/queryRepairDetail',data) -} -// =========访客邀请=========== -// 获取访客列表 -export const getVisitorList = (data) =>{ - return get('/api/visitor/list',data) -} -// 获取详情信息 -export const getVisitorDetail = (id) =>{ - return get(`/api/visitor/${id}`) -} -// 新增访客 -export const addVisitorData = (data) =>{ - return post("/api/visitor", data) -} - -// 上传单张图片 -export const uploadFile = (filePath) => { - return upload(filePath,'/api/resident/file/uploadImage'); -} \ No newline at end of file diff --git a/huakai-app/pageSubPack/api/apiSub.js b/huakai-app/pageSubPack/api/apiSub.js index 382909a..11bcc80 100644 --- a/huakai-app/pageSubPack/api/apiSub.js +++ b/huakai-app/pageSubPack/api/apiSub.js @@ -1,135 +1,16 @@ import request, { get, - post, - deleteMethod, - putMethod + post } from "./request.js" +// ======= 缴费相关 API ======= + // 字典 export const getSystemDictData = (data) => { return get('/system/dict/data/list', data) } -// =======公告列表======== -export const getResidentNoticeList = (data) => { - return get('/api/resident/notice/list', data) -} -// 我的房屋列表 -export const getMyHouseList = (data) => { - return get('/api/resident/my/house/list', data) -} -// 提交房屋注册认证申请 -export const myHouseApply = (data) => { - return post('/api/resident/my/house/apply', data) -} -// 查询小区列表 -export const getVillageList = (data) => { - return get('/api/resident/village/list', data) -} // 查询楼栋列表 -export const getHouseBuildings = (data) => { - return get('/api/resident/house/buildings', data) -} -// 查询单元列表 -export const getHouseUnits = (data) => { - return get('/api/resident/house/units', data) -} -// 查询楼层列表 -export const getHouseFloors = (data) => { - return get('/api/resident/house/floors', data) -} -// 查询户号列表 -export const getHouseHouses = (data) => { - return get('/api/resident/house/houses', data) -} -// 房屋绑定手机获取验证码 -export const getHouseAuthSendSmsCode = (data) => { - return post('/api/resident/auth/sendSmsCode', data) -} -// 房屋详情 -export const getMyHouseDetail = (data) => { - return get(`/api/resident/my/house/${data.id}`, data) -} -// 删除房屋 -export const deleteMyHouse = (data) => { - return deleteMethod(`/api/resident/my/house/${data.id}`, data) -} -// 设置默认房屋 -export const setMyHouseDefault = (data) => { - return post(`/api/resident/my/house/default`, data) -} -// 获取当前用户登录信息 -export const getUserProfile = (data) => { - return get(`/api/resident/user/profile`, data) -} -// 发送新手机号验证码 -export const getAuthSendSmsCode = (data) => { - return post(`/api/resident/auth/sendSmsCode`, data) -} -// 更改手机号 -export const getUserChangePhone = (data) => { - return post(`/api/resident/user/changePhone`, data) -} -// 获取消息通知开关 -export const getUserNotify = (data) => { - return get(`/api/resident/user/notify`, data) -} -// 更新消息通知开关 -export const changeUserNotify = (data) => { - return post(`/api/resident/user/notify`, data) -} // 修改密码(需登录) -export const authChangePassword = (data) => { - return post(`/api/resident/auth/changePassword`, data) -} // 退出登录 -export const authLogout = (data) => { - return post(`/api/resident/auth/logout`, data) -} -// 编辑房屋 -export const upDateMyHouse = (data) => { - return putMethod(`/api/resident/my/house/${data.id}`, data) - -} - -// =========问卷调查========= -// 问卷列表 -export const getQuestionnaireList = (data) => { - return get('/api/resident/questionnaire/list',data) -} -// 问卷详情 -export const getQuestionnaireDetail = (data) => { - return get('/api/resident/questionnaire/myAnswers',data) -} -// 提交问卷 -export const submitQuestionnair = (id,data) => { - return post(`/api/resident/questionnaire/${id}/submit`, data) -} -// =====投诉意见======= -// 获取投诉类型 -export const getComplainType = () => { - return get('/complain/getComplainType') -} -// 获取投诉列表 -export const getComplainList = (data) => { - return get('/complain/getComplainList',data) -} -// 提交投诉建议 -export const addComplain = (data) => { - return post('/complain/add',data) -} -// 投诉详情 -export const getComplainDetail = (data) => { - return get('/complain/detail',data) -} -// 联系物业 -export const getManagePhoneData = (data) => { - return get('/api/manage/banner/getManagePhone',data) -} - -// 修改身份证照片 -export const uploadFileUploadImage = (data) => { - return post(`/api/resident/file/uploadImage`, data) -} - -// 水电表 +// 查询水电表列表 export const getTopUpSelectByResident = (data) => { console.log(data); return get(`/api/topUp/selectByResident/${data.residentUserId}`, data) @@ -139,18 +20,21 @@ export const getTopUpBindDevice = (data) => { return post(`/api/topUp/bindDevice/${data.deviceCode}/${data.residentUserId}/${data.openid}/${data.deviceType}`, data) } -// 充值调用 -// /${data.rechargeAmount}/${data.type}/${data.deviceCode} +// 充值下单 export const getTopUp = (data) => { return post(`/api/topUp`, data) } +// 获取 openid export const getopenIdByCode = (data) => { return get(`/api/topUp/getOpenIdByCode?code=${data.code}`, data) } - -// 微信支付调用 -export const getToWxPay = (data) => { - return post(`/api/topUp/wxPay/${data.orderId}/${data.openid}`, data) +// 保存 openid +export const postInsertOpenId = (data) => { + return post(`/api/resident/auth/insertOpenId`, data) +} +// 日照银行支付参数获取 +export const getToRizhaoPay = (data) => { + return post(`/api/topUp/rizhaoPay/${data.orderId}/${data.openid}`, data) } // 缴费记录查询 export const getTopupRecordWithStat = (data) => { @@ -158,68 +42,7 @@ export const getTopupRecordWithStat = (data) => { `/api/topUp/topupRecordWithStat?residentUserId=${data.residentUserId}&pageNum=${data.pageNum}&pageSize=${data.pageSize}`, data) } -export const postInsertOpenId = (data) => { - return post(`/api/resident/auth/insertOpenId`, data) -} +// 微信订阅消息授权保存 export const postSubscribeAuth = (data) => { return post(`/api/wx/subscribeAuth/auth`, data) } - -// 添加车辆 -export const postCar = (data) => { - return post(`/api/resident/car`, data) -} -// 修改车辆 -export const putCar = (data) => { - return putMethod(`/api/resident/car`, data) -} - -// 获取车辆列表 -export const getMyCarList = (data) => { - return get(`/api/resident/car/myList`, data) -} -// 获取车位列表 -export const getCarList = (data) => { - return get(`/api/resident/car/list`, data) -} -// 获取车辆详细信息 -export const getCarDetail = (data) => { - return get(`/api/resident/car/${data.id}`, data) -} -// 删除车辆信息 -export const deleteCar = (data) => { - return deleteMethod(`/api/resident/car/${data.carId}`, data) -} -// 获取用户车位绑定列表 -export const getUserParkingSpaceList = (data) => { - return get(`/api/resident/car/parking/list`, data) -} - -// 获取区域列表 -export const getResidentCarAreaManageAreaListByVillageId = (data) => { - return get(`/ResidentCarAreaManage/areaListByVillageId`, data) -} -// 根据区域id获得车位列表 -export const getResidentCarAreaManageParkingListByAreaId = (data) => { - return get(`/ResidentCarAreaManage/parkingListByAreaId`, data) -} -// 绑定车位 -export const postCarBind = (data) => { - return post(`/api/resident/car/bind`, data) -} -// 获取用户下车位绑定信息 -// export const getCarList = (data) => { -// return get(`/api/resident/car/list`, data) -// } -// 删除车位 -export const deleteParking = (data) => { - return deleteMethod(`/ResidentCarAreaManage/parking/${data.parkingId}`, data) -} -// 车位详情 -export const getParkingDetail = (data) => { - return get(`/api/resident/car/parking/detail/${data.id}`, data) -} -// 解绑车辆 -export const rebindCar = (data) => { - return post(`/ResidentCarAreaManage/rebind`, data) -} diff --git a/huakai-app/pageSubPack/api/appLaunch.js b/huakai-app/pageSubPack/api/appLaunch.js new file mode 100644 index 0000000..4c68bc9 --- /dev/null +++ b/huakai-app/pageSubPack/api/appLaunch.js @@ -0,0 +1,78 @@ +/** + * App 跳转参数处理 + * 花开物业 App 通过 path query string 将 token、支付参数传入本中间小程序。 + * + * App 传入示例: + * pageSubPack/payment-list/arrearsPayment?token=xxx&userId=xxx&payAmount=10&acct=xxx&custId=xxx&sign=xxx&... + */ + +const STORAGE_KEY = 'app_launch_payment_data' + +/** + * 从启动参数中获取 App 传入的全部数据(支付参数 + token + userId) + */ +export function captureAppLaunchData(onShowOptions) { + let data = null + + const tryGetData = (options, label) => { + if (!options) return null + console.log(label, JSON.stringify(options)) + if (options.query && Object.keys(options.query).length > 0) { + return options.query + } + if (options?.referrerInfo?.extraData) { + return options.referrerInfo.extraData + } + return null + } + + // 冷启动 + try { + data = tryGetData(wx.getLaunchOptionsSync?.() || {}, '冷启动') + } catch (e) { console.error('getLaunchOptionsSync 失败:', e) } + + // 热启动 + if (!data) { + data = tryGetData(onShowOptions, '热启动') + } + + if (data && (data.payAmount || data.acct || data.custId)) { + // 恢复登录态 + if (data.token) { + uni.setStorageSync('token', data.token) + console.log('已恢复 token') + } + if (data.userId) { + uni.setStorageSync('userId', data.userId) + console.log('已恢复 userId') + } + + uni.setStorageSync(STORAGE_KEY, data) + console.log('已存储 App 支付数据:', JSON.stringify(data)) + return data + } + + return null +} + +/** 检查是否已登录(token 存在) */ +export function isLoggedIn() { + return !!uni.getStorageSync('token') +} + +/** 获取 App 传入的支付数据 */ +export function getAppPaymentData() { + try { return uni.getStorageSync(STORAGE_KEY) || null } catch (e) { return null } +} + +/** 清除 */ +export function clearAppPaymentData() { + uni.removeStorageSync(STORAGE_KEY) +} + +/** 组装 paymentItem */ +export function buildPaymentItemFromApp(appData) { + if (!appData) return null + const amount = Number(appData.payAmount || 0).toFixed(2) + return { ...appData, type: '缴费', rechargeAmount: amount } +} diff --git a/huakai-app/pageSubPack/api/request.js b/huakai-app/pageSubPack/api/request.js index 0d29659..4f26c03 100644 --- a/huakai-app/pageSubPack/api/request.js +++ b/huakai-app/pageSubPack/api/request.js @@ -83,31 +83,3 @@ export default function request(url, data = {}, method = "GET") { export const get = (url, data = {}) => request(url, data, 'GET'); export const post = (url, data) => request(url, data, 'POST'); -export const deleteMethod = (url, data) => request(url, data, 'DELETE'); -export const putMethod = (url, data) => request(url, data, 'PUT'); - -// 上传 -export const upload = (filePath, url) => { - return new Promise((resolve, reject) => { - uni.uploadFile({ - url: baseUrl + url, - filePath: filePath, - name: 'file', - header: { - "Authorization": "Bearer " + (uni.getStorageSync("token") || ''), - "clientid": "resident" - }, - success: (res) => { - try { - const data = JSON.parse(res.data); - resolve(data.data || ''); // 直接返回图片地址 - } catch (e) { - resolve(''); - } - }, - fail: (err) => { - reject(err); - } - }); - }); -}; diff --git a/huakai-app/pageSubPack/api/useImageUpload.js b/huakai-app/pageSubPack/api/useImageUpload.js deleted file mode 100644 index 497d1ff..0000000 --- a/huakai-app/pageSubPack/api/useImageUpload.js +++ /dev/null @@ -1,190 +0,0 @@ -// 服务器地址(与 request.js 保持一致) -const baseUrl = 'http://192.168.0.239:8080'; - -/** - * 图片上传 Hook - * 支持 uniapp 和微信小程序 - * 解决编辑回显后重新上传的问题 - */ - -import { reactive } from 'vue' - -/** - * @param {Object} options 配置 - * @param {string} options.uploadUrl - 上传接口地址 - * @param {string} options.fileKey - 上传文件的字段名,默认 'file' - * @returns {Object} - */ -export function useImageUpload(options = {}) { - const { - uploadUrl = '/api/resident/file/uploadImage', - fileKey = 'file' - } = options - - // 使用 reactive 对象存储所有状态 - const state = reactive({ - // 当前显示的图片(前端展示用,支持 base64/blob URL/网络URL) - previewUrl: '', - // 服务器返回的 URL(提交时使用) - serverUrl: '', - // 临时的文件路径(重新上传时用) - tempFilePath: null, - // 上传状态 - uploading: false - }) - - /** - * 设置回显图片(编辑时从后端获取) - * @param {string} url - 后端返回的图片URL - */ - const setPreviewUrl = (url) => { - if (url) { - // 确保 url 是字符串 - const urlStr = typeof url === 'string' ? url : (url?.url || String(url)) - state.previewUrl = urlStr - state.serverUrl = urlStr - state.tempFilePath = null // 重置临时文件,表示没有重新上传 - } - } - - /** - * 选择图片并预览(不上传) - * @returns {Promise} 返回临时文件路径 - */ - const chooseImage = () => { - return new Promise((resolve, reject) => { - uni.chooseImage({ - count: 1, - sizeType: ['compressed'], - sourceType: ['camera', 'album'], - success: (res) => { - const path = res.tempFilePaths?.[0] - if (!path) { - reject(new Error('选择图片失败')) - return - } - // 确保 path 是字符串 - const pathStr = typeof path === 'string' ? path : String(path) - // 设置预览 - state.previewUrl = pathStr - // 记录临时文件路径 - state.tempFilePath = pathStr - // 置空服务器URL,等实际上传后再获取 - state.serverUrl = '' - resolve(pathStr) - }, - fail: (err) => { - reject(err) - } - }) - }) - } - - /** - * 上传图片到服务器 - * @returns {Promise} 返回 { url: string } - */ - const uploadImage = () => { - // 如果没有新选择临时文件,直接返回已有的服务器URL - if (!state.tempFilePath) { - return Promise.resolve({ url: state.serverUrl }) - } - - // 如果已经有服务器URL且没有重新选择,也直接返回 - if (state.serverUrl && !state.tempFilePath) { - return Promise.resolve({ url: state.serverUrl }) - } - - state.uploading = true - - return new Promise((resolve, reject) => { - // 确保 filePath 是字符串 - const filePath = state.tempFilePath - if (!filePath || typeof filePath !== 'string') { - state.uploading = false - reject(new Error('文件路径无效')) - return - } - uni.uploadFile({ - url: baseUrl + uploadUrl, - filePath: filePath, - name: fileKey, - header: { - 'Authorization': 'Bearer ' + (uni.getStorageSync('token') || ''), - 'clientid': 'resident' - }, - success: (res) => { - try { - const data = JSON.parse(res.data) - if (data.code === 200 && data.data) { - // 更新服务器URL(确保存的是字符串) - const url = typeof data.data === 'string' ? data.data : (data.data?.url || '') - state.serverUrl = url - // 清空临时文件 - state.tempFilePath = null - resolve({ url }) - } else { - uni.showToast({ - title: data.msg || '上传失败', - icon: 'none' - }) - reject(new Error(data.msg || '上传失败')) - } - } catch (e) { - uni.showToast({ - title: '上传失败', - icon: 'none' - }) - reject(e) - } - }, - fail: (err) => { - uni.showToast({ - title: err.message || '上传失败', - icon: 'none' - }) - reject(err) - }, - complete: () => { - state.uploading = false - } - }) - }) - } - - /** - * 获取最终可提交的URL - * 如果有新上传的图片,先上传再返回URL - * 如果没有新上传,直接返回已有的服务器URL - * @returns {Promise} - */ - const getSubmitUrl = async () => { - // 如果重新选择了新图片,先上传 - if (state.tempFilePath) { - return await uploadImage() - } - // 否则返回已有的服务器URL - return { url: state.serverUrl } - } - - /** - * 重置状态 - */ - const reset = () => { - state.previewUrl = '' - state.serverUrl = '' - state.tempFilePath = null - state.uploading = false - } - - // 返回 reactive state 和方法 - // state 作为 reactive 对象,在模板中通过 idCardFrontUpload.state.previewUrl 访问 - return { - state, - setPreviewUrl, - chooseImage, - uploadImage, - getSubmitUrl, - reset - } -} diff --git a/huakai-app/pageSubPack/loginSub/login.vue b/huakai-app/pageSubPack/loginSub/login.vue index 9018a10..24acf9b 100644 --- a/huakai-app/pageSubPack/loginSub/login.vue +++ b/huakai-app/pageSubPack/loginSub/login.vue @@ -115,7 +115,7 @@ const handleCancel = () => { if (pages.length > 1) { uni.navigateBack(); } else { - uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } }; @@ -204,7 +204,7 @@ const handleLogin = () => { // 登录成功后返回来源页 uni.navigateBack({ fail: () => { - uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } }); },1500) diff --git a/huakai-app/pageSubPack/loginSub/pwd-login.vue b/huakai-app/pageSubPack/loginSub/pwd-login.vue index 4ecc162..6ec4fa2 100644 --- a/huakai-app/pageSubPack/loginSub/pwd-login.vue +++ b/huakai-app/pageSubPack/loginSub/pwd-login.vue @@ -117,7 +117,7 @@ const handleCancel = () => { if (pages.length > 1) { uni.navigateBack(); } else { - uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } }; @@ -166,7 +166,7 @@ const handleLogin = () => { // 登录成功后返回来源页 uni.navigateBack({ fail: () => { - uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } }); },1000) diff --git a/huakai-app/pageSubPack/payment-list/addHydropower.vue b/huakai-app/pageSubPack/payment-list/addHydropower.vue index 5df1fc1..cc7637f 100644 --- a/huakai-app/pageSubPack/payment-list/addHydropower.vue +++ b/huakai-app/pageSubPack/payment-list/addHydropower.vue @@ -211,7 +211,7 @@ import { showApiError } from '/pageSubPack/api/request.js' // 返回 const goBack = () => { - uni.switchTab({ + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }) } diff --git a/huakai-app/pageSubPack/payment-list/addPayment.vue b/huakai-app/pageSubPack/payment-list/addPayment.vue index e29e989..e62f7e1 100644 --- a/huakai-app/pageSubPack/payment-list/addPayment.vue +++ b/huakai-app/pageSubPack/payment-list/addPayment.vue @@ -187,7 +187,7 @@ // 返回 const goBack = () => { - uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } \ No newline at end of file +.contentStyle { display: flex; flex-direction: column; height: 100vh; background-color: #f9f9f9; } +.page { flex: 1; overflow-y: auto; padding: 0 40rpx; box-sizing: border-box; } +.btn-section { padding: 20rpx 30rpx 40rpx; } +.pay-btn { width: 100%; height: 100rpx; line-height: 100rpx; background-color: #007aff; color: #fff; border-radius: 16rpx; font-size: 32rpx; border: none; } +.container { display: flex; flex-direction: column; align-items: center; } +.success-icon { width: 220rpx; height: 220rpx; border-radius: 50%; background-color: #1677ff; display: flex; align-items: center; justify-content: center; margin-top: 200rpx; margin-bottom: 60rpx; } +.icon-check { color: #fff; font-size: 130rpx; font-weight: bold; } +.title { font-size: 40rpx; font-weight: bold; color: #000; margin-bottom: 20rpx; } +.desc { font-size: 32rpx; color: #666; text-align: center; margin-bottom: 150rpx; } +.status-bar { width: 100vw; height: 46px; } + diff --git a/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue b/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue index 87d7e6b..5a5e97d 100644 --- a/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue +++ b/huakai-app/pageSubPack/payment-list/noArrearsPayment.vue @@ -107,7 +107,7 @@ // 方法 const goBack = () => { - uni.switchTab({ + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } diff --git a/huakai-app/pageSubPack/payment-list/paymentRecord.vue b/huakai-app/pageSubPack/payment-list/paymentRecord.vue index 1ecf75e..64daa6e 100644 --- a/huakai-app/pageSubPack/payment-list/paymentRecord.vue +++ b/huakai-app/pageSubPack/payment-list/paymentRecord.vue @@ -211,7 +211,7 @@ } const goBack = () => { - uni.switchTab({ + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } diff --git a/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue b/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue index dc73511..53beb52 100644 --- a/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue +++ b/huakai-app/pageSubPack/payment-list/selectPaymentEntity.vue @@ -233,7 +233,7 @@ const onSearch = () => {} const goBack = () => { - uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' }); + uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' }); } diff --git a/huakai-app/pages.json b/huakai-app/pages.json index c546525..edea851 100644 --- a/huakai-app/pages.json +++ b/huakai-app/pages.json @@ -1,13 +1,5 @@ { - "pages": [{ - "path": "pages/navigation/navigation", - "style": { - "navigationBarTitleText": "引导页", - "navigationBarTextStyle": "white", - "enablePullDownRefresh": false, - "navigationStyle": "custom" - } - }, + "pages": [ { "path": "pages/paymentIndex/paymentIndex", "style": { @@ -15,26 +7,13 @@ "navigationStyle": "custom", "navigationBarBackgroundColor": "#F8F8F8" } - }, - { - "path": "pages/serviceIndex/serviceIndex", - "style": { - "navigationBarTitleText": "服务", - "navigationStyle": "custom" - } - }, - { - "path": "pages/myIndex/myIndex", - "style": { - "navigationBarTitleText": "我的", - "navigationStyle": "custom" - } } - ], - "subPackages": [{ + "subPackages": [ + { "root": "pageSubPack/loginSub", - "pages": [{ + "pages": [ + { "path": "register-new-user", "style": { "navigationBarTitleText": "注册新用户", @@ -73,293 +52,35 @@ "path": "privacy", "style": { "navigationBarTitleText": "用户隐私政策" - // "navigationStyle": "custom" } } ] }, { - "root": "pageSubPack/online-repair", - "pages": [{ - "path": "onlineRepair", - "style": { - "navigationBarTitleText": "在线报修", - "navigationStyle": "custom" - } - }, - { - "path": "repairSelect", - "style": { - "navigationBarTitleText": "选择维修项目" - } - }, - { - "path": "publicRepair", - "style": { - "navigationBarTitleText": "填写维修信息" - } - }, - { - "path": "personalRepair", - "style": { - "navigationBarTitleText": "个人报修" - } - }, - { - "path": "selectHouse", - "style": { - "navigationBarTitleText": "选择房屋" - } - }, - { - "path": "personalSelectPoject", - "style": { - "navigationBarTitleText": "个人维修项目" - } - }, - { - "path": "repairDetail", - "style": { - "navigationBarTitleText": "报修详情" - } - } - ] - }, - { - "root": "pageSubPack/visitor", - "pages": [{ - "path": "visitor-list", - "style": { - "navigationBarTitleText": "访客邀请", - "navigationStyle": "custom" - } - }, - { - "path": "visitor-detail", - "style": { - "navigationBarTitleText": "访客详情" - } - }, - { - "path": "qrcode-page", - "style": { - "navigationBarTitleText": "通行二维码" - } - }, - { - "path": "visitor-add", - "style": { - "navigationBarTitleText": "新增访客" - } - } - ] - }, - { - "root": "pageSubPack/activity-list", - "pages": [{ - "path": "activityList", - "style": { - "navigationBarTitleText": "活动列表", - "navigationStyle": "custom" - } - }, - { - "path": "live-add", - "style": { - "navigationBarTitleText": "添加实况" - } - }, - { - "path": "activityListDetails", - "style": { - "navigationBarTitleText": "报名详情", - "navigationStyle": "custom" - } - } - - ] - }, - { - "root": "pageSubPack/notice-list", - "pages": [{ - "path": "noticeList", - "style": { - "navigationBarTitleText": "通知公告", - "navigationStyle": "custom" - } - }, - { - "path": "noticeListDetails", - "style": { - "navigationBarTitleText": "公告详情" - } - }, - { - "path": "oneClickOpen", - "style": { - "navigationBarTitleText": "一键开门", - "navigationStyle": "custom" - } - }, - { - "path": "selectHome", - "style": { - "navigationBarTitleText": "选择小区" - } - } - ] - }, - { - "root": "pageSubPack/my", - "pages": [{ - "path": "settingIndex", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "changePhone", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "changePwd", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "myHouseIndex", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "houseDetail", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "addHouse", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "selectResidentialCommunity", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "selectBuilding", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "myParkingSpaceIndex", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "parkingSpaceDetail", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - - }, - { - "path": "addParkingSpace", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - - }, { - "path": "bindHouse", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - - - }, { - "path": "selectParingLot", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - - - }, { - "path": "bindCar", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - - - }, - { - "path": "myCarIndex", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - - - }, { - "path": "addCar", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "selectCarBrand", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "carDetail", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - } - ] - }, { "root": "pageSubPack/payment-list", - "pages": [{ + "pages": [ + { "path": "addPayment", "style": { "navigationBarTitleText": "", "navigationStyle": "custom" } - }, { + }, + { "path": "addPaymentSuccess", "style": { "navigationBarTitleText": "", "navigationStyle": "custom" } - }, { + }, + { "path": "arrearsPayment", "style": { "navigationBarTitleText": "", "navigationStyle": "custom" } - }, { + }, + { "path": "noArrearsPayment", "style": { "navigationBarTitleText": "", @@ -387,59 +108,8 @@ "navigationStyle": "custom" } } - - ] - }, - { - "root": "pageSubPack/service-list", - "pages": [{ - "path": "complaintsSuggestionsIndex", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "complaintsDetail", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "addComplaints", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "questionnaireSurveyIndex", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "questionnaireFillout", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, - { - "path": "questionnaireDetail", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - }, { - "path": "contactProperty", - "style": { - "navigationBarTitleText": "", - "navigationStyle": "custom" - } - } ] } - ], "easycom": { "autoscan": true, @@ -449,34 +119,9 @@ "^u-([^-].*)": "@/uni_modules/uview-plus/components/u-$1/u-$1.vue" } }, - "tabBar": { - "color": "#333333", - "backgroundColor": "#fff", - "borderStyle": "black", - "selectedColor": "#666666", - "list": [{ - "pagePath": "pages/paymentIndex/paymentIndex", - "iconPath": "/static/tabbar/home.png", - "selectedIconPath": "/static/tabbar/homeBlue.png", - "text": "首页" - }, - { - "pagePath": "pages/serviceIndex/serviceIndex", - "iconPath": "/static/tabbar/service.png", - "selectedIconPath": "/static/tabbar/serviceBlue.png", - "text": "服务" - }, - { - "pagePath": "pages/myIndex/myIndex", - "iconPath": "/static/tabbar/mine.png", - "selectedIconPath": "/static/tabbar/mineBlue.png", - "text": "我的" - } - ] - }, "globalStyle": { "navigationBarTextStyle": "black", - "navigationBarTitleText": "uni-app", + "navigationBarTitleText": "花开物业", "navigationBarBackgroundColor": "#F8F8F8", "backgroundColor": "#F8F8F8" }, diff --git a/huakai-app/pages/index/index.vue b/huakai-app/pages/index/index.vue deleted file mode 100644 index 02409e3..0000000 --- a/huakai-app/pages/index/index.vue +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/huakai-app/pages/login/login.vue b/huakai-app/pages/login/login.vue deleted file mode 100644 index 02409e3..0000000 --- a/huakai-app/pages/login/login.vue +++ /dev/null @@ -1,8 +0,0 @@ - - - - - \ No newline at end of file diff --git a/huakai-app/pages/navigation/navigation.vue b/huakai-app/pages/navigation/navigation.vue deleted file mode 100644 index 0d014c7..0000000 --- a/huakai-app/pages/navigation/navigation.vue +++ /dev/null @@ -1,243 +0,0 @@ - - - - - diff --git a/huakai-app/pages/paymentIndex/paymentIndex.vue b/huakai-app/pages/paymentIndex/paymentIndex.vue index dcfaa9e..7e2d828 100644 --- a/huakai-app/pages/paymentIndex/paymentIndex.vue +++ b/huakai-app/pages/paymentIndex/paymentIndex.vue @@ -4,7 +4,7 @@ - + @@ -36,7 +36,7 @@ - + @@ -63,6 +63,7 @@ import { onShow, onLoad } from '@dcloudio/uni-app' import { getTopUpSelectByResident, getopenIdByCode, postInsertOpenId } from '/pageSubPack/api/apiSub.js' import { isLoggedIn, requireAuth } from '/pageSubPack/api/auth.js' + import { getAppPaymentData, clearAppPaymentData, buildPaymentItemFromApp } from '/pageSubPack/api/appLaunch.js' const isLogin = ref(false) const paymentList = ref([]) @@ -125,20 +126,38 @@ // ===== 生命周期 ===== onLoad(() => { refreshLoginState(); - uni.hideTabBar({ animation: false }); if (isLogin.value) { postOpenId(); - getPayList(); + // 检查是否由 App 跳转而来,携带了支付参数 + checkAppLaunchPayment(); + // getPayList(); } }); onShow(() => { refreshLoginState(); if (isLogin.value) { - getPayList(); + // getPayList(); } }); + // ===== App 跳转支付:检测 extraData 并直接进入支付页 ===== + const checkAppLaunchPayment = () => { + const appData = getAppPaymentData() + if (!appData) return // 非 App 跳转,正常展示账单列表 + + console.log("检测到 App 支付参数:", appData) + const paymentItem = buildPaymentItemFromApp(appData) + if (!paymentItem) return + + // 清除已消费的启动数据 + clearAppPaymentData() + // 存入 storage 供 arrearsPayment 使用 + uni.setStorageSync("arrearsPayment", paymentItem) + // 直接跳转支付页 + uni.redirectTo({ url: "/pageSubPack/payment-list/arrearsPayment" }) + } + // ===== 点击事件(统一用 isLogin 判断) ===== // 点击"去登录"提示条 @@ -148,7 +167,7 @@ title: '查看缴费账单', onLoggedIn: () => { refreshLoginState(); - getPayList(); + // getPayList(); } }); };