Browse Source

提交

feature-1.0
李凌霄 4 years ago
parent
commit
443c070887
  1. 237
      pages/profit/profitEndDetails.vue
  2. 31
      pages/profit/profitEndOrder.vue
  3. 237
      pages/profit/profitInDetails.vue
  4. 1
      pages/profit/profitInOrder.vue
  5. 223
      pages/profit/profitPreDetails.vue

237
pages/profit/profitEndDetails.vue

@ -1,23 +1,88 @@
<template> <template>
<view> <view>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="typeId" :values="items" :style-type="styleType" :active-color="activeColor" <uni-segmented-control
@clickItem="onClickItem" /> :current="typeId"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
</view> </view>
<view class="content"> <view class="content">
<view v-if="typeId === 0"> <view v-if="typeId === 0">
<uni-list border-full v-for="(item,index) in endProfitAdList" :key="index"> <uni-list
<uni-list-item showArrow clickable :title="item.walletTime+'@'+item.scanCode" border-full
:note="item.appType+'&'+item.platform+'&'+item.type" :thumb="item.url" thumb-size="lg" v-for="(item, index) in endProfitAdList"
:rightText="'¥'+item.profit" @click="targetToOrder(item.id)" /> :key="index"
>
<uni-list-item
showArrow
clickable
:title="item.walletTime + '@' + item.scanCode"
:note="item.appType + '&' + item.platform + '&' + item.type"
:thumb="item.url"
thumb-size="lg"
:rightText="'¥' + item.profit"
@click="targetToOrder(item.id)"
>
<template v-slot:body>
<view class="box">
<view class="uni-list-item__content-title">{{
item.createTime + "@" + item.scanCode
}}</view>
<view class="box-bot">
<view>
{{ setAppType(item.appType) }}
</view>
<view>
{{ setPlatform(item.platform) }}
</view>
<view style="color: #4d6aff">
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list> </uni-list>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view> <view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view> </view>
<view v-if="typeId === 1"> <view v-if="typeId === 1">
<uni-list border-full v-for="(item,index) in endProfitInviteList" :key="index"> <uni-list
<uni-list-item showArrow clickable :title="item.walletTime+'@'+item.scanCode" border-full
:note="item.appType+'&'+item.platform+'&'+item.type" :thumb="item.url" thumb-size="lg" v-for="(item, index) in endProfitInviteList"
:rightText="'¥'+item.profit" @click="targetToOrder(item.id)" /> :key="index"
>
<uni-list-item
showArrow
clickable
:title="item.walletTime + '@' + item.scanCode"
:note="item.appType + '&' + item.platform + '&' + item.type"
:thumb="item.url"
thumb-size="lg"
:rightText="'¥' + item.profit"
@click="targetToOrder(item.id)"
>
<template v-slot:body>
<view class="box">
<view class="uni-list-item__content-title">{{
item.createTime + "@" + item.scanCode
}}</view>
<view class="box-bot">
<view>
{{ setAppType(item.appType) }}
</view>
<view>
{{ setPlatform(item.platform) }}
</view>
<view style="color: #4d6aff">
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list> </uni-list>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view> <view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view> </view>
@ -26,48 +91,46 @@
</template> </template>
<script> <script>
import { import { queryFrontEndProfitAmt } from "@/api/profit.js";
queryFrontEndProfitAmt
} from '@/api/profit.js'
export default { export default {
data() { data() {
return { return {
items: ['广告', '邀请'], items: ["广告", "邀请"],
typeId: 0, typeId: 0,
activeColor: '#007aff', activeColor: "#007aff",
styleType: 'text', styleType: "text",
endProfitAdList: [], endProfitAdList: [],
endProfitInviteList: [], endProfitInviteList: [],
userInfo: {}, userInfo: {},
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
flagAd: false, flagAd: false,
flagInvite: false flagInvite: false,
} };
}, },
created() { created() {
const userInfoSync = uni.getStorageSync('userInfo') const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync this.userInfo = userInfoSync;
const typeProfitId = uni.getStorageSync('typeId') const typeProfitId = uni.getStorageSync("typeId");
this.typeId = typeProfitId this.typeId = typeProfitId;
if (typeProfitId) { if (typeProfitId) {
this.queryFrontEndProfitAmt() this.queryFrontEndProfitAmt();
} else { } else {
this.queryFrontEndProfitAmt() this.queryFrontEndProfitAmt();
} }
}, },
// //
onPullDownRefresh() { onPullDownRefresh() {
if (this.typeId === 0) { if (this.typeId === 0) {
this.pageNum = 1 this.pageNum = 1;
this.endProfitAdList = [] this.endProfitAdList = [];
this.queryFrontEndProfitAmt() this.queryFrontEndProfitAmt();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} else { } else {
this.pageNum = 1 this.pageNum = 1;
this.endProfitInviteList = [] this.endProfitInviteList = [];
this.queryFrontEndProfitAmt() this.queryFrontEndProfitAmt();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} }
}, },
// //
@ -75,7 +138,7 @@
if (this.typeId === 0) { if (this.typeId === 0) {
if (this.endProfitAdList.length > this.pageNum * this.pageSize - 1) { if (this.endProfitAdList.length > this.pageNum * this.pageSize - 1) {
this.flagAd = false; this.flagAd = false;
this.pageNum += 1 this.pageNum += 1;
this.queryFrontEndProfitAmt(); this.queryFrontEndProfitAmt();
} else { } else {
this.flagAd = true; this.flagAd = true;
@ -83,46 +146,44 @@
} else { } else {
if (this.endProfitInviteList.length > this.pageNum * this.pageSize - 1) { if (this.endProfitInviteList.length > this.pageNum * this.pageSize - 1) {
this.flagInvite = false; this.flagInvite = false;
this.pageNum += 1 this.pageNum += 1;
this.queryFrontEndProfitAmt(); this.queryFrontEndProfitAmt();
} else { } else {
this.flagInvite = true; this.flagInvite = true;
} }
} }
}, },
methods: { methods: {
// //
async queryFrontEndProfitAmt() { async queryFrontEndProfitAmt() {
const res = await queryFrontEndProfitAmt({ const res = await queryFrontEndProfitAmt({
creatorId: this.userInfo.id, creatorId: this.userInfo.id,
type: this.typeId, type: this.typeId,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum,
}) });
if (res.data.code === 200) { if (res.data.code === 200) {
if (this.typeId === 0) { if (this.typeId === 0) {
this.endProfitAdList.push(...res.data.rows) this.endProfitAdList.push(...res.data.rows);
} else { } else {
this.endProfitInviteList.push(...res.data.rows) this.endProfitInviteList.push(...res.data.rows);
} }
} else { } else {
uni.showModal({ uni.showModal({
content: '转入钱包列表数据加载失败!', content: "转入钱包列表数据加载失败!",
showCancel: false showCancel: false,
}); });
} }
}, },
onClickItem(e) { onClickItem(e) {
let that = this let that = this;
that.endProfitAdList = [] that.endProfitAdList = [];
that.endProfitInviteList = [] that.endProfitInviteList = [];
if (that.typeId !== e.currentIndex) { if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex that.typeId = e.currentIndex;
uni.showLoading({ uni.showLoading({
title: '加载中', title: "加载中",
mask: true, mask: true,
success() { success() {
// //
@ -130,44 +191,71 @@
creatorId: that.userInfo.id, creatorId: that.userInfo.id,
type: that.typeId, type: that.typeId,
pageSize: that.pageSize, pageSize: that.pageSize,
pageNum: 1 pageNum: 1,
} };
queryFrontEndProfitAmt(param).then(res => { queryFrontEndProfitAmt(param).then((res) => {
//console.log('res', res) //console.log('res', res)
if (res.data.code === 200) { if (res.data.code === 200) {
if (that.typeId === 0) { if (that.typeId === 0) {
that.endProfitAdList.push(...res.data.rows) that.endProfitAdList.push(...res.data.rows);
} else { } else {
that.endProfitInviteList.push(...res.data.rows) that.endProfitInviteList.push(...res.data.rows);
} }
console.log('点击操作endProfitAdList',that.endProfitAdList) console.log("点击操作endProfitAdList", that.endProfitAdList);
console.log('点击操作endProfitInviteList',that.endProfitInviteList) console.log(
"点击操作endProfitInviteList",
that.endProfitInviteList
);
} else { } else {
uni.showModal({ uni.showModal({
content: '转入钱包列表数据加载失败!', content: "转入钱包列表数据加载失败!",
showCancel: false showCancel: false,
}); });
} }
}) });
}, },
complete() { complete() {
uni.hideLoading(); uni.hideLoading();
} },
}); });
} }
}, },
targetToOrder(id) { targetToOrder(id) {
console.log('id', id) console.log("id", id);
if (id) { if (id) {
uni.navigateTo({ uni.navigateTo({
url: '../profit/profitEndOrder?id=' + id url: "../profit/profitEndOrder?id=" + id,
}) });
} }
},
setPlatform(data) {
if (data == "0") {
return "抖音";
} else if (data == "1") {
return "快手";
} else if (data == "2") {
return "微信";
} else if (data == "3") {
return "uniapp";
} }
},
setAppType(data) {
if (data == "0") {
return "次元壁纸";
} }
},
setType(data) {
if (data == "0") {
return "广告浏览";
} else if (data == "1") {
return "邀请";
} else if (data == "2") {
return "会员";
} }
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
@ -182,4 +270,29 @@
background: #fff; background: #fff;
font-size: 20rpx; font-size: 20rpx;
} }
.box {
display: flex;
padding-right: 8px;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: center;
overflow: hidden;
}
.box-bot {
display: flex;
margin-top: 5px;
}
.box-bot view {
border-radius: 3px;
border: 1px solid #4d6aff;
padding: 2px 5px;
margin-right: 5px;
font-size: 12px;
}
.uni-list-item__content-title {
font-size: 14px;
color: #3b4144;
overflow: hidden;
}
</style> </style>

