修改页面
This commit is contained in:
@@ -1,73 +1,50 @@
|
||||
<script setup>
|
||||
import { onLaunch } from '@dcloudio/uni-app'
|
||||
import { onLaunch, onShow } from '@dcloudio/uni-app'
|
||||
import { captureAppLaunchData } from '/pageSubPack/api/appLaunch.js'
|
||||
|
||||
// 应用启动时执行
|
||||
onLaunch(() => {
|
||||
console.log('App 启动')
|
||||
// 捕获 App 跳转传入的支付参数(冷启动)
|
||||
captureAppLaunchData()
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 只有 App 平台才获取 CID
|
||||
getPushCID()
|
||||
// #endif
|
||||
})
|
||||
|
||||
onShow((options) => {
|
||||
console.log('App onShow, options:', JSON.stringify(options))
|
||||
// 捕获 App 跳转传入的支付参数(热启动 — options 携带新的 referrerInfo)
|
||||
captureAppLaunchData(options)
|
||||
})
|
||||
|
||||
// 获取 uniPush 2.0 CID
|
||||
function getPushCID() {
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
console.log('推送初始化成功')
|
||||
console.log('CID =', res.cid)
|
||||
|
||||
// 存起来备用
|
||||
console.log('推送初始化成功, CID =', res.cid)
|
||||
uni.setStorageSync('push_cid', res.cid)
|
||||
|
||||
// 弹出CID给你看
|
||||
// uni.showModal({
|
||||
// title: '你的CID',
|
||||
// content: res.cid
|
||||
// })
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('获取推送 CID 失败', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
// export default {
|
||||
// on
|
||||
// onShow: function() {
|
||||
// // console.log('App Show')
|
||||
// },
|
||||
// onHide: function() {
|
||||
// console.log('App Hide')
|
||||
// },
|
||||
|
||||
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/uni_modules/uview-plus/index.scss";
|
||||
/*每个页面公共css */
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* 全局给 uni.showToast 加内边距 */
|
||||
.uni-toast {
|
||||
padding: 5px !important;
|
||||
/* 上下20 左右40,自己改数值 */
|
||||
min-height: auto !important;
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
|
||||
/* 文字也可以居中、调整行高 */
|
||||
.uni-toast-content {
|
||||
/* line-height: 1.6 !important; */
|
||||
padding: 0 !important;
|
||||
white-space: normal !important;
|
||||
word-break: break-all !important;
|
||||
}
|
||||
|
||||
/* button:after{
|
||||
border-radius: 50px;
|
||||
} */
|
||||
</style>
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
// =========首页=======
|
||||
// 获取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');
|
||||
export const getResetPassword = (data) => {
|
||||
return post('/api/resident/auth/resetPassword', data)
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
78
huakai-app/pageSubPack/api/appLaunch.js
Normal file
78
huakai-app/pageSubPack/api/appLaunch.js
Normal file
@@ -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 }
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@@ -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<string>} 返回临时文件路径
|
||||
*/
|
||||
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<Object>} 返回 { 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<Object>}
|
||||
*/
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -211,7 +211,7 @@ import { showApiError } from '/pageSubPack/api/request.js'
|
||||
|
||||
// 返回
|
||||
const goBack = () => {
|
||||
uni.switchTab({
|
||||
uni.redirectTo({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
|
||||
// 返回
|
||||
const goBack = () => {
|
||||
uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,790 +1,103 @@
|
||||
<template>
|
||||
<view class="contentStyle" style="">
|
||||
<view class="contentStyle">
|
||||
<view class="status-bar"></view>
|
||||
<uni-nav-bar :title="paymentItem.type || '缴费'" left-icon="left" @clickLeft="goBack"
|
||||
backgroundColor="transparent" :border="false">
|
||||
</uni-nav-bar>
|
||||
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
|
||||
<view class="container">
|
||||
<!-- 1. 缴费详情 -->
|
||||
<view v-if="currentStep === 1" class="pay-page">
|
||||
<!-- 物业费缴费 -->
|
||||
<!-- 金额展示 -->
|
||||
<view class="amount-section" v-if="outstandingPayment">
|
||||
<text class="amount-text"
|
||||
:class="{ 'outstandingPaymentClass':outstandingPayment }">{{outstandingPayment?'-¥'+payAmount:'¥'+payAmount}}</text>
|
||||
</view>
|
||||
<view class="amount-section" v-else>
|
||||
<text class="amount-text paymentClass">{{'¥'+payAmount}}</text>
|
||||
</view>
|
||||
<view style="border-bottom: 2rpx solid #ededed;margin:10rpx 0rpx;"></view>
|
||||
<!-- 缴费信息 -->
|
||||
<view class="info-section" style="">
|
||||
|
||||
<view>
|
||||
|
||||
<view class="info-item">
|
||||
<text class="info-label">户号</text>
|
||||
<text class="info-value">{{ paymentItem.deviceCode || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">户主</text>
|
||||
<text class="info-value">{{ paymentItem.name || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">地址</text>
|
||||
<text class="info-value">{{ paymentItem.fullAddress || '-' }}</text>
|
||||
</view>
|
||||
<!-- <view style="border-bottom: 2rpx solid #c7c7c7;padding-bottom:20rpx;"></view> -->
|
||||
<!-- 缴费金额输入 -->
|
||||
<view style="border-bottom: 2rpx solid #ededed;margin:10rpx 0rpx;"></view>
|
||||
<view class="input-section" style="display: flex;">
|
||||
<text class="amount-input" style="width: auto;margin: 0rpx 20rpx;">¥</text>
|
||||
<input type="digit" v-model="payNum" class="amount-input" placeholder="点击输入缴费金额">
|
||||
</input>
|
||||
</view>
|
||||
<view style="border-bottom: 2rpx solid #ededed;margin:10rpx 0rpx;"></view>
|
||||
<view class="arrears-row" v-if="outstandingPayment==true">
|
||||
<text class="arrears-text">当前欠费金额¥{{ arrearsAmount }}元</text>
|
||||
<text class="auto-fill-btn" @click="handleAutoFill">点击自动填入</text>
|
||||
</view>
|
||||
<view class="arrears-row" v-if="outstandingPayment==false">
|
||||
<text class="arrears-text">暂未查询到欠费</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 2. 缴费成功页 -->
|
||||
<view class="container" v-if="currentStep==2">
|
||||
<!-- 成功图标 -->
|
||||
<view class="success-icon">
|
||||
<text class="icon-check">✓</text>
|
||||
</view>
|
||||
|
||||
<!-- 主标题 -->
|
||||
<!-- 缴费成功 -->
|
||||
<view v-if="currentStep === 2" class="container">
|
||||
<view class="success-icon"><text class="icon-check">✓</text></view>
|
||||
<view class="title">缴费成功</view>
|
||||
|
||||
<!-- 提示文案 -->
|
||||
<view class="desc">
|
||||
成功缴纳{{ paymentItem.type || '' }}费用 ¥{{ payNum || payAmount }}元
|
||||
</view>
|
||||
|
||||
|
||||
<view class="desc">成功缴纳{{ paymentItem.type || '' }}费用</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</scroll-view>
|
||||
<!-- 立即缴费按钮 -->
|
||||
|
||||
<view class="btn-section" v-if="currentStep === 1">
|
||||
<button class="pay-btn" @click="handlePay">立即缴费</button>
|
||||
</view>
|
||||
<!-- 返回按钮 -->
|
||||
<view class="btn-section" v-if="currentStep === 2">
|
||||
<button class="pay-btn" @click="handleBackToList">返回生活缴费</button>
|
||||
<button class="pay-btn" @click="handleBackToList">返回</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
reactive,
|
||||
onMounted,
|
||||
computed
|
||||
import { ref, reactive } from 'vue'
|
||||
import { onShow, onLoad } from '@dcloudio/uni-app'
|
||||
import { getAppPaymentData, clearAppPaymentData, buildPaymentItemFromApp } from '/pageSubPack/api/appLaunch.js'
|
||||
|
||||
} from 'vue'
|
||||
import {
|
||||
onShow,
|
||||
onReady,
|
||||
onReachBottom,
|
||||
onLoad,
|
||||
onUnload,
|
||||
onPullDownRefresh
|
||||
} from '@dcloudio/uni-app'
|
||||
const paymentItem = reactive({})
|
||||
const currentStep = ref(1)
|
||||
const navigatedToPayment = ref(false)
|
||||
|
||||
import {
|
||||
getTopUp,
|
||||
getToWxPay,
|
||||
getopenIdByCode,
|
||||
postSubscribeAuth
|
||||
} from '/pageSubPack/api/apiSub.js'
|
||||
onLoad(() => {
|
||||
const data = loadPaymentItem()
|
||||
Object.assign(paymentItem, data)
|
||||
})
|
||||
|
||||
// 响应式数据
|
||||
const statusBarHeight = ref(20)
|
||||
const outstandingPayment = ref(true)
|
||||
const storageValue = uni.getStorageSync('arrearsPayment')
|
||||
const paymentItem = reactive(typeof storageValue === 'object' && storageValue !== null ? storageValue : {})
|
||||
const currentStep = ref(1)
|
||||
const payAmount = ref('0.00')
|
||||
const arrearsAmount = ref('0.00')
|
||||
const payNum = ref('')
|
||||
|
||||
// 页面加载时初始化数据
|
||||
onLoad(() => {
|
||||
initPaymentData()
|
||||
checkAllSubscribeStatus()
|
||||
})
|
||||
|
||||
// 初始化缴费数据
|
||||
const initPaymentData = () => {
|
||||
if (paymentItem) {
|
||||
arrearsAmount.value = Math.abs(paymentItem.balance || 0).toFixed(2)
|
||||
payAmount.value = Math.abs(paymentItem.balance || 0)
|
||||
outstandingPayment.value = paymentItem.balance < 0
|
||||
}
|
||||
}
|
||||
|
||||
// 自动填充欠费金额
|
||||
const handleAutoFill = () => {
|
||||
payNum.value = arrearsAmount.value
|
||||
uni.vibrateShort({
|
||||
type: 'light'
|
||||
})
|
||||
}
|
||||
|
||||
// 返回
|
||||
const goBack = () => {
|
||||
uni.switchTab({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
});
|
||||
}
|
||||
|
||||
// 立即缴费
|
||||
const handlePay = () => {
|
||||
if (!payNum.value || Number(payNum.value) <= 0) {
|
||||
uni.showToast({
|
||||
title: '请输入正确的缴费金额',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
requestPayOrder()
|
||||
}
|
||||
// 统一下单后后端返回的支付参数
|
||||
const payInfo = ref({
|
||||
appId: '', // 公众号/小程序ID
|
||||
timeStamp: '', // 时间戳
|
||||
nonceStr: '', // 随机串
|
||||
package: '', // 数据包 如 prepay_id=xxx
|
||||
signType: 'MD5', // 签名方式
|
||||
paySign: '' // 签名
|
||||
})
|
||||
|
||||
// 1. 先请求后端接口生成预支付订单
|
||||
const requestPayOrder = async () => {
|
||||
try {
|
||||
uni.showLoading({
|
||||
title: '发起支付中'
|
||||
})
|
||||
|
||||
// // 获取 openid
|
||||
// const loginRes = await wx.login()
|
||||
// if (!loginRes.code) {
|
||||
// uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// title: '登录失败',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// // 用 code 换 openid
|
||||
// const openIdRes = await getopenIdByCode({
|
||||
// code: loginRes.code
|
||||
// })
|
||||
// if (openIdRes.code !== 200 || !openIdRes.data) {
|
||||
// uni.hideLoading()
|
||||
// uni.showToast({
|
||||
// title: '获取openid失败',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
// const openid = openIdRes.data
|
||||
const openid = uni.getStorageSync('openid')
|
||||
|
||||
// 调用充值接口创建订单
|
||||
console.log('1111111111', paymentItem);
|
||||
const topUpRes = await getTopUp({
|
||||
residentUserId: uni.getStorageSync('userId'),
|
||||
rechargeAmount: payNum.value,
|
||||
money: payNum.value || payAmount.value,
|
||||
deviceCode: paymentItem.deviceCode,
|
||||
// type: paymentItem.type == '水表' ? '2' : paymentItem.type == '电表' ? '1' : ''
|
||||
type:'2'
|
||||
})
|
||||
uni.hideLoading()
|
||||
|
||||
const topUpData = topUpRes
|
||||
console.log(topUpData);
|
||||
if (topUpData.code !== 200) {
|
||||
uni.showToast({
|
||||
title: topUpData.msg || '下单失败',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 调用微信支付接口获取支付参数
|
||||
const payRes = await getToWxPay({
|
||||
orderId: topUpData.data.orderId,
|
||||
openid: openid,
|
||||
// rechargeAmount: payNum.value || payAmount.value,
|
||||
// type: paymentItem.type == '水表' ? '2' : paymentItem.type == '电表' ? '1' : ''
|
||||
})
|
||||
|
||||
if (payRes.code !== 200) {
|
||||
uni.showToast({
|
||||
title: payRes.msg || '获取支付参数失败',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
const payData = payRes.data
|
||||
console.log('payData', payData);
|
||||
// 赋值支付参数
|
||||
payInfo.value = {
|
||||
appId: payData.appId,
|
||||
timeStamp: payData.timeStamp,
|
||||
nonceStr: payData.nonceStr,
|
||||
package: payData.package.startsWith('prepay_id=') ? payData.package : 'prepay_id=' + payData
|
||||
.package,
|
||||
signType: payData.signType,
|
||||
paySign: payData.paySign
|
||||
}
|
||||
|
||||
// 2. 调起微信支付
|
||||
wx.requestPayment({
|
||||
...payInfo.value,
|
||||
success(res) {
|
||||
console.log('支付成功', res)
|
||||
currentStep.value = 2
|
||||
},
|
||||
fail(err) {
|
||||
console.log('支付失败', err)
|
||||
uni.showToast({
|
||||
title: '支付取消或失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
handleWaterElecSubscribe()
|
||||
|
||||
} catch (err) {
|
||||
uni.hideLoading()
|
||||
console.log('请求异常', err)
|
||||
showApiError(err)
|
||||
}
|
||||
}
|
||||
|
||||
// 【双模板ID】你提供的 水表+电表 催缴模板
|
||||
const TEMPLATE_IDS = {
|
||||
water: 'DowYnoGKNtl_eYycRCq-nt7DAoFjH7aVcGUQciZl1v0',
|
||||
elec: 'PE7Neemv0z77JnBIPmb-Qg2Q3pJSUDGaILCryFCxmaw'
|
||||
}
|
||||
// 转成数组(微信API要求)
|
||||
const TEMPLATE_ID_ARRAY = Object.values(TEMPLATE_IDS)
|
||||
|
||||
|
||||
// 1. 检测 水表+电表 订阅状态
|
||||
const checkAllSubscribeStatus = () => {
|
||||
uni.getSetting({
|
||||
withSubscriptions: true,
|
||||
success: (res) => {
|
||||
const itemSettings = res.subscriptionsSetting?.itemSettings || {}
|
||||
console.log('水表订阅状态:', itemSettings[TEMPLATE_IDS.water])
|
||||
console.log('电表订阅状态:', itemSettings[TEMPLATE_IDS.elec])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 2. 点击开启订阅(主方法)
|
||||
const handleWaterElecSubscribe = () => {
|
||||
uni.getSetting({
|
||||
withSubscriptions: true,
|
||||
success: (res) => {
|
||||
const itemSettings = res.subscriptionsSetting?.itemSettings || {}
|
||||
const waterStatus = itemSettings[TEMPLATE_IDS.water]
|
||||
const elecStatus = itemSettings[TEMPLATE_IDS.elec]
|
||||
|
||||
// 如果任意一个被永久拒绝 → 引导去设置
|
||||
if ((waterStatus === 'reject' || waterStatus === 'ban') ||
|
||||
(elecStatus === 'reject' || elecStatus === 'ban')) {
|
||||
uni.showModal({
|
||||
title: '开启消息通知',
|
||||
content: '请前往设置页打开水表/电表提醒开关',
|
||||
confirmText: '去设置',
|
||||
success: (modalRes) => {
|
||||
if (modalRes.confirm) uni.openSetting()
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 正常弹出授权框
|
||||
requestMultiSubscribe()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 3. 调用微信授权(根据类型传对应模板)
|
||||
const requestMultiSubscribe = () => {
|
||||
const tmplIds = paymentItem.type == '水表' ? [TEMPLATE_IDS.water] : paymentItem.type == '电表' ? [TEMPLATE_IDS.elec] : TEMPLATE_ID_ARRAY
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: tmplIds,
|
||||
success: async (res) => {
|
||||
console.log('双模板授权结果:', res)
|
||||
|
||||
let successCount = 0
|
||||
// 水表授权成功
|
||||
if (res[TEMPLATE_IDS.water] === 'accept') successCount++
|
||||
// 电表授权成功
|
||||
if (res[TEMPLATE_IDS.elec] === 'accept') successCount++
|
||||
|
||||
if (successCount > 0) {
|
||||
uni.showToast({
|
||||
title: `已开启${successCount}项提醒`,
|
||||
icon: 'success'
|
||||
})
|
||||
// 保存用户openid到后端
|
||||
await saveUserSubscribe()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '已取消授权',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow(() => {
|
||||
if (navigatedToPayment.value) {
|
||||
navigatedToPayment.value = false
|
||||
wx.navigateBackApp({
|
||||
success: () => console.log('已返回花开物业 App'),
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '授权失败',
|
||||
icon: 'none'
|
||||
})
|
||||
currentStep.value = 2
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
// 4. 传给后端:保存订阅信息
|
||||
const saveUserSubscribe = async () => {
|
||||
const loadPaymentItem = () => {
|
||||
const appData = getAppPaymentData()
|
||||
if (appData) {
|
||||
console.log('检测到 App 跳转参数:', appData)
|
||||
clearAppPaymentData()
|
||||
const item = buildPaymentItemFromApp(appData)
|
||||
uni.setStorageSync('arrearsPayment', item)
|
||||
return item
|
||||
}
|
||||
const stored = uni.getStorageSync('arrearsPayment')
|
||||
return (typeof stored === 'object' && stored !== null) ? stored : {}
|
||||
}
|
||||
|
||||
const res = await postSubscribeAuth({
|
||||
openid: uni.getStorageSync('openid'),
|
||||
templateIds: paymentItem.type == '水表' ? [TEMPLATE_IDS.water] : paymentItem.type == '电表' ? [TEMPLATE_IDS.elec] : TEMPLATE_ID_ARRAY,
|
||||
// deviceCode: paymentItem.deviceCode,
|
||||
// deviceType: paymentItem.type == '水表' ? '2' : paymentItem.type == '电表' ? '1' : ''
|
||||
const goBack = () => uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' })
|
||||
|
||||
const handlePay = () => {
|
||||
navigatedToPayment.value = true
|
||||
wx.navigateToMiniProgram({
|
||||
appId: 'wxc0189436c58b59cd',
|
||||
path: 'pages/pay/pay',
|
||||
extraData: { ...paymentItem },
|
||||
envVersion: 'trial',
|
||||
success: () => console.log('已跳转到日照银行支付小程序'),
|
||||
fail: (err) => {
|
||||
navigatedToPayment.value = false
|
||||
console.error('跳转日照银行支付失败', err)
|
||||
uni.showToast({ title: '拉起支付失败', icon: 'none' })
|
||||
}
|
||||
})
|
||||
if (res.data == 200) {
|
||||
console.log('111111111111111:', res)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: `${res.msg}`,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 返回缴费列表
|
||||
const handleBackToList = () => {
|
||||
uni.switchTab({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
});
|
||||
}
|
||||
const handleBackToList = () => uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' })
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
page { background-color: #f9f9f9; }
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.contentStyle {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
/* 关键:占满屏幕高度 */
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.page {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 0px 40rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #
|
||||
/* fff */
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
/* 1. 物业费详情页 */
|
||||
.pay-page {
|
||||
width: 100%;
|
||||
/* min-height: 100vh; */
|
||||
/* background-color: #fff; */
|
||||
}
|
||||
|
||||
.amount-section {
|
||||
padding: 60rpx 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.amount-text {
|
||||
font-size: 56rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.outstandingPaymentClass {
|
||||
color: #E34D59;
|
||||
}
|
||||
|
||||
.paymentClass {
|
||||
color: #00aaff;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
padding-top: 20rpx;
|
||||
/* margin-bottom: 40rpx; */
|
||||
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
height: 80rpx;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.info-payAmountItem {
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.info-payAmount {
|
||||
font-size: 50rpx;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
|
||||
}
|
||||
|
||||
.input-section {
|
||||
/* padding: 030rpx; */
|
||||
|
||||
}
|
||||
|
||||
.amount-input {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
font-size: 32rpx;
|
||||
line-height: 100rpx;
|
||||
border: none;
|
||||
outline: none;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.btn-section {
|
||||
padding: 20rpx 30rpx 40rpx;
|
||||
display: flex;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.pay-btn {
|
||||
width: 100%;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
border-radius: 16rpx;
|
||||
font-size: 32rpx;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* 2. 支付密码弹窗 */
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
}
|
||||
|
||||
.password-modal {
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
padding: 0 30rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
font-size: 44rpx;
|
||||
width: 80rpx;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
width: 80rpx;
|
||||
}
|
||||
|
||||
.pay-info {
|
||||
padding: 40rpx 30rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.merchant-name {
|
||||
display: block;
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
font-size: 64rpx;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.pay-way {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.way-label {
|
||||
font-size: 30rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.way-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.bank-icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.bank-name {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.arrow-icon {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 银行卡列表 */
|
||||
.bank-list {
|
||||
padding: 030rpx;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.bank-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100rpx;
|
||||
border-bottom: 2rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.bank-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.bank-item-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.bank-item-name {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.check-icon {
|
||||
font-size: 36rpx;
|
||||
color: #007aff;
|
||||
}
|
||||
|
||||
/* 密码输入框 */
|
||||
.password-input {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 40rpx 30rpx;
|
||||
}
|
||||
|
||||
.password-item {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
/* border: 2rpx solid #dcdcdc; */
|
||||
background-color: #efefef;
|
||||
border-radius: 8rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.password-dot {
|
||||
width: 24rpx;
|
||||
height: 24rpx;
|
||||
background-color: #000;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
/* 数字键盘 */
|
||||
.keyboard {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.keyboard-row {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.keyboard-item {
|
||||
flex: 1;
|
||||
height: 54px;
|
||||
line-height: 54px;
|
||||
text-align: center;
|
||||
font-size: 48rpx;
|
||||
color: #000;
|
||||
border: 2rpx solid #f0f0f0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.keyboard-item:active {
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
|
||||
.keyboard-item.empty {
|
||||
background-color: #f5f5f5;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.keyboard-item.delete {
|
||||
background-color: #f5f5f5;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* 3. 缴费成功页 */
|
||||
/* 全局容器 */
|
||||
.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;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* 主标题 */
|
||||
.title {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 提示文案 */
|
||||
.desc {
|
||||
font-size: 32rpx;
|
||||
color: #666;
|
||||
line-height: 1.6;
|
||||
text-align: center;
|
||||
margin-bottom: 150rpx;
|
||||
}
|
||||
|
||||
/* 核心:欠费金额行样式 */
|
||||
.arrears-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
/* padding:30rpx; */
|
||||
margin-bottom: 60rpx;
|
||||
}
|
||||
|
||||
.arrears-text {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.auto-fill-btn {
|
||||
font-size: 28rpx;
|
||||
color: #007aff;
|
||||
/* 蓝色,匹配设计图 */
|
||||
font-weight: 500;
|
||||
padding: 10rpx 0;
|
||||
}
|
||||
|
||||
.status-bar {
|
||||
width: 100vw;
|
||||
height: 46px;
|
||||
}
|
||||
.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; }
|
||||
</style>
|
||||
@@ -107,7 +107,7 @@
|
||||
|
||||
// 方法
|
||||
const goBack = () => {
|
||||
uni.switchTab({
|
||||
uni.redirectTo({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
}
|
||||
|
||||
const goBack = () => {
|
||||
uni.switchTab({
|
||||
uni.redirectTo({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
});
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@
|
||||
const onSearch = () => {}
|
||||
|
||||
const goBack = () => {
|
||||
uni.switchTab({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
uni.redirectTo({ url: '/pages/paymentIndex/paymentIndex' });
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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"
|
||||
},
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,8 +0,0 @@
|
||||
<template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,243 +0,0 @@
|
||||
<template>
|
||||
<view class="guide-page">
|
||||
<view class="status-bar"></view>
|
||||
<!-- 引导内容滑动容器 -->
|
||||
<swiper
|
||||
class="guide-swiper"
|
||||
:current="currentStep"
|
||||
@change="handleSwiperChange"
|
||||
:disable-scroll="false"
|
||||
:indicator-dots="false"
|
||||
:mode="mode"
|
||||
>
|
||||
<!-- 便捷服务 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<view class="guide-img">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/guide1.png" mode="aspectFit" class="img-content"></image>
|
||||
</view>
|
||||
<view class="guide-text">
|
||||
<view class="guide-title">便捷服务</view>
|
||||
<view class="guide-subtitle">报修、缴费、预约</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
<!-- 高效管理 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<view class="guide-img">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/guide2.png" mode="aspectFit" class="img-content"></image>
|
||||
</view>
|
||||
<view class="guide-text">
|
||||
<view class="guide-title">高效管理</view>
|
||||
<view class="guide-subtitle">自动化流程和智能设备</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
|
||||
<!--安全保障 -->
|
||||
<swiper-item>
|
||||
<view class="guide-item">
|
||||
<view class="guide-img">
|
||||
<image src="https://wuyeadmin.bugtc.com/images/guide3.png" mode="aspectFit" class="img-content"></image>
|
||||
</view>
|
||||
<view class="guide-text">
|
||||
<view class="guide-title">安全保障</view>
|
||||
<view class="guide-subtitle">智能巡检和智慧访客</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<!-- 进度点 -->
|
||||
<view class="progress-dots">
|
||||
<view class="dot" :class="{ active: currentStep === 0 }"></view>
|
||||
<view class="dot" :class="{ active: currentStep === 1 }"></view>
|
||||
<view class="dot" :class="{ active: currentStep === 2 }"></view>
|
||||
</view>
|
||||
|
||||
<!-- 操作按钮 -->
|
||||
<view class="guide-btn-wrap">
|
||||
<button
|
||||
class="guide-btn"
|
||||
:class="{ primary: currentStep === 2 }"
|
||||
@click="handleBtnClick"
|
||||
>
|
||||
{{ currentStep === 2 ? '立即体验' : '下一步' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
|
||||
// ========== 响应式数据 ==========
|
||||
// 当前引导步骤(0/1/2)
|
||||
const currentStep = ref(0);
|
||||
const mode = ref("default")
|
||||
|
||||
// ========== 方法 ==========
|
||||
// 滑动swiper切换步骤
|
||||
const handleSwiperChange = (e) => {
|
||||
currentStep.value = e.detail.current;
|
||||
};
|
||||
|
||||
// 点击按钮操作
|
||||
const handleBtnClick = () => {
|
||||
// 前两步:点击下一步切换
|
||||
if (currentStep.value < 2) {
|
||||
currentStep.value++;
|
||||
} else {
|
||||
// 立即体验,直接进入首页(不强制登录 — 仅在需要身份的功能上才要求登录)
|
||||
uni.setStorageSync('hasShowGuide', true);
|
||||
uni.switchTab({
|
||||
url: '/pages/paymentIndex/paymentIndex'
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* 页面容器 */
|
||||
.guide-page {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background: linear-gradient(to bottom, #E2F0FF, #F6FAFF);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 状态栏 - 自适应设备状态栏高度 */
|
||||
.status-bar {
|
||||
height: var(--status-bar-height);
|
||||
width: 100%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 滑动容器 */
|
||||
.guide-swiper {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 单个引导项 - 全屏自适应 */
|
||||
.guide-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 60rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 图片区域 - 自适应 */
|
||||
.guide-img {
|
||||
width: 80%;
|
||||
max-width: 600rpx;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.img-content {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
max-height: 50vh;
|
||||
}
|
||||
|
||||
/* 文字区域 */
|
||||
.guide-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-bottom: 40rpx;
|
||||
}
|
||||
|
||||
/* 引导标题 */
|
||||
.guide-title {
|
||||
font-size: 56rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 引导副标题 */
|
||||
.guide-subtitle {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 进度点容器 */
|
||||
.progress-dots {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 40rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 单个进度点 */
|
||||
.dot {
|
||||
width: 16rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 8rpx;
|
||||
background-color: #ddd;
|
||||
margin: 0 8rpx;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
/* 激活的进度点 */
|
||||
.dot.active {
|
||||
background-color: #007aff;
|
||||
width: 28rpx;
|
||||
}
|
||||
|
||||
/* 按钮容器 */
|
||||
.guide-btn-wrap {
|
||||
width: 80%;
|
||||
max-width: 600rpx;
|
||||
margin-bottom: 80rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 引导按钮 */
|
||||
.guide-btn {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
line-height: 88rpx;
|
||||
border-radius: 44rpx;
|
||||
font-size: 32rpx;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 默认按钮样式(下一步) */
|
||||
.guide-btn:not(.primary) {
|
||||
background-color: #fff;
|
||||
color: #007aff;
|
||||
border: 2rpx solid #007aff;
|
||||
}
|
||||
|
||||
/* 主按钮样式(立即体验) */
|
||||
.guide-btn.primary {
|
||||
background-color: #007aff;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* 按钮禁用态(可选) */
|
||||
.guide-btn:disabled {
|
||||
background-color: #ccc;
|
||||
color: #fff;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
@@ -4,7 +4,7 @@
|
||||
<uni-nav-bar title="生活缴费" backgroundColor="transparent" :border="false">
|
||||
</uni-nav-bar>
|
||||
<view class="topbox">
|
||||
<image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image>
|
||||
<!-- <image class="titleImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payTitle.png"></image> -->
|
||||
<image class="payImg" src="https://wuyeadmin.bugtc.com/images/propertyImgs/payImg.png"></image>
|
||||
</view>
|
||||
<scroll-view class="page" scroll-y="true">
|
||||
@@ -36,7 +36,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 新增缴费区域 -->
|
||||
<view class="add-section">
|
||||
<!-- <view class="add-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">新增缴费</text>
|
||||
<text class="record-link" @click="goToRecord">缴费记录</text>
|
||||
@@ -50,7 +50,7 @@
|
||||
<text class="item-name">{{ item.name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<view style="width: 100%;height: 30rpx;"></view>
|
||||
</view>
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user