From 21e4df820b820d5e3b963519b8e30256c561e42a Mon Sep 17 00:00:00 2001 From: chengkun <2500338766@qq.com> Date: Wed, 13 Jul 2022 14:14:49 +0800 Subject: [PATCH] feature-hub-1.0: fix bug --- pages-userInfo/inviteLog/inviteLog.vue | 41 +-- pages-userInfo/notice/notice.vue | 37 +-- pages-userInfo/notice/noticeDetail.vue | 16 +- pages-userInfo/withdraw/withdraw.vue | 45 ++-- pages-userInfo/withdraw/withdrawDetail.vue | 24 +- pages.json | 276 ++++++++++----------- pages/profit/profit.vue | 76 ++++-- pages/profit/profitEndDetails.vue | 29 ++- pages/profit/profitEndOrder.vue | 21 +- pages/profit/profitInDetails.vue | 15 +- pages/profit/profitInOrder.vue | 25 +- pages/profit/profitPreDetails.vue | 86 +++++-- pages/userInfo/userInfo.vue | 33 ++- 13 files changed, 424 insertions(+), 300 deletions(-) diff --git a/pages-userInfo/inviteLog/inviteLog.vue b/pages-userInfo/inviteLog/inviteLog.vue index 11cdbfd..c058855 100644 --- a/pages-userInfo/inviteLog/inviteLog.vue +++ b/pages-userInfo/inviteLog/inviteLog.vue @@ -1,8 +1,7 @@ @@ -16,32 +15,42 @@ return { inviteLogList: [], pageSize: 10, - pageNum: 1 + pageNum: 1, + userInfo: {} } }, + created() { + const userInfoSync = uni.getStorageSync('userInfo') + this.userInfo = userInfoSync + this.getInviteLog(); + }, // 下拉刷新 onPullDownRefresh() { - this.showChoiceness = false + this.pageNum = 1 + this.inviteLogList = [] + this.getInviteLog(); uni.stopPullDownRefresh() }, - created() { - const userInfo = uni.getStorageSync('userInfo') - const params = { - pageSize: this.pageSize, - pageNum: this.pageNum, - creatorId: userInfo.id + // 上划加载更多 + onReachBottom() { + if (this.inviteLogList.length > 9) { + this.pageNum += 1 + this.getInviteLog(); } - this.getInviteLog(params); }, methods: { - + // 获取邀请记录 - async getInviteLog(params) { - const res = await getInviteLog(params) + async getInviteLog() { + const res = await getInviteLog({ + pageSize: this.pageSize, + pageNum: this.pageNum, + creatorId: this.userInfo.id + }) console.log('res', res) if (res.data.code === 200) { - this.inviteLogList = res.data.rows - console.log('inviteLogList', this.inviteLogList) + this.inviteLogList.push(...res.data.rows) + console.log('inviteLogList', this.inviteLogList) } else { uni.showModal({ content: '邀请记录加载失败!', diff --git a/pages-userInfo/notice/notice.vue b/pages-userInfo/notice/notice.vue index a9f09a4..ccb5f38 100644 --- a/pages-userInfo/notice/notice.vue +++ b/pages-userInfo/notice/notice.vue @@ -1,8 +1,8 @@ @@ -19,26 +19,35 @@ pageNum: 1 } }, + created() { + this.getNoticeList(); + }, // 下拉刷新 onPullDownRefresh() { + this.pageNum = 1 + this.noticeList = [] + this.getNoticeList() uni.stopPullDownRefresh() }, - created() { - const params = { - pageSize: this.pageSize, - pageNum: this.pageNum, + // 上划加载更多 + onReachBottom() { + if (this.noticeList.length > 9) { + this.pageNum += 1 + this.getNoticeList(); } - this.getNoticeList(params); }, methods: { - + // 获取公告分页 - async getNoticeList(params) { - const res = await getNoticeList(params) - console.log('res', res) + async getNoticeList() { + const res = await getNoticeList({ + pageSize: this.pageSize, + pageNum: this.pageNum, + }) + //console.log('res', res) if (res.data.code === 200) { - this.noticeList = res.data.rows - console.log('noticeList', this.noticeList) + this.noticeList.push(...res.data.rows) + //console.log('noticeList', this.noticeList) } else { uni.showModal({ content: '公告列表加载失败!', @@ -46,7 +55,7 @@ }); } }, - + targetToDetail(id) { console.log('id', id) if (id) { diff --git a/pages-userInfo/notice/noticeDetail.vue b/pages-userInfo/notice/noticeDetail.vue index f962a64..4717b5a 100644 --- a/pages-userInfo/notice/noticeDetail.vue +++ b/pages-userInfo/notice/noticeDetail.vue @@ -15,19 +15,25 @@ export default { data() { return { - noticeDetail:{} + noticeDetail:{ + id: 0, + title: '', + content: '', + img: '', + createTime: '' + } } }, onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数 - this.id = option.id + this.noticeDetail.id = option.id //console.log('this.id',this.id) - this.getNoticeDetails(option.id); + this.getNoticeDetails(); }, methods: { // 查询公告详情 - async getNoticeDetails(id) { - const res = await getNoticeDetails(id) + async getNoticeDetails() { + const res = await getNoticeDetails(this.noticeDetail.id) console.log('res', res) if (res.data.code === 200) { this.noticeDetail = res.data.data diff --git a/pages-userInfo/withdraw/withdraw.vue b/pages-userInfo/withdraw/withdraw.vue index c93bda3..fbcb5fc 100644 --- a/pages-userInfo/withdraw/withdraw.vue +++ b/pages-userInfo/withdraw/withdraw.vue @@ -2,8 +2,8 @@ + :note="item.createTime+'||'+item.channel+'||'+item.status" :rightText="'¥'+item.amt" + @click="targetToDetail(item.orderId)" /> @@ -15,27 +15,42 @@ export default { data() { return { - withdrawList:[], + withdrawList: [], pageSize: 10, - pageNum: 1 + pageNum: 1, + userInfo: {} } }, - created(){ - const userInfo = uni.getStorageSync('userInfo') - const params = { - pageSize: this.pageSize, - pageNum: this.pageNum, - creatorId: userInfo.id + created() { + const userInfoSync = uni.getStorageSync('userInfo') + this.userInfo = userInfoSync + this.getWithdrawList(); + }, + // 下拉刷新 + onPullDownRefresh() { + this.pageNum = 1 + this.withdrawList = [] + this.getWithdrawList() + uni.stopPullDownRefresh() + }, + // 上划加载更多 + onReachBottom() { + if (this.withdrawList.length > 9) { + this.pageNum += 1 + this.getWithdrawList(); } - this.getWithdrawList(params); }, methods: { // 查询提现记录列表 - async getWithdrawList(param) { - const res = await getWithdrawList(param) + async getWithdrawList() { + const res = await getWithdrawList({ + pageSize: this.pageSize, + pageNum: this.pageNum, + creatorId: this.userInfo.id + }) console.log('res', res) if (res.data.code === 200) { - this.withdrawList = res.data.rows + this.withdrawList.push(...res.data.rows) } else { uni.showModal({ content: '提现记录列表数据加载失败!', @@ -43,7 +58,7 @@ }); } }, - + targetToDetail(orderId) { console.log('orderId', orderId) if (orderId) { diff --git a/pages-userInfo/withdraw/withdrawDetail.vue b/pages-userInfo/withdraw/withdrawDetail.vue index 8edbec0..45b80a4 100644 --- a/pages-userInfo/withdraw/withdrawDetail.vue +++ b/pages-userInfo/withdraw/withdrawDetail.vue @@ -19,20 +19,30 @@ export default { data() { return { - withdrawDetailInfo:{} + withdrawDetailInfo: { + orderId: '', + amt: 0, + phone: '', + bankNo: '', + channel: '', + status: '', + createTime: '', + reason: '', + achieveTime: '' + } } }, onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数 console.log(option) - const param = { - orderId: option.orderId - } - this.getWithdrawDetails(param); + this.withdrawDetailInfo.orderId = option.orderId + this.getWithdrawDetails(); }, methods: { // 查询提现记录明细 - async getWithdrawDetails(param) { - const res = await getWithdrawDetails(param) + async getWithdrawDetails() { + const res = await getWithdrawDetails({ + orderId: this.withdrawDetailInfo.orderId + }) console.log('res', res) if (res.data.code === 200) { this.withdrawDetailInfo = res.data.data diff --git a/pages.json b/pages.json index d377f73..da4bbff 100644 --- a/pages.json +++ b/pages.json @@ -14,169 +14,147 @@ "enablePullDownRefresh": true } }, - { - "path" : "pages/index/upload/upload", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/index/material/material", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/login/login", - "style" : - { - "navigationBarTitleText": "登录", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/register/register", - "style" : - { - "navigationBarTitleText": "注册", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/index/banner", - "style" : - { - "navigationBarTitleText": "", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/profit/profitPreDetails", - "style" : - { - "navigationBarTitleText": "即将入账详情", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/profit/profitInDetails", - "style" : - { - "navigationBarTitleText": "已入账详情", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/profit/profitInOrder", - "style" : - { - "navigationBarTitleText": "收益结算单", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/profit/profitEndDetails", - "style" : - { - "navigationBarTitleText": "转入钱包详情", - "enablePullDownRefresh": false - } - - } - ,{ - "path" : "pages/profit/profitEndOrder", - "style" : - { - "navigationBarTitleText": "转入钱包结算单", - "enablePullDownRefresh": false - } - }, { - "path" : "pages/userInfo/userInfo", - "style" : - { - "navigationBarTitleText": "我的", - "enablePullDownRefresh": false + "path": "pages/index/upload/upload", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false } - } - ], - - "subPackages": [{ - "root": "pages-userInfo", - "pages":[{ - "path":"about/about", - "style":{ - "navigationBarTitleText": "关于节点", + + }, { + "path": "pages/index/material/material", + "style": { + "navigationBarTitleText": "", "enablePullDownRefresh": false } - }, - { - "path":"contact/contact", - "style":{ - "navigationBarTitleText": "联系我们", + + }, { + "path": "pages/login/login", + "style": { + "navigationBarTitleText": "登录", "enablePullDownRefresh": false } - }, - { - "path":"extends/extends", - "style":{ - "navigationBarTitleText": "邀请更多人", + + }, { + "path": "pages/register/register", + "style": { + "navigationBarTitleText": "注册", "enablePullDownRefresh": false } - }, - { - "path":"inviteLog/inviteLog", - "style":{ - "navigationBarTitleText": "邀请记录", + + }, { + "path": "pages/index/banner", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false + } + + }, { + "path": "pages/profit/profitPreDetails", + "style": { + "navigationBarTitleText": "即将入账详情", + "enablePullDownRefresh": true + } + + }, { + "path": "pages/profit/profitInDetails", + "style": { + "navigationBarTitleText": "已入账详情", + "enablePullDownRefresh": true + } + + }, { + "path": "pages/profit/profitInOrder", + "style": { + "navigationBarTitleText": "收益结算单", "enablePullDownRefresh": false } - },{ - "path":"notice/notice", - "style":{ - "navigationBarTitleText": "通知公告", + + }, { + "path": "pages/profit/profitEndDetails", + "style": { + "navigationBarTitleText": "转入钱包详情", + "enablePullDownRefresh": true + } + + }, { + "path": "pages/profit/profitEndOrder", + "style": { + "navigationBarTitleText": "转入钱包结算单", "enablePullDownRefresh": false } }, { - "path":"withdraw/withdraw", - "style":{ - "navigationBarTitleText": "提现记录", + "path": "pages/userInfo/userInfo", + "style": { + "navigationBarTitleText": "我的", "enablePullDownRefresh": false } - },{ - "path" : "notice/noticeDetail", - "style" : - { - "navigationBarTitleText": "公告详情", - "enablePullDownRefresh": false - } - - } - - ,{ - "path" : "withdraw/withdrawDetail", - "style" : - { - "navigationBarTitleText": "提现详情", - "enablePullDownRefresh": false - } - - } - ] + } + ], + + "subPackages": [{ + "root": "pages-userInfo", + "pages": [{ + "path": "about/about", + "style": { + "navigationBarTitleText": "关于节点", + "enablePullDownRefresh": false + } + }, + { + "path": "contact/contact", + "style": { + "navigationBarTitleText": "联系我们", + "enablePullDownRefresh": false + } + }, + { + "path": "extends/extends", + "style": { + "navigationBarTitleText": "邀请更多人", + "enablePullDownRefresh": false + } + }, + { + "path": "inviteLog/inviteLog", + "style": { + "navigationBarTitleText": "邀请记录", + "enablePullDownRefresh": true + } + }, { + "path": "notice/notice", + "style": { + "navigationBarTitleText": "通知公告", + "enablePullDownRefresh": true + } + }, + { + "path": "withdraw/withdraw", + "style": { + "navigationBarTitleText": "提现记录", + "enablePullDownRefresh": true + } + }, { + "path": "notice/noticeDetail", + "style": { + "navigationBarTitleText": "公告详情", + "enablePullDownRefresh": false + } + + } + + , { + "path": "withdraw/withdrawDetail", + "style": { + "navigationBarTitleText": "提现详情", + "enablePullDownRefresh": false + } + + } + ] }], - + "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "bnyer", @@ -194,15 +172,15 @@ "iconPath": "static/index-default.png", "selectedIconPath": "static/index-select.png", "text": "首页" - }, - { + }, + { "pagePath": "pages/profit/profit", "iconPath": "static/theme-default.png", "selectedIconPath": "static/theme-select.png", "text": "收益" }, { - "pagePath": "pages/userInfo/userInfo", + "pagePath": "pages/userInfo/userInfo", "iconPath": "static/mine-default.png", "selectedIconPath": "static/mine-select.png", "text": "我的" diff --git a/pages/profit/profit.vue b/pages/profit/profit.vue index 5addd77..9ba1cae 100644 --- a/pages/profit/profit.vue +++ b/pages/profit/profit.vue @@ -1,6 +1,7 @@