You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
362 lines
8.9 KiB
362 lines
8.9 KiB
|
4 years ago
|
<template>
|
||
|
4 years ago
|
<view>
|
||
|
3 years ago
|
<view class="status-choice-comp">
|
||
|
|
<view class="status-item uni-secondary-color" v-for="(val, i) in items"
|
||
|
|
:index="i" :key="i"
|
||
|
|
:class="typeId === i ? 'status-active' : ''"
|
||
|
|
@click="onClickItem({currentIndex: i})"
|
||
|
|
>
|
||
|
|
<view class="status-text">{{val}}</view>
|
||
|
|
</view>
|
||
|
4 years ago
|
</view>
|
||
|
|
<view class="content">
|
||
|
3 years ago
|
<uni-list v-if="typeId === 0"
|
||
|
|
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)"
|
||
|
4 years ago
|
>
|
||
|
3 years ago
|
<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 :class="item.confirmStatus != 0 ? 'primary-color' : ''">
|
||
|
|
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
|
||
|
4 years ago
|
</view>
|
||
|
|
</view>
|
||
|
3 years ago
|
</view>
|
||
|
|
</template>
|
||
|
|
</uni-list-item>
|
||
|
|
</uni-list>
|
||
|
|
<uni-list v-if="typeId === 1"
|
||
|
|
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)"
|
||
|
4 years ago
|
>
|
||
|
3 years ago
|
<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 :class="item.confirmStatus != 0 ? 'primary-color' : ''">
|
||
|
|
{{ item.confirmStatus == 0 ? "待确认" : "已确认" }}
|
||
|
4 years ago
|
</view>
|
||
|
|
</view>
|
||
|
3 years ago
|
</view>
|
||
|
|
</template>
|
||
|
|
</uni-list-item>
|
||
|
|
</uni-list>
|
||
|
3 years ago
|
<!-- 显示加载中或者全部加载完成 -->
|
||
|
|
<view>
|
||
|
|
<uni-load-more :status="loadStatus"></uni-load-more>
|
||
|
|
</view>
|
||
|
4 years ago
|
</view>
|
||
|
|
</view>
|
||
|
4 years ago
|
</template>
|
||
|
|
|
||
|
|
<script>
|
||
|
4 years ago
|
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,
|
||
|
3 years ago
|
loadStatus:'noMore', //加载样式:more - 加载前样式,loading - 加载中样式,noMore - 没有数据样式
|
||
|
|
isLoadMore:false, //是否加载中
|
||
|
4 years ago
|
};
|
||
|
|
},
|
||
|
|
created() {
|
||
|
3 years ago
|
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')
|
||
|
|
}
|
||
|
4 years ago
|
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();
|
||
|
|
}
|
||
|
|
},
|
||
|
|
// 上划加载更多
|
||
|
3 years ago
|
onReachBottom() {//上拉触底函数
|
||
|
|
if(!this.isLoadMore) { //此处判断,上锁,防止重复请求
|
||
|
|
this.isLoadMore=true
|
||
|
|
if (this.loadStatus === "more") {
|
||
|
|
this.pageNum += 1 //每次上拉请求新的一页
|
||
|
4 years ago
|
this.queryFrontInProfitAmt();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
},
|
||
|
|
methods: {
|
||
|
|
// 查询指定艺术家已入账收益列表
|
||
|
|
async queryFrontInProfitAmt() {
|
||
|
3 years ago
|
let that = this;
|
||
|
|
that.loadStatus = 'loading';
|
||
|
4 years ago
|
const res = await queryFrontInProfitAmt({
|
||
|
3 years ago
|
creatorId: that.userInfo.id,
|
||
|
|
type: that.typeId,
|
||
|
|
pageSize: that.pageSize,
|
||
|
|
pageNum: that.pageNum,
|
||
|
4 years ago
|
});
|
||
|
|
if (res.data.code === 200) {
|
||
|
3 years ago
|
uni.hideLoading();
|
||
|
3 years ago
|
if (that.typeId === 0) {
|
||
|
|
that.inProfitAdList.push(...res.data.rows);
|
||
|
4 years ago
|
} else {
|
||
|
3 years ago
|
that.inProfitInviteList.push(...res.data.rows);
|
||
|
4 years ago
|
}
|
||
|
3 years ago
|
if(res.data.rows.length < that.pageSize){ //判断接口返回数据量小于请求数据量,则表示此为最后一页
|
||
|
|
that.isLoadMore = true
|
||
|
|
that.loadStatus = 'noMore'
|
||
|
|
}else{
|
||
|
|
this.loadStatus = 'more';
|
||
|
|
that.isLoadMore = false
|
||
|
|
}
|
||
|
4 years ago
|
} else {
|
||
|
|
uni.showModal({
|
||
|
|
content: "已入账列表数据加载失败!",
|
||
|
|
showCancel: false,
|
||
|
|
});
|
||
|
3 years ago
|
that.isLoadMore = false
|
||
|
|
if(that.page > 1){
|
||
|
|
that.page -= 1
|
||
|
|
}
|
||
|
4 years ago
|
}
|
||
|
|
},
|
||
|
4 years ago
|
|
||
|
4 years ago
|
onClickItem(e) {
|
||
|
|
let that = this;
|
||
|
|
that.inProfitAdList = [];
|
||
|
|
that.inProfitInviteList = [];
|
||
|
3 years ago
|
that.pageNum = 1;
|
||
|
|
that.loadStatus = 'loading';
|
||
|
|
that.isLoadMore = false;
|
||
|
4 years ago
|
if (that.typeId !== e.currentIndex) {
|
||
|
|
that.typeId = e.currentIndex;
|
||
|
|
uni.showLoading({
|
||
|
|
title: "加载中",
|
||
|
|
mask: true,
|
||
|
|
success() {
|
||
|
|
// 查询指定艺术家已入账收益列表
|
||
|
3 years ago
|
that.queryFrontInProfitAmt();
|
||
|
4 years ago
|
},
|
||
|
|
complete() {
|
||
|
|
uni.hideLoading();
|
||
|
|
},
|
||
|
|
});
|
||
|
|
}
|
||
|
|
},
|
||
|
4 years ago
|
|
||
|
4 years ago
|
targetToOrder(id) {
|
||
|
|
console.log("id", id);
|
||
|
|
if (id) {
|
||
|
|
uni.navigateTo({
|
||
|
3 years ago
|
url: "/pages-profit/profit/profitInOrder?id=" + id,
|
||
|
4 years ago
|
});
|
||
|
|
}
|
||
|
|
},
|
||
|
|
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") {
|
||
|
4 years ago
|
return "节点壁纸";
|
||
|
4 years ago
|
}
|
||
|
|
},
|
||
|
|
setType(data) {
|
||
|
|
if (data == "0") {
|
||
|
|
return "广告浏览";
|
||
|
|
} else if (data == "1") {
|
||
|
|
return "邀请";
|
||
|
|
} else if (data == "2") {
|
||
|
|
return "会员";
|
||
|
|
}
|
||
|
|
},
|
||
|
|
},
|
||
|
|
};
|
||
|
4 years ago
|
</script>
|
||
|
|
|
||
|
4 years ago
|
<style lang="scss">
|
||
|
3 years ago
|
page {
|
||
|
|
height: 100vh;
|
||
|
|
background-color: $uni-bg-color;
|
||
|
|
}
|
||
|
|
</style>
|
||
|
|
<style lang="scss" scoped>
|
||
|
|
|
||
|
|
.status-choice-comp {
|
||
|
|
width: 450rpx;
|
||
|
3 years ago
|
position: fixed;
|
||
|
3 years ago
|
top: 0;
|
||
|
3 years ago
|
left: 0;
|
||
|
|
background: $uni-bg-base-color;
|
||
|
3 years ago
|
display: flex;
|
||
|
|
justify-content: space-between;
|
||
|
|
padding: 0 150rpx;
|
||
|
3 years ago
|
border-bottom: 10rpx solid $uni-bg-color;
|
||
|
|
z-index: 100;
|
||
|
3 years ago
|
|
||
|
|
.status-item {
|
||
|
|
font-size: 28rpx;
|
||
|
|
line-height: 68rpx;
|
||
|
|
height: 68rpx;
|
||
|
|
padding: 0 20rpx;
|
||
|
|
border-radius: 10rpx;
|
||
|
|
|
||
|
|
.status-text {
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
.status-active {
|
||
|
|
background: #0a6375;
|
||
|
|
color: #FFFFFF !important;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
.content {
|
||
|
|
padding-top: 88rpx;
|
||
|
3 years ago
|
width: 670rpx;
|
||
|
|
margin: 0 auto;
|
||
|
3 years ago
|
|
||
|
3 years ago
|
::v-deep .uni-list {
|
||
|
|
background: $uni-bg-base-color !important;
|
||
|
|
margin-bottom: 20rpx;
|
||
|
|
border-radius: 24rpx;
|
||
|
|
overflow: hidden;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .uni-list-item {
|
||
|
|
background: $uni-bg-base-color !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .uni-list--border-top {
|
||
|
|
display: none !important;
|
||
|
|
}
|
||
|
|
::v-deep .uni-list--border-bottom {
|
||
|
|
display: none !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .uni-list-item__container {
|
||
|
|
padding: 20rpx !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .uni-list-item__content-title {
|
||
|
|
color: $uni-white !important;
|
||
|
|
}
|
||
|
|
|
||
|
|
::v-deep .uni-list-item__content-note {
|
||
|
|
color: $uni-secondary-color !important;
|
||
|
|
}
|
||
|
3 years ago
|
}
|
||
|
3 years ago
|
|
||
|
4 years ago
|
.box {
|
||
|
|
display: flex;
|
||
|
3 years ago
|
padding-right: 16rpx;
|
||
|
4 years ago
|
flex: 1;
|
||
|
3 years ago
|
color: $uni-secondary-color;
|
||
|
4 years ago
|
flex-direction: column;
|
||
|
|
justify-content: center;
|
||
|
|
overflow: hidden;
|
||
|
3 years ago
|
|
||
|
|
.primary-color {
|
||
|
|
color: $uni-primary;
|
||
|
|
}
|
||
|
4 years ago
|
}
|
||
|
|
.box-bot {
|
||
|
|
display: flex;
|
||
|
3 years ago
|
margin-top: 10rpx;
|
||
|
4 years ago
|
}
|
||
|
|
.box-bot view {
|
||
|
3 years ago
|
border-radius: 6rpx;
|
||
|
|
color: $uni-secondary-color;
|
||
|
|
border: 2rpx solid $uni-primary;
|
||
|
|
padding: 4rpx 10rpx;
|
||
|
|
margin-right: 10rpx;
|
||
|
|
font-size: 24rpx;
|
||
|
4 years ago
|
}
|
||
|
3 years ago
|
|
||
|
4 years ago
|
</style>
|