diff --git a/api/userInfo.js b/api/userInfo.js index 56cc03d..65ff4a1 100644 --- a/api/userInfo.js +++ b/api/userInfo.js @@ -33,7 +33,7 @@ export function getInviteLog(data) { } // 查询指定艺术家账户 -export function getAccount(creatorId) { +export function getCreatorAccount(creatorId) { return request({ url: `${serviceTitle}${prefix}/getAccount/${creatorId}`, method: 'get' @@ -128,3 +128,56 @@ export function checkInviteCode(data) { }) } +// 新增艺术家收款账户 +export function addCreatorAccount(data) { + return request({ + url: `${serviceTitle}${prefix}/insertAccount`, + method: 'post', + data + }) +} + +// 检查艺术家收款账户是否存在 +export function checkAccountExist(data) { + return request({ + url: `${serviceTitle}${prefix}/checkAccountExist`, + method: 'post', + data + }) +} + +// 检查艺术家收款账户是否超过4个 +export function checkAccountUpToFour(creatorId) { + return request({ + url: `${serviceTitle}${prefix}/checkAccountUpToFour/${creatorId}`, + method: 'get', + }) +} + +// 删除艺术家收款账户 +export function deleteAccount(ids) { + return request({ + url: `${serviceTitle}${prefix}/deleteAccount/${ids}`, + method: 'get', + }) +} + +// 设置艺术家收款账户默认状态 +export function setDefaultAccountStatus(data) { + return request({ + url: `${serviceTitle}${prefix}/setDefaultAccountStatus`, + method: 'post', + data + }) +} + +// 获取艺术家信息 +export function getCreatorInfo(creatorId) { + return request({ + url: `${serviceTitle}${prefix}/getCreatorInfo/${creatorId}`, + method: 'get' + }) +} + + + diff --git a/main.js b/main.js index 0a775de..733a615 100644 --- a/main.js +++ b/main.js @@ -1,13 +1,16 @@ import App from './App' import store from './store/' +//配置公共方法(防止重复提交) +import common from './utils/common.js' // const baseURL = 'http://localhost:7010' //const baseURL = 'http://81.69.47.31:7010' // const baseURL = 'http://bnyer.vaiwan.com' -const baseURL = 'http://9fkisg.natappfree.cc' +const baseURL = 'http://i5s7bh.natappfree.cc' Vue.prototype.$baseURL = baseURL; +Vue.prototype.$noMultipleClicks = common.noMultipleClicks; // #ifndef VUE3 import Vue from 'vue' diff --git a/pages-userInfo/about/about.vue b/pages-userInfo/about/about.vue index 214e73f..1996a2e 100644 --- a/pages-userInfo/about/about.vue +++ b/pages-userInfo/about/about.vue @@ -65,102 +65,36 @@ diff --git a/pages-userInfo/creatorAccount/creatorAccount.vue b/pages-userInfo/creatorAccount/creatorAccount.vue new file mode 100644 index 0000000..a030fdb --- /dev/null +++ b/pages-userInfo/creatorAccount/creatorAccount.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/pages-userInfo/extends/extends.vue b/pages-userInfo/extends/extends.vue index 21c6d4e..7e9cdde 100644 --- a/pages-userInfo/extends/extends.vue +++ b/pages-userInfo/extends/extends.vue @@ -40,8 +40,23 @@ } }, created() { - const userInfoSync = uni.getStorageSync('userInfo') - this.userInfo = userInfoSync + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } this.getInviteLog(); }, // 下拉刷新 @@ -73,15 +88,16 @@ methods:{ // 获取邀请记录 async getInviteLog() { + let that = this; const res = await getInviteLog({ - pageSize: this.pageSize, - pageNum: this.pageNum, - creatorId: this.userInfo.id + pageSize: that.pageSize, + pageNum: that.pageNum, + creatorId: that.userInfo.id }) console.log('res', res) if (res.data.code === 200) { - this.inviteLogList.push(...res.data.rows) - console.log('inviteLogList', this.inviteLogList) + that.inviteLogList.push(...res.data.rows) + console.log('inviteLogList', that.inviteLogList) } else { uni.showModal({ content: '邀请记录加载失败!', diff --git a/pages-userInfo/notice/notice.vue b/pages-userInfo/notice/notice.vue index ee70ec4..8fa8b0d 100644 --- a/pages-userInfo/notice/notice.vue +++ b/pages-userInfo/notice/notice.vue @@ -18,10 +18,28 @@ noticeList: [], pageSize: 10, pageNum: 1, - flag: false + flag: false, + userInfo:{} } }, created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } this.getNoticeList(); }, // 下拉刷新 @@ -45,14 +63,15 @@ // 获取公告分页 async getNoticeList() { + let that = this; const res = await getNoticeList({ - pageSize: this.pageSize, - pageNum: this.pageNum, + pageSize: that.pageSize, + pageNum: that.pageNum, }) //console.log('res', res) if (res.data.code === 200) { - this.noticeList.push(...res.data.rows) - //console.log('noticeList', this.noticeList) + that.noticeList.push(...res.data.rows) + //console.log('noticeList', that.noticeList) } else { uni.showModal({ content: '公告列表加载失败!', diff --git a/pages-userInfo/notice/noticeDetail.vue b/pages-userInfo/notice/noticeDetail.vue index 7783591..316d0c4 100644 --- a/pages-userInfo/notice/noticeDetail.vue +++ b/pages-userInfo/notice/noticeDetail.vue @@ -22,10 +22,30 @@ title: '', content: '', img: '', - createTime: '' + createTime: '', + userInfo:{} } } }, + created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } + }, onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数 this.noticeDetail.id = option.id //console.log('this.id',this.id) @@ -35,10 +55,11 @@ // 查询公告详情 async getNoticeDetails() { - const res = await getNoticeDetails(this.noticeDetail.id) + let that = this; + const res = await getNoticeDetails(that.noticeDetail.id) console.log('res', res) if (res.data.code === 200) { - this.noticeDetail = res.data.data + that.noticeDetail = res.data.data } else { uni.showModal({ content: '公告详情数据加载失败!', diff --git a/pages-userInfo/setting/compoSign.vue b/pages-userInfo/setting/compoSign.vue index 2985c99..afd3d92 100644 --- a/pages-userInfo/setting/compoSign.vue +++ b/pages-userInfo/setting/compoSign.vue @@ -272,7 +272,26 @@ export default { data() { return { - + userInfo:{} + } + }, + created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') } }, methods: { diff --git a/pages-userInfo/setting/secretSign.vue b/pages-userInfo/setting/secretSign.vue index b5be6c4..36c52e4 100644 --- a/pages-userInfo/setting/secretSign.vue +++ b/pages-userInfo/setting/secretSign.vue @@ -53,7 +53,26 @@ export default { data() { return { - + userInfo:{} + } + }, + created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') } }, methods: { diff --git a/pages-userInfo/setting/setting.vue b/pages-userInfo/setting/setting.vue index 20313ec..bc9882c 100644 --- a/pages-userInfo/setting/setting.vue +++ b/pages-userInfo/setting/setting.vue @@ -41,8 +41,23 @@ } }, created() { - const userInfoSync = uni.getStorageSync('userInfo') - this.userInfo = userInfoSync + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } }, // // 下拉刷新 // onPullDownRefresh() { @@ -79,6 +94,7 @@ uni.reLaunch({ url: '/pages/login/login', success() { + uni.clearStorage(); uni.showToast({ title: '注销成功!', duration: 2000 diff --git a/pages-userInfo/withdraw/withdraw.vue b/pages-userInfo/withdraw/withdraw.vue index 9b41d7d..7898299 100644 --- a/pages-userInfo/withdraw/withdraw.vue +++ b/pages-userInfo/withdraw/withdraw.vue @@ -1,96 +1,451 @@ diff --git a/pages-userInfo/withdraw/withdrawDetail.vue b/pages-userInfo/withdraw/withdrawDetail.vue index 6487979..b60f04a 100644 --- a/pages-userInfo/withdraw/withdrawDetail.vue +++ b/pages-userInfo/withdraw/withdrawDetail.vue @@ -61,10 +61,30 @@ status: '', createTime: '', reason: '', - achieveTime: '' + achieveTime: '', + userInfo:{} } } }, + created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } + }, onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数 console.log(option) this.withdrawDetailInfo.orderId = option.orderId @@ -73,12 +93,13 @@ methods: { // 查询提现记录明细 async getWithdrawDetails() { + let that = this; const res = await getWithdrawDetails({ - orderId: this.withdrawDetailInfo.orderId + orderId: that.withdrawDetailInfo.orderId }) console.log('res', res) if (res.data.code === 200) { - this.withdrawDetailInfo = res.data.data + that.withdrawDetailInfo = res.data.data } else { uni.showModal({ content: '提现记录详情数据加载失败!', diff --git a/pages-userInfo/withdraw/withdrawIndex.vue b/pages-userInfo/withdraw/withdrawIndex.vue new file mode 100644 index 0000000..44dcb46 --- /dev/null +++ b/pages-userInfo/withdraw/withdrawIndex.vue @@ -0,0 +1,111 @@ + + + + + diff --git a/pages-userInfo/withdraw/withdrawLog.vue b/pages-userInfo/withdraw/withdrawLog.vue index d8a5acf..2242d53 100644 --- a/pages-userInfo/withdraw/withdrawLog.vue +++ b/pages-userInfo/withdraw/withdrawLog.vue @@ -47,8 +47,23 @@ } }, created() { - const userInfoSync = uni.getStorageSync('userInfo') - this.userInfo = userInfoSync + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } this.getWithdrawList(); }, // 下拉刷新 @@ -71,14 +86,15 @@ methods: { // 查询提现记录列表 async getWithdrawList() { + let that = this; const res = await getWithdrawList({ - pageSize: this.pageSize, - pageNum: this.pageNum, - creatorId: this.userInfo.id + pageSize: that.pageSize, + pageNum: that.pageNum, + creatorId: that.userInfo.id }) console.log('res', res) if (res.data.code === 200) { - this.withdrawList.push(...res.data.rows) + that.withdrawList.push(...res.data.rows) } else { uni.showModal({ content: '提现记录列表数据加载失败!', diff --git a/pages.json b/pages.json index 87e78bc..d670165 100644 --- a/pages.json +++ b/pages.json @@ -136,6 +136,20 @@ "enablePullDownRefresh": true } }, + { + "path": "creatorAccount/creatorAccount", + "style": { + "navigationBarTitleText": "收款账户", + "enablePullDownRefresh": true + } + }, + { + "path": "creatorAccount/createAccount", + "style": { + "navigationBarTitleText": "添加收款账户", + "enablePullDownRefresh": false + } + }, { "path": "withdraw/withdrawLog", "style": { @@ -144,12 +158,19 @@ } }, { - "path": "withdraw/withdraw", + "path": "withdraw/withdrawIndex", "style": { "navigationBarTitleText": "提现", "enablePullDownRefresh": true } }, + { + "path": "withdraw/withdraw", + "style": { + "navigationBarTitleText": "发起提现", + "enablePullDownRefresh": false + } + }, { "path": "notice/noticeDetail", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 144c558..a647ad1 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -55,6 +55,7 @@ export default { data() { return { + userInfo:{}, banner:[], current: 0, mode: 'nav', @@ -112,7 +113,23 @@ }; }, created(){ - + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } }, onLoad(){ @@ -146,10 +163,11 @@ // 获取banner列表 async getBanner() { + let that = this; const res = await listBanner() if (res.data.code === 200) { - this.banner = res.data.data - console.log('banner',this.banner) + that.banner = res.data.data + console.log('banner',that.banner) } else { uni.showModal({ content: 'banner加载失败!', @@ -160,23 +178,17 @@ // 查询艺术家图片分类数量 async queryCreatorTypeImgNum() { - const userInfo = uni.getStorageSync('userInfo') - if (!userInfo) { - console.log('havent userInfo') - - } else { - console.log('have userInfo') - } - const res = await queryCreatorTypeImgNum(userInfo.id) + let that = this; + const res = await queryCreatorTypeImgNum(that.userInfo.id) console.log('res',res) if (res.data.code === 200) { - this.list[0].num = res.data.data.headNum - this.list[1].num = res.data.data.gifNum - this.list[2].num = res.data.data.backNum - this.list[3].num = res.data.data.friendNum - this.list[4].num = res.data.data.emoNum - this.list[5].num = res.data.data.watchNum - console.log('list',this.list) + that.list[0].num = res.data.data.headNum + that.list[1].num = res.data.data.gifNum + that.list[2].num = res.data.data.backNum + that.list[3].num = res.data.data.friendNum + that.list[4].num = res.data.data.emoNum + that.list[5].num = res.data.data.watchNum + //console.log('list',that.list) } else { uni.showModal({ content: '图片分页数量加载失败!', diff --git a/pages/index/material/imgDetail.vue b/pages/index/material/imgDetail.vue index 0e3a1f6..9b6e9dd 100644 --- a/pages/index/material/imgDetail.vue +++ b/pages/index/material/imgDetail.vue @@ -2,11 +2,11 @@ - 置顶 + 置顶 - {{upOrDown}}架 + {{upOrDown}}架 - 修改标签 + 修改标签 @@ -16,7 +16,7 @@ - + @@ -43,11 +43,29 @@ showOrmis: 'none' ,//限时或者隐藏 upOrDown: '下', showRight: false, + noClick:true, //防止重复提交 signListSelected:[], signList:[], } }, created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } const detailId = uni.getStorageSync('detailId') if (detailId) { this.getImgDetail(detailId) diff --git a/pages/index/material/material.vue b/pages/index/material/material.vue index de942e4..4a87c45 100644 --- a/pages/index/material/material.vue +++ b/pages/index/material/material.vue @@ -42,8 +42,23 @@ this.listTiktokImgIn(); }, created(){ - const userInfoSync = uni.getStorageSync("userInfo"); - this.userInfo = userInfoSync; + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } this.queryListType(); this.imgWidth = 750/3-20 + 'rpx' this.imgHeight = 750/3-20 + 'rpx' @@ -207,23 +222,17 @@ //查询指定艺术家图片集合 async listTiktokImgIn() { - const userInfo = uni.getStorageSync('userInfo') - if (!userInfo) { - console.log('havent userInfo') - - } else { - console.log('have userInfo') - } + let that = this; const res = await listTiktokImgIn({ - pageNum: this.pageNum, - pageSize: this.pageSize, - typeId: this.typeId, - status: this.status, - creatorId: userInfo.id + pageNum: that.pageNum, + pageSize: that.pageSize, + typeId: that.typeId, + status: that.status, + creatorId: that.userInfo.id }) if (res.data.code === 200) { - this.creatorImgList.push(...res.data.rows) - console.log('creatorImgList',this.creatorImgList); + that.creatorImgList.push(...res.data.rows) + console.log('creatorImgList',that.creatorImgList); } else { uni.showModal({ content: '艺术家图片列表加载失败!', diff --git a/pages/index/upload/upload.vue b/pages/index/upload/upload.vue index fb700ac..c5745a5 100644 --- a/pages/index/upload/upload.vue +++ b/pages/index/upload/upload.vue @@ -24,7 +24,7 @@ - + @@ -50,14 +50,30 @@ imgList:[], signListSelected:[], userInfo:{}, - uploadedNum: 0 + uploadedNum: 0, + noClick:true, //防止重复提交 } }, created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } this.getSignList(); this.getTypeList(); - const userInfoSync = uni.getStorageSync("userInfo"); - this.userInfo = userInfoSync; this.queryUploadNum(); }, computed:{ @@ -75,15 +91,16 @@ //获取标签列表 async getSignList(){ + let that = this; const res = await getSignList({}) if (res.data.code === 200) { for (let s of res.data.data) { let signObject = {} signObject.text = s.name signObject.value = s.id - this.signList.push(signObject) + that.signList.push(signObject) } - console.log('signList',this.signList) + //console.log('signList',that.signList) } else { uni.showModal({ content: '标签列表加载失败!', @@ -94,14 +111,15 @@ //获取分类列表 async getTypeList(){ + let that = this; const res = await listType({}) if(res.data.code === 200){ for (let s of res.data.data) { - this.typeList.push(s.typeName); - this.typeIdList.push(s.id); + that.typeList.push(s.typeName); + that.typeIdList.push(s.id); } - console.log('分类列表',this.typeList) - console.log('分类id列表',this.typeIdList) + //console.log('分类列表',that.typeList) + //console.log('分类id列表',that.typeIdList) }else{ uni.showModal({ content: '分类列表加载失败!', @@ -112,13 +130,14 @@ //获取艺术家今日上传图片次数 async queryUploadNum(){ + let that = this; const checkParam = { - creatorId: this.userInfo.id + creatorId: that.userInfo.id } const res = await queryUploadNum(checkParam); console.log(res) if(res.data.code === 200){ - this.uploadedNum = res.data.data; + that.uploadedNum = res.data.data; }else{ uni.showModal({ content: '获取艺术家上传次数失败!', diff --git a/pages/login/login.vue b/pages/login/login.vue index d66f4ab..a150b44 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -8,7 +8,7 @@ - + @@ -22,6 +22,7 @@ return { phoneFlag: false, passwordFlag: false, + noClick:true, //防止重复提交 formData: { phone: '', password: '' diff --git a/pages/profit/profit.vue b/pages/profit/profit.vue index cf3f295..73295db 100644 --- a/pages/profit/profit.vue +++ b/pages/profit/profit.vue @@ -189,8 +189,23 @@ export default { uni.stopPullDownRefresh(); }, created() { - const userInfoSync = uni.getStorageSync("userInfo"); - this.userInfo = userInfoSync; + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } this.queryFrontProfitInfo(); this.queryFrontPreDownloadAndInviteCount(); this.queryFrontInAmt(); @@ -200,11 +215,12 @@ export default { methods: { // 获取艺术家收益统计 async queryFrontProfitInfo() { - const res = await queryFrontProfitInfo(this.userInfo.id); + let that = this; + const res = await queryFrontProfitInfo(that.userInfo.id); //console.log('res', res) if (res.data.code === 200) { - this.profitInfo = res.data.data; - //console.log('profitInfo', this.profitInfo) + that.profitInfo = res.data.data; + //console.log('profitInfo', that.profitInfo) } else { uni.showModal({ content: "收益统计加载失败!", @@ -215,11 +231,12 @@ export default { // 查询指定艺术家即将入账广告及邀请次数列表 async queryFrontPreDownloadAndInviteCount() { - const res = await queryFrontPreDownloadAndInviteCount(this.userInfo.id); + let that = this; + const res = await queryFrontPreDownloadAndInviteCount(that.userInfo.id); //console.log('res', res) if (res.data.code === 200) { - this.downloadAndInviteCountInfo = res.data.data; - //console.log('downloadAndInviteCountInfo', this.downloadAndInviteCountInfo) + that.downloadAndInviteCountInfo = res.data.data; + //console.log('downloadAndInviteCountInfo', that.downloadAndInviteCountInfo) } else { uni.showModal({ content: "收益统计次数加载失败!", @@ -230,13 +247,14 @@ export default { // 查询指定艺术家已入账累计收益 async queryFrontInAmt() { + let that = this; const res = await queryFrontInOrOutAmt({ - creatorId: this.userInfo.id, + creatorId: that.userInfo.id, status: "1", }); //console.log('InAmt', res) if (res.data.code === 200) { - this.inProfitInfo = res.data.data; + that.inProfitInfo = res.data.data; } else { uni.showModal({ content: "已入账收益加载失败!", @@ -247,13 +265,14 @@ export default { // 查询指定艺术家转入钱包累计收益 async queryFrontEndAmt() { + let that = this; const res = await queryFrontInOrOutAmt({ - creatorId: this.userInfo.id, + creatorId: that.userInfo.id, status: "2", }); //console.log('endAmt', res) if (res.data.code === 200) { - this.endProfitInfo = res.data.data; + that.endProfitInfo = res.data.data; } else { uni.showModal({ content: "转入钱包收益加载失败!", @@ -264,14 +283,15 @@ export default { // 获取公告分页 async getNoticeList() { + let that = this; const res = await getNoticeList({ - pageSize: this.pageSize, - pageNum: this.pageNum, + pageSize: that.pageSize, + pageNum: that.pageNum, }); //console.log('res', res) if (res.data.code === 200) { - this.noticeList = res.data.rows; - //console.log('noticeList', this.noticeList) + that.noticeList = res.data.rows; + //console.log('noticeList', that.noticeList) } else { uni.showModal({ content: "公告列表加载失败!", diff --git a/pages/profit/profitEndDetails.vue b/pages/profit/profitEndDetails.vue index da9915c..7dca597 100644 --- a/pages/profit/profitEndDetails.vue +++ b/pages/profit/profitEndDetails.vue @@ -109,8 +109,23 @@ export default { }; }, created() { - const userInfoSync = uni.getStorageSync("userInfo"); - this.userInfo = userInfoSync; + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } const typeProfitId = uni.getStorageSync("typeId"); this.typeId = typeProfitId; if (typeProfitId) { @@ -156,17 +171,18 @@ export default { methods: { // 查询指定艺术家转入钱包收益列表 async queryFrontEndProfitAmt() { + let that = this; const res = await queryFrontEndProfitAmt({ - creatorId: this.userInfo.id, - type: this.typeId, - pageSize: this.pageSize, - pageNum: this.pageNum, + creatorId: that.userInfo.id, + type: that.typeId, + pageSize: that.pageSize, + pageNum: that.pageNum, }); if (res.data.code === 200) { - if (this.typeId === 0) { - this.endProfitAdList.push(...res.data.rows); + if (that.typeId === 0) { + that.endProfitAdList.push(...res.data.rows); } else { - this.endProfitInviteList.push(...res.data.rows); + that.endProfitInviteList.push(...res.data.rows); } } else { uni.showModal({ diff --git a/pages/profit/profitEndOrder.vue b/pages/profit/profitEndOrder.vue index 2a552b1..6d2d7fa 100644 --- a/pages/profit/profitEndOrder.vue +++ b/pages/profit/profitEndOrder.vue @@ -44,9 +44,29 @@ export default { type: "", profit: 0, walletTime: "", + userInfo:{} }, }; }, + created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } + }, onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 this.orderDetail.id = option.id; @@ -56,10 +76,11 @@ export default { methods: { // 查询指定艺术家转入钱包收益详情 async queryFrontEndAmtDetails() { - const res = await queryFrontEndAmtDetails(this.orderDetail.id); + let that = this; + const res = await queryFrontEndAmtDetails(that.orderDetail.id); //console.log('res', res) if (res.data.code === 200) { - this.orderDetail = res.data.data; + that.orderDetail = res.data.data; } else { uni.showModal({ content: "转入钱包收益详情数据加载失败!", diff --git a/pages/profit/profitInDetails.vue b/pages/profit/profitInDetails.vue index d8f4e72..2c2d047 100644 --- a/pages/profit/profitInDetails.vue +++ b/pages/profit/profitInDetails.vue @@ -109,8 +109,23 @@ export default { }; }, created() { - const userInfoSync = uni.getStorageSync("userInfo"); - this.userInfo = userInfoSync; + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } const typeProfitId = uni.getStorageSync("typeId"); this.typeId = typeProfitId; if (typeProfitId) { @@ -156,17 +171,18 @@ export default { methods: { // 查询指定艺术家已入账收益列表 async queryFrontInProfitAmt() { + let that = this; const res = await queryFrontInProfitAmt({ - creatorId: this.userInfo.id, - type: this.typeId, - pageSize: this.pageSize, - pageNum: this.pageNum, + creatorId: that.userInfo.id, + type: that.typeId, + pageSize: that.pageSize, + pageNum: that.pageNum, }); if (res.data.code === 200) { - if (this.typeId === 0) { - this.inProfitAdList.push(...res.data.rows); + if (that.typeId === 0) { + that.inProfitAdList.push(...res.data.rows); } else { - this.inProfitInviteList.push(...res.data.rows); + that.inProfitInviteList.push(...res.data.rows); } } else { uni.showModal({ diff --git a/pages/profit/profitInOrder.vue b/pages/profit/profitInOrder.vue index 82128c6..51c5f0e 100644 --- a/pages/profit/profitInOrder.vue +++ b/pages/profit/profitInOrder.vue @@ -67,9 +67,29 @@ export default { confirmType: "", confirmTime: "", confirmStatus: "", + userInfo:{} }, }; }, + created() { + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } + }, onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 this.orderDetail.id = option.id; @@ -79,10 +99,11 @@ export default { methods: { // 查询指定艺术家已入账收益详情 async queryFrontInAmtDetails() { - const res = await queryFrontInAmtDetails(this.orderDetail.id); + let that = this; + const res = await queryFrontInAmtDetails(that.orderDetail.id); //console.log('res', res) if (res.data.code === 200) { - this.orderDetail = res.data.data; + that.orderDetail = res.data.data; } else { uni.showModal({ content: "已入账收益详情数据加载失败!", @@ -93,9 +114,10 @@ export default { // 艺术家手动确认收益 handleUpdateConfirmType() { + let that = this; const param = { - creatorId: this.orderDetail.creatorId, - id: this.orderDetail.id, + creatorId: that.orderDetail.creatorId, + id: that.orderDetail.id, }; handleUpdateConfirmType(param).then((res) => { console.log("res", res); diff --git a/pages/profit/profitPreDetails.vue b/pages/profit/profitPreDetails.vue index 5628c88..33a96ea 100644 --- a/pages/profit/profitPreDetails.vue +++ b/pages/profit/profitPreDetails.vue @@ -103,8 +103,23 @@ export default { }; }, created() { - const userInfoSync = uni.getStorageSync("userInfo"); - this.userInfo = userInfoSync; + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } const typeProfitId = uni.getStorageSync("typeId"); this.typeId = typeProfitId; if (typeProfitId) { @@ -194,17 +209,18 @@ export default { // 查询即将入账邀请收益列表 async queryFrontPreProfit() { + let that = this; const res = await queryFrontPreProfit({ - creatorId: this.userInfo.id, - type: this.typeId, - pageSize: this.pageSize, - pageNum: this.pageNum, + creatorId: that.userInfo.id, + type: that.typeId, + pageSize: that.pageSize, + pageNum: that.pageNum, }); if (res.data.code === 200) { - if (this.typeId === 0) { - this.preProfitAdList.push(...res.data.rows); + if (that.typeId === 0) { + that.preProfitAdList.push(...res.data.rows); } else { - this.preprofitInviteList.push(...res.data.rows); + that.preprofitInviteList.push(...res.data.rows); } } else { uni.showModal({ diff --git a/pages/userInfo/userInfo.vue b/pages/userInfo/userInfo.vue index 3e598c4..bbc7700 100644 --- a/pages/userInfo/userInfo.vue +++ b/pages/userInfo/userInfo.vue @@ -56,7 +56,7 @@ title: '通知公告', img: '/static/iconNotice.png' }, { - url: '/pages-userInfo/withdraw/withdraw', + url: '/pages-userInfo/withdraw/withdrawIndex', title: '提现记录', img: '/static/iconWithdraw.png' },{ @@ -69,8 +69,23 @@ } }, created() { - this.userInfo = uni.getStorageSync('userInfo') - console.log('this.userInfo', this.userInfo) + const userInfo = uni.getStorageSync('userInfo') + if (!userInfo) { + console.log('havent userInfo') + uni.showModal({ + content: '艺术家账户过期,请重新登录!', + showCancel: false, + success() { + //没有缓存则跳转登录页面 + uni.reLaunch({ + url: '/pages/login/login' + }); + } + }); + } else { + this.userInfo = userInfo; + console.log('have userInfo') + } }, methods: { change(e) { diff --git a/static/aliPay.png b/static/aliPay.png new file mode 100644 index 0000000..485c541 Binary files /dev/null and b/static/aliPay.png differ diff --git a/static/wxPay.png b/static/wxPay.png new file mode 100644 index 0000000..7be6dc2 Binary files /dev/null and b/static/wxPay.png differ diff --git a/utils/common.js b/utils/common.js new file mode 100644 index 0000000..d276246 --- /dev/null +++ b/utils/common.js @@ -0,0 +1,24 @@ +// 防止处理多次点击 +function noMultipleClicks(methods, info) { + // methods是需要点击后需要执行的函数, info是点击需要传的参数 + let that = this; + if (that.noClick) { + // 第一次点击 + that.noClick= false; + if(info && info !== '') { + // info是执行函数需要传的参数 + methods(info); + } else { + methods(); + } + setTimeout(()=> { + that.noClick= true; + }, 2000) + } else { + // 这里是重复点击的判断 + } +} +//导出 +export default { + noMultipleClicks,//禁止多次点击 +} \ No newline at end of file