mall-uniapp/pages/users/promoter-order/index.vue

173 lines
4.2 KiB
Vue
Raw Normal View History

2020-08-13 08:12:57 +00:00
<template>
<view>
<view class="promoter-order">
<view class='promoterHeader bg-color'>
<view class='headerCon acea-row row-between-wrapper'>
<view>
<view class='name'>累积推广订单</view>
<view><text class='num'>{{recordCount || 0}}</text></view>
</view>
<view class='iconfont icon-2'></view>
</view>
</view>
2023-09-04 14:47:41 +00:00
<view class='list' v-if="recordList.length>0">
<block v-for="(item, index) in recordList" :key="index">
2020-08-13 08:12:57 +00:00
<view class='item'>
<view class='listn'>
2023-09-04 14:47:41 +00:00
<block :key="index">
<view class='itenm borRadius14'>
2020-08-13 08:12:57 +00:00
<view class='top acea-row row-between-wrapper'>
<view class='pictxt acea-row row-between-wrapper'>
2023-09-04 14:47:41 +00:00
<view class='text line1'>{{item.title}}</view>
2020-08-13 08:12:57 +00:00
</view>
2023-09-04 14:47:41 +00:00
<view class='money'>返佣<text class='font-color'>{{ fen2yuan(item.price) }}</text></view>
2020-08-13 08:12:57 +00:00
</view>
<view class='bottom'>
2023-09-04 14:47:41 +00:00
<view><text class='name'>生效时间</text>{{ formatDate(item.finishTime) }}</view>
2020-08-13 08:12:57 +00:00
</view>
</view>
</block>
</view>
</view>
</block>
</view>
2023-09-04 14:47:41 +00:00
<view v-if="recordList.length === 0">
2020-08-13 08:12:57 +00:00
<emptyPage title="暂无推广订单~"></emptyPage>
</view>
</view>
<home></home>
</view>
</template>
<script>
2023-09-04 14:47:41 +00:00
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
2020-08-13 08:12:57 +00:00
import emptyPage from '@/components/emptyPage.vue'
import home from '@/components/home';
2023-09-05 13:36:10 +00:00
import * as BrokerageAPI from '@/api/trade/brokerage.js'
2023-09-04 14:47:41 +00:00
import * as Util from '@/utils/util.js';
import dayjs from "@/plugin/dayjs/dayjs.min.js";
export default {
2020-08-13 08:12:57 +00:00
components: {
emptyPage,
home
},
data() {
return {
page: 1,
limit: 10,
status: false,
recordList: [],
recordCount: 0,
};
},
computed: mapGetters(['isLogin']),
onLoad() {
2023-09-04 14:47:41 +00:00
if (!this.isLogin) {
toLogin();
return;
2020-08-13 08:12:57 +00:00
}
2023-09-04 14:47:41 +00:00
this.getRecordOrderList();
},
2020-08-13 08:12:57 +00:00
methods: {
getRecordOrderList: function() {
2023-09-04 14:47:41 +00:00
if (this.status) {
return;
}
const page = this.page;
const limit = this.limit;
const recordList = this.recordList;
BrokerageAPI.getBrokerageRecordPage({
pageNo: page,
pageSize: limit,
bizType: 1, // 订单
status: 1, // 已结算
2020-08-13 08:12:57 +00:00
}).then(res => {
let recordListData = res.data.list ? res.data.list : [];
2023-09-04 14:47:41 +00:00
const len = res.data.list ? res.data.list.length : 0;
const recordListNew = recordList.concat(recordListData);
this.recordCount = res.data.total || 0;
this.status = limit > len;
this.page = page + 1;
this.$set(this, 'recordList', recordListNew);
2020-08-13 08:12:57 +00:00
});
2023-09-04 14:47:41 +00:00
},
fen2yuan(price) {
return Util.fen2yuan(price)
},
formatDate: function(date) {
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
},
2020-08-13 08:12:57 +00:00
},
onReachBottom() {
this.getRecordOrderList()
}
}
</script>
<style scoped lang="scss">
.promoter-order .list .item .title {
height: 133rpx;
font-size: 26rpx;
color: #999;
}
.promoter-order .list .item .title .data {
font-size: 28rpx;
color: #282828;
margin-bottom: 5rpx;
}
.promoter-order .list .item .listn .itenm {
background-color: #fff;
}
.promoter-order .list .item .listn .itenm~.itenm {
margin-top: 20rpx;
2020-08-13 08:12:57 +00:00
}
.promoter-order .list .item .listn .itenm .top {
padding: 0 24rpx;
2020-08-13 08:12:57 +00:00
border-bottom: 1rpx solid #eee;
height: 100rpx;
}
.promoter-order .list .item .listn .itenm .top .pictxt {
width: 320rpx;
}
.promoter-order .list .item .listn .itenm .top .pictxt .text {
width: 230rpx;
font-size: 30rpx;
color: #282828;
}
.promoter-order .list .item .listn .itenm .top .pictxt .pictrue {
width: 66rpx;
height: 66rpx;
}
.promoter-order .list .item .listn .itenm .top .pictxt .pictrue image {
width: 100%;
height: 100%;
border-radius: 50%;
border: 3rpx solid #fff;
box-sizing: border-box;
box-shadow: 0 0 15rpx #aaa;
}
.promoter-order .list .item .listn .itenm .top .money {
font-size: 28rpx;
}
.promoter-order .list .item .listn .itenm .bottom {
padding: 20rpx 24rpx;
2020-08-13 08:12:57 +00:00
font-size: 28rpx;
color: #666;
line-height: 1.6;
}
.promoter-order .list .item .listn .itenm .bottom .name {
color: #999;
}
</style>