Browse Source

提交

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

459
pages/profit/profitEndDetails.vue

@ -1,185 +1,298 @@
<template>
<view>
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="typeId" :values="items" :style-type="styleType" :active-color="activeColor"
@clickItem="onClickItem" />
</view>
<view class="content">
<view v-if="typeId === 0">
<uni-list border-full v-for="(item,index) in endProfitAdList" :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)" />
</uni-list>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view>
<view v-if="typeId === 1">
<uni-list border-full v-for="(item,index) in endProfitInviteList" :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)" />
</uni-list>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view>
</view>
</view>
<view>
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control
:current="typeId"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
</view>
<view class="content">
<view v-if="typeId === 0">
<uni-list
border-full
v-for="(item, index) in endProfitAdList"
: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>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view>
<view v-if="typeId === 1">
<uni-list
border-full
v-for="(item, index) in endProfitInviteList"
: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>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view>
</view>
</view>
</template>
<script>
import {
queryFrontEndProfitAmt
} from '@/api/profit.js'
export default {
data() {
return {
items: ['广告', '邀请'],
typeId: 0,
activeColor: '#007aff',
styleType: 'text',
endProfitAdList: [],
endProfitInviteList: [],
userInfo: {},
pageSize: 10,
pageNum: 1,
flagAd: false,
flagInvite: false
}
},
created() {
const userInfoSync = uni.getStorageSync('userInfo')
this.userInfo = userInfoSync
const typeProfitId = uni.getStorageSync('typeId')
this.typeId = typeProfitId
if (typeProfitId) {
this.queryFrontEndProfitAmt()
} else {
this.queryFrontEndProfitAmt()
}
},
//
onPullDownRefresh() {
if(this.typeId === 0){
this.pageNum = 1
this.endProfitAdList = []
this.queryFrontEndProfitAmt()
uni.stopPullDownRefresh()
}else{
this.pageNum = 1
this.endProfitInviteList = []
this.queryFrontEndProfitAmt()
uni.stopPullDownRefresh()
}
},
//
onReachBottom() {
if(this.typeId === 0){
if (this.endProfitAdList.length > this.pageNum*this.pageSize-1 ) {
this.flagAd = false;
this.pageNum += 1
this.queryFrontEndProfitAmt();
}else{
this.flagAd = true;
}
}else{
if (this.endProfitInviteList.length > this.pageNum*this.pageSize-1 ) {
this.flagInvite = false;
this.pageNum += 1
this.queryFrontEndProfitAmt();
}else{
this.flagInvite = true;
}
}
},
methods: {
import { queryFrontEndProfitAmt } from "@/api/profit.js";
export default {
data() {
return {
items: ["广告", "邀请"],
typeId: 0,
activeColor: "#007aff",
styleType: "text",
endProfitAdList: [],
endProfitInviteList: [],
userInfo: {},
pageSize: 10,
pageNum: 1,
flagAd: false,
flagInvite: false,
};
},
created() {
const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync;
const typeProfitId = uni.getStorageSync("typeId");
this.typeId = typeProfitId;
if (typeProfitId) {
this.queryFrontEndProfitAmt();
} else {
this.queryFrontEndProfitAmt();
}
},
//
onPullDownRefresh() {
if (this.typeId === 0) {
this.pageNum = 1;
this.endProfitAdList = [];
this.queryFrontEndProfitAmt();
uni.stopPullDownRefresh();
} else {
this.pageNum = 1;
this.endProfitInviteList = [];
this.queryFrontEndProfitAmt();
uni.stopPullDownRefresh();
}
},
//
onReachBottom() {
if (this.typeId === 0) {
if (this.endProfitAdList.length > this.pageNum * this.pageSize - 1) {
this.flagAd = false;
this.pageNum += 1;
this.queryFrontEndProfitAmt();
} else {
this.flagAd = true;
}
} else {
if (this.endProfitInviteList.length > this.pageNum * this.pageSize - 1) {
this.flagInvite = false;
this.pageNum += 1;
this.queryFrontEndProfitAmt();
} else {
this.flagInvite = true;
}
}
},
methods: {
//
async queryFrontEndProfitAmt() {
const res = await queryFrontEndProfitAmt({
creatorId: this.userInfo.id,
type: this.typeId,
pageSize: this.pageSize,
pageNum: this.pageNum,
});
if (res.data.code === 200) {
if (this.typeId === 0) {
this.endProfitAdList.push(...res.data.rows);
} else {
this.endProfitInviteList.push(...res.data.rows);
}
} else {
uni.showModal({
content: "转入钱包列表数据加载失败!",
showCancel: false,
});
}
},
//
async queryFrontEndProfitAmt() {
const res = await queryFrontEndProfitAmt({
creatorId: this.userInfo.id,
type: this.typeId,
pageSize: this.pageSize,
pageNum: this.pageNum
})
if (res.data.code === 200) {
if(this.typeId === 0){
this.endProfitAdList.push(...res.data.rows)
}else{
this.endProfitInviteList.push(...res.data.rows)
}
} else {
uni.showModal({
content: '转入钱包列表数据加载失败!',
showCancel: false
});
}
},
onClickItem(e) {
let that = this;
that.endProfitAdList = [];
that.endProfitInviteList = [];
if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex;
uni.showLoading({
title: "加载中",
mask: true,
success() {
//
const param = {
creatorId: that.userInfo.id,
type: that.typeId,
pageSize: that.pageSize,
pageNum: 1,
};
queryFrontEndProfitAmt(param).then((res) => {
//console.log('res', res)
if (res.data.code === 200) {
if (that.typeId === 0) {
that.endProfitAdList.push(...res.data.rows);
} else {
that.endProfitInviteList.push(...res.data.rows);
}
console.log("点击操作endProfitAdList", that.endProfitAdList);
console.log(
"点击操作endProfitInviteList",
that.endProfitInviteList
);
} else {
uni.showModal({
content: "转入钱包列表数据加载失败!",
showCancel: false,
});
}
});
},
complete() {
uni.hideLoading();
},
});
}
},
onClickItem(e) {
let that = this
that.endProfitAdList = []
that.endProfitInviteList = []
if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex
uni.showLoading({
title: '加载中',
mask: true,
success() {
//
const param = {
creatorId: that.userInfo.id,
type: that.typeId,
pageSize: that.pageSize,
pageNum: 1
}
queryFrontEndProfitAmt(param).then(res => {
//console.log('res', res)
if (res.data.code === 200) {
if(that.typeId === 0){
that.endProfitAdList.push(...res.data.rows)
}else{
that.endProfitInviteList.push(...res.data.rows)
}
console.log('点击操作endProfitAdList',that.endProfitAdList)
console.log('点击操作endProfitInviteList',that.endProfitInviteList)
} else {
uni.showModal({
content: '转入钱包列表数据加载失败!',
showCancel: false
});
}
})
},
complete() {
uni.hideLoading();
}
});
}
},
targetToOrder(id) {
console.log('id', id)
if (id) {
uni.navigateTo({
url: '../profit/profitEndOrder?id=' + id
})
}
}
}
}
targetToOrder(id) {
console.log("id", id);
if (id) {
uni.navigateTo({
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>
<style lang="scss">
.uni-list-item__icon-img{
.uni-list-item__icon-img {
border-radius: 8px;
}
.ivOver{
width: 100%;
height:50px;
line-height: 50px;
text-align: center;
background: #fff;
font-size: 20rpx;
}
.ivOver {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background: #fff;
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>

31
pages/profit/profitEndOrder.vue

@ -9,15 +9,15 @@
</view>
<view class="box">
<text class="title">结算平台:</text>
<text>{{ orderDetail.platform }}</text>
<text>{{ setPlatform(orderDetail.platform) }}</text>
</view>
<view class="box">
<text class="title">应用:</text>
<text>{{ orderDetail.appType }}</text>
<text>{{ setAppType(orderDetail.appType) }}</text>
</view>
<view class="box">
<text class="title">收益类型:</text>
<text>{{ orderDetail.type }}</text>
<text>{{ setType(orderDetail.type) }}</text>
</view>
<view class="box">
<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>

457
pages/profit/profitInDetails.vue

@ -1,184 +1,297 @@
<template>
<view>
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="typeId" :values="items" :style-type="styleType" :active-color="activeColor"
@clickItem="onClickItem" />
</view>
<view class="content">
<view v-if="typeId === 0">
<uni-list border-full v-for="(item,index) in inProfitAdList" :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)" />
</uni-list>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view>
<view v-if="typeId === 1">
<uni-list border-full v-for="(item,index) in inProfitInviteList" :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)" />
</uni-list>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view>
</view>
</view>
<view>
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control
:current="typeId"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
</view>
<view class="content">
<view v-if="typeId === 0">
<uni-list
border-full
v-for="(item, index) in inProfitAdList"
: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>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view>
<view v-if="typeId === 1">
<uni-list
border-full
v-for="(item, index) in inProfitInviteList"
: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>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view>
</view>
</view>
</template>
<script>
import {
queryFrontInProfitAmt
} from '@/api/profit.js'
export default {
data() {
return {
items: ['广告', '邀请'],
typeId: 0,
activeColor: '#007aff',
styleType: 'text',
inProfitAdList: [],
inProfitInviteList: [],
userInfo: {},
pageSize: 10,
pageNum: 1,
flagAd: false,
flagInvite: false
}
},
created() {
const userInfoSync = uni.getStorageSync('userInfo')
this.userInfo = userInfoSync
const typeProfitId = uni.getStorageSync('typeId')
this.typeId = typeProfitId
if (typeProfitId) {
this.queryFrontInProfitAmt()
} else {
this.queryFrontInProfitAmt()
}
},
//
onPullDownRefresh() {
if(this.typeId === 0){
this.pageNum = 1
this.inProfitAdList = []
this.queryFrontInProfitAmt()
uni.stopPullDownRefresh()
}else{
this.pageNum = 1
this.inProfitInviteList = []
this.queryFrontInProfitAmt()
uni.stopPullDownRefresh()
}
},
//
onReachBottom() {
if(this.typeId === 0){
if (this.inProfitAdList.length > this.pageNum*this.pageSize-1 ) {
this.flagAd = false;
this.pageNum += 1
this.queryFrontInProfitAmt();
}else{
this.flagAd = true;
}
}else{
if (this.inProfitInviteList.length > this.pageNum*this.pageSize-1 ) {
this.flagInvite = false;
this.pageNum += 1
this.queryFrontInProfitAmt();
}else{
this.flagInvite = true;
}
}
},
methods: {
import { queryFrontInProfitAmt } from "@/api/profit.js";
export default {
data() {
return {
items: ["广告", "邀请"],
typeId: 0,
activeColor: "#007aff",
styleType: "text",
inProfitAdList: [],
inProfitInviteList: [],
userInfo: {},
pageSize: 10,
pageNum: 1,
flagAd: false,
flagInvite: false,
};
},
created() {
const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync;
const typeProfitId = uni.getStorageSync("typeId");
this.typeId = typeProfitId;
if (typeProfitId) {
this.queryFrontInProfitAmt();
} else {
this.queryFrontInProfitAmt();
}
},
//
onPullDownRefresh() {
if (this.typeId === 0) {
this.pageNum = 1;
this.inProfitAdList = [];
this.queryFrontInProfitAmt();
uni.stopPullDownRefresh();
} else {
this.pageNum = 1;
this.inProfitInviteList = [];
this.queryFrontInProfitAmt();
uni.stopPullDownRefresh();
}
},
//
onReachBottom() {
if (this.typeId === 0) {
if (this.inProfitAdList.length > this.pageNum * this.pageSize - 1) {
this.flagAd = false;
this.pageNum += 1;
this.queryFrontInProfitAmt();
} else {
this.flagAd = true;
}
} else {
if (this.inProfitInviteList.length > this.pageNum * this.pageSize - 1) {
this.flagInvite = false;
this.pageNum += 1;
this.queryFrontInProfitAmt();
} else {
this.flagInvite = true;
}
}
},
methods: {
//
async queryFrontInProfitAmt() {
const res = await queryFrontInProfitAmt({
creatorId: this.userInfo.id,
type: this.typeId,
pageSize: this.pageSize,
pageNum: this.pageNum,
});
if (res.data.code === 200) {
if (this.typeId === 0) {
this.inProfitAdList.push(...res.data.rows);
} else {
this.inProfitInviteList.push(...res.data.rows);
}
} else {
uni.showModal({
content: "已入账列表数据加载失败!",
showCancel: false,
});
}
},
//
async queryFrontInProfitAmt() {
const res = await queryFrontInProfitAmt({
creatorId: this.userInfo.id,
type: this.typeId,
pageSize: this.pageSize,
pageNum: this.pageNum
})
if (res.data.code === 200) {
if(this.typeId === 0){
this.inProfitAdList.push(...res.data.rows)
}else{
this.inProfitInviteList.push(...res.data.rows)
}
} else {
uni.showModal({
content: '已入账列表数据加载失败!',
showCancel: false
});
}
},
onClickItem(e) {
let that = this;
that.inProfitAdList = [];
that.inProfitInviteList = [];
if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex;
uni.showLoading({
title: "加载中",
mask: true,
success() {
//
const param = {
creatorId: that.userInfo.id,
type: that.typeId,
pageSize: that.pageSize,
pageNum: 1,
};
queryFrontInProfitAmt(param).then((res) => {
if (res.data.code === 200) {
if (that.typeId === 0) {
that.inProfitAdList.push(...res.data.rows);
} else {
that.inProfitInviteList.push(...res.data.rows);
}
console.log("点击操作inProfitAdList", that.inProfitAdList);
console.log(
"点击操作inProfitInviteList",
that.inProfitInviteList
);
} else {
uni.showModal({
content: "已入账列表数据加载失败!",
showCancel: false,
});
}
});
},
complete() {
uni.hideLoading();
},
});
}
},
onClickItem(e) {
let that = this
that.inProfitAdList = []
that.inProfitInviteList = []
if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex
uni.showLoading({
title: '加载中',
mask: true,
success() {
//
const param = {
creatorId: that.userInfo.id,
type: that.typeId,
pageSize: that.pageSize,
pageNum: 1
}
queryFrontInProfitAmt(param).then(res => {
if (res.data.code === 200) {
if(that.typeId === 0){
that.inProfitAdList.push(...res.data.rows)
}else{
that.inProfitInviteList.push(...res.data.rows)
}
console.log('点击操作inProfitAdList',that.inProfitAdList)
console.log('点击操作inProfitInviteList',that.inProfitInviteList)
} else {
uni.showModal({
content: '已入账列表数据加载失败!',
showCancel: false
});
}
})
},
complete() {
uni.hideLoading();
}
});
}
},
targetToOrder(id) {
console.log('id', id)
if (id) {
uni.navigateTo({
url: '../profit/profitInOrder?id=' + id
})
}
}
}
}
targetToOrder(id) {
console.log("id", id);
if (id) {
uni.navigateTo({
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>
<style lang="scss">
.uni-list-item__icon-img{
.uni-list-item__icon-img {
border-radius: 8px;
}
.ivOver {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background: #fff;
font-size: 20rpx;
}
.ivOver {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background: #fff;
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>

1
pages/profit/profitInOrder.vue

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

443
pages/profit/profitPreDetails.vue

@ -1,179 +1,282 @@
<template>
<view>
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control :current="typeId" :values="items" :style-type="styleType" :active-color="activeColor"
@clickItem="onClickItem" />
</view>
<view class="content">
<view v-if="typeId === 0">
<uni-list border-full v-for="(item,index) in preProfitAdList" :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>
<text class="slot-box slot-text">自定义插槽</text>
</template>
</uni-list-item>
</uni-list>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view>
<view v-if="typeId === 1">
<uni-list border-full v-for="(item,index) in preprofitInviteList" :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+'次'" />
</uni-list>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view>
</view>
</view>
<view>
<view class="uni-padding-wrap uni-common-mt">
<uni-segmented-control
:current="typeId"
:values="items"
:style-type="styleType"
:active-color="activeColor"
@clickItem="onClickItem"
/>
</view>
<view class="content">
<view v-if="typeId === 0">
<uni-list
border-full
v-for="(item, index) in preProfitAdList"
: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>
<view class="ivOver" v-if="flagAd">-----已经到底啦-----</view>
</view>
<view v-if="typeId === 1">
<uni-list
border-full
v-for="(item, index) in preprofitInviteList"
: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>
<view class="ivOver" v-if="flagInvite">-----已经到底啦-----</view>
</view>
</view>
</view>
</template>
<script>
import {
queryFrontPreProfit
} from '@/api/profit.js'
export default {
data() {
return {
preProfitAdList: [],
preprofitInviteList:[],
items: ['广告', '邀请'],
typeId: 0,
activeColor: '#007aff',
styleType: 'text',
userInfo: {},
pageSize: 10,
pageNum: 1,
flagAd: false,
flagInvite: false
}
},
created() {
const userInfoSync = uni.getStorageSync('userInfo')
this.userInfo = userInfoSync
const typeProfitId = uni.getStorageSync('typeId')
this.typeId = typeProfitId
if (typeProfitId) {
this.queryFrontPreProfit()
} else {
this.queryFrontPreProfit()
}
},
//
onPullDownRefresh() {
if(this.typeId === 0){
this.pageNum = 1
this.preProfitAdList = []
this.queryFrontPreProfit()
uni.stopPullDownRefresh()
}else{
this.pageNum = 1
this.preprofitInviteList = []
this.queryFrontPreProfit()
uni.stopPullDownRefresh()
}
},
//
onReachBottom() {
if(this.typeId === 0){
if (this.preProfitAdList.length > this.pageNum*this.pageSize-1 ) {
this.flagAd = false;
this.pageNum += 1
this.queryFrontPreProfit();
}else{
this.flagAd = true;
}
}else{
if (this.preprofitInviteList.length > this.pageNum*this.pageSize-1 ) {
this.flagInvite = false;
this.pageNum += 1
this.queryFrontPreProfit();
}else{
this.flagInvite = true;
}
}
},
methods: {
onClickItem(e) {
let that = this
that.preProfitAdList = []
that.preprofitInviteList = []
if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex
uni.showLoading({
title: '加载中',
mask: true,
success() {
//
const param = {
creatorId: that.userInfo.id,
type: that.typeId,
pageSize: that.pageSize,
pageNum: 1
}
queryFrontPreProfit(param).then(res => {
if (res.data.code === 200) {
if(that.typeId === 0){
that.preProfitAdList.push(...res.data.rows)
}else{
that.preprofitInviteList.push(...res.data.rows)
}
console.log('点击操作preProfitAdList',that.preProfitAdList)
console.log('点击操作preprofitInviteList',that.preprofitInviteList)
} else {
uni.showModal({
content: '即将到账列表数据加载失败!',
showCancel: false
});
}
})
},
complete() {
uni.hideLoading();
}
});
}
},
import { queryFrontPreProfit } from "@/api/profit.js";
export default {
data() {
return {
preProfitAdList: [],
preprofitInviteList: [],
items: ["广告", "邀请"],
typeId: 0,
activeColor: "#007aff",
styleType: "text",
userInfo: {},
pageSize: 10,
pageNum: 1,
flagAd: false,
flagInvite: false,
};
},
created() {
const userInfoSync = uni.getStorageSync("userInfo");
this.userInfo = userInfoSync;
const typeProfitId = uni.getStorageSync("typeId");
this.typeId = typeProfitId;
if (typeProfitId) {
this.queryFrontPreProfit();
} else {
this.queryFrontPreProfit();
}
},
//
onPullDownRefresh() {
if (this.typeId === 0) {
this.pageNum = 1;
this.preProfitAdList = [];
this.queryFrontPreProfit();
uni.stopPullDownRefresh();
} else {
this.pageNum = 1;
this.preprofitInviteList = [];
this.queryFrontPreProfit();
uni.stopPullDownRefresh();
}
},
//
onReachBottom() {
if (this.typeId === 0) {
if (this.preProfitAdList.length > this.pageNum * this.pageSize - 1) {
this.flagAd = false;
this.pageNum += 1;
this.queryFrontPreProfit();
} else {
this.flagAd = true;
}
} else {
if (this.preprofitInviteList.length > this.pageNum * this.pageSize - 1) {
this.flagInvite = false;
this.pageNum += 1;
this.queryFrontPreProfit();
} else {
this.flagInvite = true;
}
}
},
methods: {
onClickItem(e) {
let that = this;
that.preProfitAdList = [];
that.preprofitInviteList = [];
if (that.typeId !== e.currentIndex) {
that.typeId = e.currentIndex;
uni.showLoading({
title: "加载中",
mask: true,
success() {
//
const param = {
creatorId: that.userInfo.id,
type: that.typeId,
pageSize: that.pageSize,
pageNum: 1,
};
queryFrontPreProfit(param).then((res) => {
if (res.data.code === 200) {
if (that.typeId === 0) {
that.preProfitAdList.push(...res.data.rows);
} else {
that.preprofitInviteList.push(...res.data.rows);
}
console.log("点击操作preProfitAdList", that.preProfitAdList);
console.log(
"点击操作preprofitInviteList",
that.preprofitInviteList
);
} else {
uni.showModal({
content: "即将到账列表数据加载失败!",
showCancel: false,
});
}
});
},
complete() {
uni.hideLoading();
},
});
}
},
//
async queryFrontPreProfit() {
const res = await queryFrontPreProfit({
creatorId: this.userInfo.id,
type: this.typeId,
pageSize: this.pageSize,
pageNum: this.pageNum
})
if (res.data.code === 200) {
if(this.typeId === 0){
this.preProfitAdList.push(...res.data.rows)
}else{
this.preprofitInviteList.push(...res.data.rows)
}
} else {
uni.showModal({
content: '即将到账列表数据加载失败!',
showCancel: false
});
}
},
}
}
//
async queryFrontPreProfit() {
const res = await queryFrontPreProfit({
creatorId: this.userInfo.id,
type: this.typeId,
pageSize: this.pageSize,
pageNum: this.pageNum,
});
if (res.data.code === 200) {
if (this.typeId === 0) {
this.preProfitAdList.push(...res.data.rows);
} else {
this.preprofitInviteList.push(...res.data.rows);
}
} else {
uni.showModal({
content: "即将到账列表数据加载失败!",
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>
<style lang="scss">
.uni-list-item__icon-img{
border-radius: 8px;
}
.ivOver{
width: 100%;
height:50px;
line-height: 50px;
text-align: center;
background: #fff;
font-size: 20rpx;
}
.uni-list-item__icon-img {
border-radius: 8px;
}
.ivOver {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center;
background: #fff;
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>

Loading…
Cancel
Save