Browse Source

feature-hub-1.0:完善我的模块页面逻辑

feature-1.0
penny 4 years ago
parent
commit
1a36e529b4
  1. 5
      api/index.js
  2. 23
      api/userInfo.js
  3. 142
      pages-userInfo/inviteLog/inviteLog.vue
  4. 57
      pages-userInfo/notice/notice.vue
  5. 47
      pages-userInfo/notice/noticeDetail.vue
  6. 145
      pages-userInfo/withdraw/withdraw.vue
  7. 52
      pages-userInfo/withdraw/withdrawDetail.vue
  8. 21
      pages.json
  9. 2
      pages/login/login.vue

5
api/index.js

@ -74,10 +74,11 @@ export function getNoticeDetails(id) {
}
// 查询公告列表
export function getNoticeList() {
export function getNoticeList(data) {
return request({
url: `${serviceTitle}${prefix}/getNoticeList`,
method: 'get'
method: 'post',
data
})
}

23
api/userInfo.js

@ -9,24 +9,26 @@ const prefix = '/img/mini/creator'
// 查询公告详情
export function getNoticeDetails(id) {
return request({
url: `${serviceTitle}${prefix}/listType/${id}`,
url: `${serviceTitle}${prefix}/getNoticeDetails/${id}`,
method: 'get'
})
}
// 查询公告列表
export function getNoticeList() {
export function getNoticeList(data) {
return request({
url: `${serviceTitle}${prefix}/getNoticeList`,
method: 'get'
method: 'post',
data
})
}
// 查询邀请记录
export function getInviteLog(creatorId) {
export function getInviteLog(data) {
return request({
url: `${serviceTitle}${prefix}/getInviteLog/${creatorId}`,
method: 'get'
url: `${serviceTitle}${prefix}/getInviteLog`,
method: 'post',
data
})
}
@ -38,11 +40,12 @@ export function getAccount(creatorId) {
})
}
// 查询指定艺术家提现记录列表
export function getWithdrawList(creatorId) {
// 查询指定艺术家提现记录分页
export function getWithdrawList(data) {
return request({
url: `${serviceTitle}${prefix}/getWithdrawList/${creatorId}`,
method: 'get'
url: `${serviceTitle}${prefix}/getWithdrawList`,
method: 'post',
data
})
}

142
pages-userInfo/inviteLog/inviteLog.vue

@ -1,106 +1,56 @@
<template>
<view class="container">
我是邀请记录页面
<uni-list border-full v-for="(item,index) in inviteLogList" :key="index">
<uni-list-item :title="item.invitedScanCode"
:note="item.createTime" :thumb="item.img" thumb-size="lg"/>
</uni-list>
</view>
</template>
<script>
// export default {
// data() {
// return {
// hotCreatorList: [],
// isTarget: true,
// showChoiceness:false
// }
// },
// //
// onPullDownRefresh() {
// this.showChoiceness = false
// uni.stopPullDownRefresh()
// },
// created() {
// const userInfo = uni.getStorageSync('userInfo')
// if (!userInfo) {
// console.log('havent userInfo')
// this.getUserInfo()
// } else {
// console.log('have userInfo')
// }
// },
// onPageScroll(e) {
// // scrollTopeasy-loadimage
// if (e.scrollTop > 160) {
// this.showChoiceness = true
// // uni.redirectTo({
// // url: '../index/choiceness'
// // })
// }
// },
// methods: {
// //
// search(res) {
// if (res.value) {
// console.log('search', res.value)
// this.goCreatorDetail(res.value)
// } else {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// }
// },
// //
// getUserInfo() {
// wx.login({
// force: true,
// success: res => {
// wx.getUserInfo({
// withCredentials: true,
// success: userInfo => {
// const params = {
// code: res.code,
// encryptedData: userInfo.encryptedData,
// iv: userInfo.iv
// }
// //
// console.log('params',params);
// loginWx(params).then(res => {
// if (res.data.code === 200) {
// uni.setStorage({
// key: 'userInfo',
// data: res.data.data.userInfo,
// })
// } else {
// uni.showToast({
// title: res.data.msg,
// icon: 'none'
// })
// }
// }).catch(res => {})
// console.log(`getUserInfo `, userInfo);
// },
// fail(userInfo) {
// console.log(`getUserInfo `);
// },
// });
// },
// fail(res) {
// console.log(`login `);
// },
// });
// },
import {
getInviteLog
} from '@/api/userInfo.js'
export default {
data() {
return {
inviteLogList: [],
pageSize: 10,
pageNum: 1
}
},
//
onPullDownRefresh() {
this.showChoiceness = false
uni.stopPullDownRefresh()
},
created() {
const userInfo = uni.getStorageSync('userInfo')
const params = {
pageSize: this.pageSize,
pageNum: this.pageNum,
creatorId: userInfo.id
}
this.getInviteLog(params);
},
methods: {
// //
// handleScroll() {
// let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
// console.log(scrollTop)
// },
// },
// }
//
async getInviteLog(params) {
const res = await getInviteLog(params)
console.log('res', res)
if (res.data.code === 200) {
this.inviteLogList = res.data.rows
console.log('inviteLogList', this.inviteLogList)
} else {
uni.showModal({
content: '邀请记录加载失败!',
showCancel: false
});
}
},
},
}
</script>
<style lang="less">

57
pages-userInfo/notice/notice.vue

@ -1,12 +1,63 @@
<template>
<view class="container">
我是通知消息
<uni-list border-full v-for="(item,index) in noticeList" :key="index">
<uni-list-item showArrow clickable :title="item.title"
:note="item.createTime" :thumb="item.img" thumb-size="lg" @click="targetToDetail(item.id)"/>
</uni-list>
</view>
</template>
<script>
</style>
import {
getNoticeList
} from '@/api/userInfo.js'
export default {
data() {
return {
noticeList: [],
pageSize: 10,
pageNum: 1
}
},
//
onPullDownRefresh() {
uni.stopPullDownRefresh()
},
created() {
const params = {
pageSize: this.pageSize,
pageNum: this.pageNum,
}
this.getNoticeList(params);
},
methods: {
//
async getNoticeList(params) {
const res = await getNoticeList(params)
console.log('res', res)
if (res.data.code === 200) {
this.noticeList = res.data.rows
console.log('noticeList', this.noticeList)
} else {
uni.showModal({
content: '公告列表加载失败!',
showCancel: false
});
}
},
targetToDetail(id) {
console.log('id', id)
if (id) {
uni.navigateTo({
url: 'noticeDetail?id=' + id
})
}
}
},
}
</script>
<style lang="scss">
</style>

47
pages-userInfo/notice/noticeDetail.vue

@ -0,0 +1,47 @@
<template>
<view>
<view>id:{{noticeDetail.id}}</view>
<view>标题:{{noticeDetail.title}}</view>
<view>内容:{{noticeDetail.content}}</view>
<view>图片:{{noticeDetail.img}}</view>
<view>创建时间:{{noticeDetail.createTime}}</view>
</view>
</template>
<script>
import {
getNoticeDetails
} from '@/api/userInfo.js'
export default {
data() {
return {
noticeDetail:{}
}
},
onLoad: function(option) { //optionobject
this.id = option.id
//console.log('this.id',this.id)
this.getNoticeDetails(option.id);
},
methods: {
//
async getNoticeDetails(id) {
const res = await getNoticeDetails(id)
console.log('res', res)
if (res.data.code === 200) {
this.noticeDetail = res.data.data
} else {
uni.showModal({
content: '公告详情数据加载失败!',
showCancel: false
});
}
},
}
}
</script>
<style>
</style>

145
pages-userInfo/withdraw/withdraw.vue

@ -1,106 +1,59 @@
<template>
<view class="container">
我是提现页面
<uni-list border-full v-for="(item,index) in withdrawList" :key="index">
<uni-list-item showArrow clickable :title="'订单号:'+item.orderId"
:note="item.createTime+'||'+item.channel+'||'+item.status"
:rightText="'¥'+item.amt" @click="targetToDetail(item.orderId)"/>
</uni-list>
</view>
</template>
<script>
// export default {
// data() {
// return {
// hotCreatorList: [],
// isTarget: true,
// showChoiceness:false
// }
// },
// //
// onPullDownRefresh() {
// this.showChoiceness = false
// uni.stopPullDownRefresh()
// },
// created() {
// const userInfo = uni.getStorageSync('userInfo')
// if (!userInfo) {
// console.log('havent userInfo')
// this.getUserInfo()
// } else {
// console.log('have userInfo')
// }
// },
// onPageScroll(e) {
// // scrollTopeasy-loadimage
// if (e.scrollTop > 160) {
// this.showChoiceness = true
// // uni.redirectTo({
// // url: '../index/choiceness'
// // })
// }
// },
// methods: {
// //
// search(res) {
// if (res.value) {
// console.log('search', res.value)
// this.goCreatorDetail(res.value)
// } else {
// uni.showToast({
// title: '',
// icon: 'none'
// })
// }
// },
// //
// getUserInfo() {
// wx.login({
// force: true,
// success: res => {
// wx.getUserInfo({
// withCredentials: true,
// success: userInfo => {
// const params = {
// code: res.code,
// encryptedData: userInfo.encryptedData,
// iv: userInfo.iv
// }
// //
// console.log('params',params);
// loginWx(params).then(res => {
// if (res.data.code === 200) {
// uni.setStorage({
// key: 'userInfo',
// data: res.data.data.userInfo,
// })
// } else {
// uni.showToast({
// title: res.data.msg,
// icon: 'none'
// })
// }
// }).catch(res => {})
// console.log(`getUserInfo `, userInfo);
// },
// fail(userInfo) {
// console.log(`getUserInfo `);
// },
// });
// },
// fail(res) {
// console.log(`login `);
// },
// });
// },
import {
getWithdrawList
} from '@/api/userInfo.js'
export default {
data() {
return {
withdrawList:[],
pageSize: 10,
pageNum: 1
}
},
created(){
const userInfo = uni.getStorageSync('userInfo')
const params = {
pageSize: this.pageSize,
pageNum: this.pageNum,
creatorId: userInfo.id
}
this.getWithdrawList(params);
},
methods: {
//
async getWithdrawList(param) {
const res = await getWithdrawList(param)
console.log('res', res)
if (res.data.code === 200) {
this.withdrawList = res.data.rows
} else {
uni.showModal({
content: '提现记录列表数据加载失败!',
showCancel: false
});
}
},
// //
// handleScroll() {
// let scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
// console.log(scrollTop)
// },
// },
// }
targetToDetail(orderId) {
console.log('orderId', orderId)
if (orderId) {
uni.navigateTo({
url: 'withdrawDetail?orderId=' + orderId,
});
}
}
}
}
</script>
<style lang="less">

52
pages-userInfo/withdraw/withdrawDetail.vue

@ -0,0 +1,52 @@
<template>
<view>
<view>订单号:{{withdrawDetailInfo.orderId}}</view>
<view>提现金额:{{withdrawDetailInfo.amt}}</view>
<view>手机号:{{withdrawDetailInfo.phone}}</view>
<view>银行卡:{{withdrawDetailInfo.bankNo}}</view>
<view>渠道:{{withdrawDetailInfo.channel}}</view>
<view>状态:{{withdrawDetailInfo.status}}</view>
<view>创建时间:{{withdrawDetailInfo.createTime}}</view>
<view>审核理由:{{withdrawDetailInfo.reason}}</view>
<view>到账时间:{{withdrawDetailInfo.achieveTime}}</view>
</view>
</template>
<script>
import {
getWithdrawDetails
} from '@/api/userInfo.js'
export default {
data() {
return {
withdrawDetailInfo:{}
}
},
onLoad: function(option) { //optionobject
console.log(option)
const param = {
orderId: option.orderId
}
this.getWithdrawDetails(param);
},
methods: {
//
async getWithdrawDetails(param) {
const res = await getWithdrawDetails(param)
console.log('res', res)
if (res.data.code === 200) {
this.withdrawDetailInfo = res.data.data
} else {
uni.showModal({
content: '提现记录详情数据加载失败!',
showCancel: false
});
}
},
}
}
</script>
<style>
</style>

21
pages.json

@ -155,7 +155,26 @@
"navigationBarTitleText": "提现记录",
"enablePullDownRefresh": false
}
}]
},{
"path" : "notice/noticeDetail",
"style" :
{
"navigationBarTitleText": "公告详情",
"enablePullDownRefresh": false
}
}
,{
"path" : "withdraw/withdrawDetail",
"style" :
{
"navigationBarTitleText": "提现详情",
"enablePullDownRefresh": false
}
}
]
}],
"globalStyle": {

2
pages/login/login.vue

@ -105,7 +105,7 @@
key: 'userInfo',
data: response.data.data.userInfo
})
uni.redirectTo({
uni.switchTab({
url: '../index/index',
success() {
uni.showToast({

Loading…
Cancel
Save