31
pages/profit/profitEndOrder.vue

@ -9,15 +9,15 @@
</view> </view>
<view class="box"> <view class="box">
<text class="title">结算平台:</text> <text class="title">结算平台:</text>
<text>{{ orderDetail.platform }}</text> <text>{{ setPlatform(orderDetail.platform) }}</text>
</view> </view>
<view class="box"> <view class="box">
<text class="title">应用:</text> <text class="title">应用:</text>
<text>{{ orderDetail.appType }}</text> <text>{{ setAppType(orderDetail.appType) }}</text>
</view> </view>
<view class="box"> <view class="box">
<text class="title">收益类型:</text> <text class="title">收益类型:</text>
<text>{{ orderDetail.type }}</text> <text>{{ setType(orderDetail.type) }}</text>
</view> </view>
<view class="box"> <view class="box">
<text class="title">结算收入:</text> <text class="title">结算收入:</text>
@ -80,6 +80,31 @@ export default {
}); });
} }
}, },
setPlatform(data) {
if (data == "0") {
return "抖音";
} else if (data == "1") {
return "快手";
} else if (data == "2") {
return "微信";
} else if (data == "3") {
return "uniapp";
}
},
setAppType(data) {
if (data == "0") {
return "次元壁纸";
}
},
setType(data) {
if (data == "0") {
return "广告浏览";
} else if (data == "1") {
return "邀请";
} else if (data == "2") {
return "会员";
}
},
}, },
}; };
</script> </script>

237
pages/profit/profitInDetails.vue

@ -1,23 +1,88 @@
<template> <template>
<view> <view>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="typeId" :values="items" :style-type="styleType" :active-color="activeColor" <uni-segmented-control
@clickItem="onClickItem" /> :current="typeId"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
</view> </view>
<view class="content"> <view class="content">
<view v-if="typeId === 0"> <view v-if="typeId === 0">
<uni-list border-full v-for="(item,index) in inProfitAdList" :key="index"> <uni-list
<uni-list-item showArrow clickable :title="item.createTime+'@'+item.scanCode" border-full
:note="item.appType+'&'+item.platform+'&'+item.type" :thumb="item.url" thumb-size="lg" v-for="(item, index) in inProfitAdList"
:rightText="'¥'+item.profit" @click="targetToOrder(item.id)" /> :key="index"
>
<uni-list-item
showArrow
clickable
:title="item.createTime + '@' + item.scanCode"
:note="item.appType + '&' + item.platform + '&' + item.type"
:thumb="item.url"
thumb-size="lg"
:rightText="'¥' + item.profit"
@click="targetToOrder(item.id)"
>
<template v-slot:body>
<view class="box">
<view class="uni-list-item__content-title">{{
item.createTime + "@" + item.scanCode
}}</view>
<view class="box-bot">
<view>
{{ setAppType(item.appType) }}
</view>
<view>
{{ setPlatform(item.platform) }}
</view>
<view style="color: #4d6aff">
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list> </uni-list>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view> <view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view> </view>
<view v-if="typeId === 1"> <view v-if="typeId === 1">
<uni-list border-full v-for="(item,index) in inProfitInviteList" :key="index"> <uni-list
<uni-list-item showArrow clickable :title="item.createTime+'@'+item.scanCode" border-full
:note="item.appType+'&'+item.platform+'&'+item.type" :thumb="item.url" thumb-size="lg" v-for="(item, index) in inProfitInviteList"
:rightText="'¥'+item.profit" @click="targetToOrder(item.id)" /> :key="index"
>
<uni-list-item
showArrow
clickable
:title="item.createTime + '@' + item.scanCode"
:note="item.appType + '&' + item.platform + '&' + item.type"
:thumb="item.url"
thumb-size="lg"
:rightText="'¥' + item.profit"
@click="targetToOrder(item.id)"
>
<template v-slot:body>
<view class="box">
<view class="uni-list-item__content-title">{{
item.createTime + "@" + item.scanCode
}}</view>
<view class="box-bot">
<view>
{{ setAppType(item.appType) }}
</view>
<view>
{{ setPlatform(item.platform) }}
</view>
<view style="color: #4d6aff">
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list> </uni-list>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view> <view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view> </view>
@ -26,48 +91,46 @@
</template> </template>
<script> <script>
import { import { queryFrontInProfitAmt } from "@/api/profit.js";
queryFrontInProfitAmt
} from '@/api/profit.js'
export default { export default {
data() { data() {
return { return {
items: ['广告', '邀请'], items: ["广告", "邀请"],
typeId: 0, typeId: 0,
activeColor: '#007aff', activeColor: "#007aff",
styleType: 'text', styleType: "text",
inProfitAdList: [], inProfitAdList: [],
inProfitInviteList: [], inProfitInviteList: [],
userInfo: {}, userInfo: {},
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
flagAd: false, flagAd: false,
flagInvite: false flagInvite: false,
} };
}, },
created() { created() {
const userInfoSync = uni.getStorageSync('userInfo') const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync this.userInfo = userInfoSync;
const typeProfitId = uni.getStorageSync('typeId') const typeProfitId = uni.getStorageSync("typeId");
this.typeId = typeProfitId this.typeId = typeProfitId;
if (typeProfitId) { if (typeProfitId) {
this.queryFrontInProfitAmt() this.queryFrontInProfitAmt();
} else { } else {
this.queryFrontInProfitAmt() this.queryFrontInProfitAmt();
} }
}, },
// //
onPullDownRefresh() { onPullDownRefresh() {
if (this.typeId === 0) { if (this.typeId === 0) {
this.pageNum = 1 this.pageNum = 1;
this.inProfitAdList = [] this.inProfitAdList = [];
this.queryFrontInProfitAmt() this.queryFrontInProfitAmt();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} else { } else {
this.pageNum = 1 this.pageNum = 1;
this.inProfitInviteList = [] this.inProfitInviteList = [];
this.queryFrontInProfitAmt() this.queryFrontInProfitAmt();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} }
}, },
// //
@ -75,7 +138,7 @@
if (this.typeId === 0) { if (this.typeId === 0) {
if (this.inProfitAdList.length > this.pageNum * this.pageSize - 1) { if (this.inProfitAdList.length > this.pageNum * this.pageSize - 1) {
this.flagAd = false; this.flagAd = false;
this.pageNum += 1 this.pageNum += 1;
this.queryFrontInProfitAmt(); this.queryFrontInProfitAmt();
} else { } else {
this.flagAd = true; this.flagAd = true;
@ -83,46 +146,44 @@
} else { } else {
if (this.inProfitInviteList.length > this.pageNum * this.pageSize - 1) { if (this.inProfitInviteList.length > this.pageNum * this.pageSize - 1) {
this.flagInvite = false; this.flagInvite = false;
this.pageNum += 1 this.pageNum += 1;
this.queryFrontInProfitAmt(); this.queryFrontInProfitAmt();
} else { } else {
this.flagInvite = true; this.flagInvite = true;
} }
} }
}, },
methods: { methods: {
// //
async queryFrontInProfitAmt() { async queryFrontInProfitAmt() {
const res = await queryFrontInProfitAmt({ const res = await queryFrontInProfitAmt({
creatorId: this.userInfo.id, creatorId: this.userInfo.id,
type: this.typeId, type: this.typeId,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum,
}) });
if (res.data.code === 200) { if (res.data.code === 200) {
if (this.typeId === 0) { if (this.typeId === 0) {
this.inProfitAdList.push(...res.data.rows) this.inProfitAdList.push(...res.data.rows);
} else { } else {
this.inProfitInviteList.push(...res.data.rows) this.inProfitInviteList.push(...res.data.rows);
} }
} else { } else {
uni.showModal({ uni.showModal({
content: '已入账列表数据加载失败!', content: "已入账列表数据加载失败!",
showCancel: false showCancel: false,
}); });
} }
}, },
onClickItem(e) { onClickItem(e) {
let that = this let that = this;
that.inProfitAdList = [] that.inProfitAdList = [];
that.inProfitInviteList = [] that.inProfitInviteList = [];
if (that.typeId !== e.currentIndex) { if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex that.typeId = e.currentIndex;
uni.showLoading({ uni.showLoading({
title: '加载中', title: "加载中",
mask: true, mask: true,
success() { success() {
// //
@ -130,43 +191,70 @@
creatorId: that.userInfo.id, creatorId: that.userInfo.id,
type: that.typeId, type: that.typeId,
pageSize: that.pageSize, pageSize: that.pageSize,
pageNum: 1 pageNum: 1,
} };
queryFrontInProfitAmt(param).then(res => { queryFrontInProfitAmt(param).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
if (that.typeId === 0) { if (that.typeId === 0) {
that.inProfitAdList.push(...res.data.rows) that.inProfitAdList.push(...res.data.rows);
} else { } else {
that.inProfitInviteList.push(...res.data.rows) that.inProfitInviteList.push(...res.data.rows);
} }
console.log('点击操作inProfitAdList',that.inProfitAdList) console.log("点击操作inProfitAdList", that.inProfitAdList);
console.log('点击操作inProfitInviteList',that.inProfitInviteList) console.log(
"点击操作inProfitInviteList",
that.inProfitInviteList
);
} else { } else {
uni.showModal({ uni.showModal({
content: '已入账列表数据加载失败!', content: "已入账列表数据加载失败!",
showCancel: false showCancel: false,
}); });
} }
}) });
}, },
complete() { complete() {
uni.hideLoading(); uni.hideLoading();
} },
}); });
} }
}, },
targetToOrder(id) { targetToOrder(id) {
console.log('id', id) console.log("id", id);
if (id) { if (id) {
uni.navigateTo({ uni.navigateTo({
url: '../profit/profitInOrder?id=' + id url: "../profit/profitInOrder?id=" + id,
}) });
} }
},
setPlatform(data) {
if (data == "0") {
return "抖音";
} else if (data == "1") {
return "快手";
} else if (data == "2") {
return "微信";
} else if (data == "3") {
return "uniapp";
} }
},
setAppType(data) {
if (data == "0") {
return "次元壁纸";
} }
},
setType(data) {
if (data == "0") {
return "广告浏览";
} else if (data == "1") {
return "邀请";
} else if (data == "2") {
return "会员";
} }
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
@ -181,4 +269,29 @@
background: #fff; background: #fff;
font-size: 20rpx; font-size: 20rpx;
} }
.box {
display: flex;
padding-right: 8px;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: center;
overflow: hidden;
}
.box-bot {
display: flex;
margin-top: 5px;
}
.box-bot view {
border-radius: 3px;
border: 1px solid #4d6aff;
padding: 2px 5px;
margin-right: 5px;
font-size: 12px;
}
.uni-list-item__content-title {
font-size: 14px;
color: #3b4144;
overflow: hidden;
}
</style> </style>

1
pages/profit/profitInOrder.vue

@ -205,4 +205,5 @@ export default {
background: rgb(229, 229, 229); background: rgb(229, 229, 229);
margin-bottom: 20px; margin-bottom: 20px;
} }
</style> </style>

223
pages/profit/profitPreDetails.vue

@ -1,28 +1,82 @@
<template> <template>
<view> <view>
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="typeId" :values="items" :style-type="styleType" :active-color="activeColor" <uni-segmented-control
@clickItem="onClickItem" /> :current="typeId"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
</view> </view>
<view class="content"> <view class="content">
<view v-if="typeId === 0"> <view v-if="typeId === 0">
<uni-list border-full v-for="(item,index) in preProfitAdList" :key="index"> <uni-list
border-full
<uni-list-item :title="item.createTime+'@'+item.scanCode" v-for="(item, index) in preProfitAdList"
:note="item.appType+'&'+item.platform+'&'+item.type" :thumb="item.url" thumb-size="lg" :key="index"
:rightText="item.downloadNum+'次'" > >
<uni-list-item
:title="item.createTime + '@' + item.scanCode"
:note="item.appType + '&' + item.platform + '&' + item.type"
:thumb="item.url"
thumb-size="lg"
:rightText="item.downloadNum + '次'"
>
<template v-slot:body> <template v-slot:body>
<text class="slot-box slot-text">自定义插槽</text> <view class="box">
<view class="uni-list-item__content-title">{{
item.createTime + "@" + item.scanCode
}}</view>
<view class="box-bot">
<view>
{{ setAppType(item.appType) }}
</view>
<view>
{{ setPlatform(item.platform) }}
</view>
<view style="color: #4d6aff">
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
</view>
</view>
</view>
</template> </template>
</uni-list-item> </uni-list-item>
</uni-list> </uni-list>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view> <view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view> </view>
<view v-if="typeId === 1"> <view v-if="typeId === 1">
<uni-list border-full v-for="(item,index) in preprofitInviteList" :key="index"> <uni-list
<uni-list-item :title="item.createTime+'@'+item.scanCode" border-full
:note="item.appType+'&'+item.platform+'&'+item.type" :thumb="item.url" thumb-size="lg" v-for="(item, index) in preprofitInviteList"
:rightText="item.downloadNum+'次'" /> :key="index"
>
<uni-list-item
:title="item.createTime + '@' + item.scanCode"
:note="item.appType + '&' + item.platform + '&' + item.type"
:thumb="item.url"
thumb-size="lg"
:rightText="item.downloadNum + '次'"
>
<template v-slot:body>
<view class="box">
<view class="uni-list-item__content-title">{{
item.createTime + "@" + item.scanCode
}}</view>
<view class="box-bot">
<view>
{{ setAppType(item.appType) }}
</view>
<view>
{{ setPlatform(item.platform) }}
</view>
<view style="color: #4d6aff">
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
</view>
</view>
</view>
</template>
</uni-list-item>
</uni-list> </uni-list>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view> <view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view> </view>
@ -31,48 +85,46 @@
</template> </template>
<script> <script>
import { import { queryFrontPreProfit } from "@/api/profit.js";
queryFrontPreProfit
} from '@/api/profit.js'
export default { export default {
data() { data() {
return { return {
preProfitAdList: [], preProfitAdList: [],
preprofitInviteList: [], preprofitInviteList: [],
items: ['广告', '邀请'], items: ["广告", "邀请"],
typeId: 0, typeId: 0,
activeColor: '#007aff', activeColor: "#007aff",
styleType: 'text', styleType: "text",
userInfo: {}, userInfo: {},
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
flagAd: false, flagAd: false,
flagInvite: false flagInvite: false,
} };
}, },
created() { created() {
const userInfoSync = uni.getStorageSync('userInfo') const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync this.userInfo = userInfoSync;
const typeProfitId = uni.getStorageSync('typeId') const typeProfitId = uni.getStorageSync("typeId");
this.typeId = typeProfitId this.typeId = typeProfitId;
if (typeProfitId) { if (typeProfitId) {
this.queryFrontPreProfit() this.queryFrontPreProfit();
} else { } else {
this.queryFrontPreProfit() this.queryFrontPreProfit();
} }
}, },
// //
onPullDownRefresh() { onPullDownRefresh() {
if (this.typeId === 0) { if (this.typeId === 0) {
this.pageNum = 1 this.pageNum = 1;
this.preProfitAdList = [] this.preProfitAdList = [];
this.queryFrontPreProfit() this.queryFrontPreProfit();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} else { } else {
this.pageNum = 1 this.pageNum = 1;
this.preprofitInviteList = [] this.preprofitInviteList = [];
this.queryFrontPreProfit() this.queryFrontPreProfit();
uni.stopPullDownRefresh() uni.stopPullDownRefresh();
} }
}, },
// //
@ -80,7 +132,7 @@
if (this.typeId === 0) { if (this.typeId === 0) {
if (this.preProfitAdList.length > this.pageNum * this.pageSize - 1) { if (this.preProfitAdList.length > this.pageNum * this.pageSize - 1) {
this.flagAd = false; this.flagAd = false;
this.pageNum += 1 this.pageNum += 1;
this.queryFrontPreProfit(); this.queryFrontPreProfit();
} else { } else {
this.flagAd = true; this.flagAd = true;
@ -88,23 +140,22 @@
} else { } else {
if (this.preprofitInviteList.length > this.pageNum * this.pageSize - 1) { if (this.preprofitInviteList.length > this.pageNum * this.pageSize - 1) {
this.flagInvite = false; this.flagInvite = false;
this.pageNum += 1 this.pageNum += 1;
this.queryFrontPreProfit(); this.queryFrontPreProfit();
} else { } else {
this.flagInvite = true; this.flagInvite = true;
} }
} }
}, },
methods: { methods: {
onClickItem(e) { onClickItem(e) {
let that = this let that = this;
that.preProfitAdList = [] that.preProfitAdList = [];
that.preprofitInviteList = [] that.preprofitInviteList = [];
if (that.typeId !== e.currentIndex) { if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex that.typeId = e.currentIndex;
uni.showLoading({ uni.showLoading({
title: '加载中', title: "加载中",
mask: true, mask: true,
success() { success() {
// //
@ -112,30 +163,32 @@
creatorId: that.userInfo.id, creatorId: that.userInfo.id,
type: that.typeId, type: that.typeId,
pageSize: that.pageSize, pageSize: that.pageSize,
pageNum: 1 pageNum: 1,
} };
queryFrontPreProfit(param).then(res => { queryFrontPreProfit(param).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
if (that.typeId === 0) { if (that.typeId === 0) {
that.preProfitAdList.push(...res.data.rows) that.preProfitAdList.push(...res.data.rows);
} else { } else {
that.preprofitInviteList.push(...res.data.rows) that.preprofitInviteList.push(...res.data.rows);
} }
console.log('点击操作preProfitAdList',that.preProfitAdList) console.log("点击操作preProfitAdList", that.preProfitAdList);
console.log('点击操作preprofitInviteList',that.preprofitInviteList) console.log(
"点击操作preprofitInviteList",
that.preprofitInviteList
);
} else { } else {
uni.showModal({ uni.showModal({
content: '即将到账列表数据加载失败!', content: "即将到账列表数据加载失败!",
showCancel: false showCancel: false,
}); });
} }
}) });
}, },
complete() { complete() {
uni.hideLoading(); uni.hideLoading();
} },
}); });
} }
}, },
@ -145,23 +198,48 @@
creatorId: this.userInfo.id, creatorId: this.userInfo.id,
type: this.typeId, type: this.typeId,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum pageNum: this.pageNum,
}) });
if (res.data.code === 200) { if (res.data.code === 200) {
if (this.typeId === 0) { if (this.typeId === 0) {
this.preProfitAdList.push(...res.data.rows) this.preProfitAdList.push(...res.data.rows);
} else { } else {
this.preprofitInviteList.push(...res.data.rows) this.preprofitInviteList.push(...res.data.rows);
} }
} else { } else {
uni.showModal({ uni.showModal({
content: '即将到账列表数据加载失败!', content: "即将到账列表数据加载失败!",
showCancel: false showCancel: false,
}); });
} }
}, },
setPlatform(data) {
if (data == "0") {
return "抖音";
} else if (data == "1") {
return "快手";
} else if (data == "2") {
return "微信";
} else if (data == "3") {
return "uniapp";
} }
},
setAppType(data) {
if (data == "0") {
return "次元壁纸";
} }
},
setType(data) {
if (data == "0") {
return "广告浏览";
} else if (data == "1") {
return "邀请";
} else if (data == "2") {
return "会员";
}
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
@ -176,4 +254,29 @@
background: #fff; background: #fff;
font-size: 20rpx; font-size: 20rpx;
} }
.box {
display: flex;
padding-right: 8px;
flex: 1;
color: #3b4144;
flex-direction: column;
justify-content: center;
overflow: hidden;
}
.box-bot {
display: flex;
margin-top: 5px;
}
.box-bot view {
border-radius: 3px;
border: 1px solid #4d6aff;
padding: 2px 5px;
margin-right: 5px;
font-size: 12px;
}
.uni-list-item__content-title {
font-size: 14px;
color: #3b4144;
overflow: hidden;
}
</style> </style>

Loading…
Cancel
Save