分佣:promoter-order 迁移

pull/1/MERGE
YunaiV 2023-09-04 22:47:41 +08:00
parent c8db068547
commit 17ae7587cb
1 changed files with 42 additions and 89 deletions

View File

@ -10,30 +10,20 @@
<view class='iconfont icon-2'></view> <view class='iconfont icon-2'></view>
</view> </view>
</view> </view>
<view class='list pad30' v-if="recordList.length>0"> <view class='list' v-if="recordList.length>0">
<block v-for="(item,index) in recordList" :key="index"> <block v-for="(item, index) in recordList" :key="index">
<view class='item'> <view class='item'>
<view class='title acea-row row-column row-center'>
<view class='data'>{{item.time}}</view>
<view>本月累计推广订单{{item.count || 0}}</view>
</view>
<view class='listn'> <view class='listn'>
<block v-for="(child,indexn) in item.child" :key="indexn"> <block :key="index">
<view class='itenm borRadius14'> <view class='itenm borRadius14'>
<view class='top acea-row row-between-wrapper'> <view class='top acea-row row-between-wrapper'>
<view class='pictxt acea-row row-between-wrapper'> <view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'> <view class='text line1'>{{item.title}}</view>
<image :src='child.avatar'></image>
</view>
<view class='text line1'>{{child.nickname}}</view>
</view> </view>
<view class='money'>返佣<text class='font-color'>{{child.number}}</text></view> <view class='money'>返佣<text class='font-color'>{{ fen2yuan(item.price) }}</text></view>
<!-- <view class='money' v-if="child.type == 'brokerage'"><text class='font-color'>{{child.number}}</text></view>
<view class='money' v-else><text class='font-color'>{{child.number}}</text></view> -->
</view> </view>
<view class='bottom'> <view class='bottom'>
<view><text class='name'>订单编号</text>{{child.orderId}}</view> <view><text class='name'>生效时间</text>{{ formatDate(item.finishTime) }}</view>
<view><text class='name'>下单时间</text>{{child.time}}</view>
</view> </view>
</view> </view>
</block> </block>
@ -41,37 +31,23 @@
</view> </view>
</block> </block>
</view> </view>
<view v-if="recordList.length == 0"> <view v-if="recordList.length === 0">
<emptyPage title="暂无推广订单~"></emptyPage> <emptyPage title="暂无推广订单~"></emptyPage>
</view> </view>
</view> </view>
<!-- #ifdef MP -->
<!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
<!-- #endif -->
<home></home> <home></home>
</view> </view>
</template> </template>
<script> <script>
import { import { toLogin } from '@/libs/login.js';
spreadOrder import { mapGetters } from "vuex";
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
// #ifdef MP
import authorize from '@/components/Authorize';
// #endif
import emptyPage from '@/components/emptyPage.vue' import emptyPage from '@/components/emptyPage.vue'
import home from '@/components/home'; import home from '@/components/home';
export default { import * as BrokerageAPI from '@/api/member/brokerage.js'
import * as Util from '@/utils/util.js';
import dayjs from "@/plugin/dayjs/dayjs.min.js";
export default {
components: { components: {
// #ifdef MP
authorize,
// #endif
emptyPage, emptyPage,
home home
}, },
@ -82,68 +58,45 @@
status: false, status: false,
recordList: [], recordList: [],
recordCount: 0, recordCount: 0,
isAuto: false, //
isShowAuth: false,//
time: 0
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
onLoad() { onLoad() {
if (this.isLogin) { if (!this.isLogin) {
this.getRecordOrderList(); toLogin();
} else { return;
toLogin();
} }
}, this.getRecordOrderList();
},
methods: { methods: {
stringToDate : function(data){
let str = data.replace(/-/g,'/');
let date = new Date(str);
return data;
},
onLoadFun() {
this.getRecordOrderList();
},
//
authColse: function(e) {
this.isShowAuth = e
},
getRecordOrderList: function() { getRecordOrderList: function() {
let that = this; if (this.status) {
let page = that.page; return;
let limit = that.limit; }
let status = that.status; const page = this.page;
let recordList = that.recordList; const limit = this.limit;
let newList = []; const recordList = this.recordList;
if (status == true) return; BrokerageAPI.getBrokerageRecordPage({
spreadOrder({ pageNo: page,
page: page, pageSize: limit,
limit: limit bizType: 1, //
status: 1, //
}).then(res => { }).then(res => {
let recordListData = res.data.list ? res.data.list : []; let recordListData = res.data.list ? res.data.list : [];
// const len = res.data.list ? res.data.list.length : 0;
let len = 0; const recordListNew = recordList.concat(recordListData);
for(let i = 0;i<recordListData.length;i++) { this.recordCount = res.data.total || 0;
len = len + recordListData[i].child.length; this.status = limit > len;
let str = recordListData[i].time.replace(/-/g,'/'); this.page = page + 1;
let date = new Date(str).getTime(); this.$set(this, 'recordList', recordListNew);
if(that.time === date){
that.$set(that.recordList[i],'child',that.recordList[i].child.concat(recordListData[i].child));
}else{
recordListData.forEach((item,index)=>{
if(recordListData[i]==item){
newList.push(item);
}
})
that.$set(that, 'recordList', recordList.concat(newList));
}
that.time = date;
};
that.recordCount = res.data.count || 0;
that.status = limit > len;
that.page = page + 1;
}); });
} },
fen2yuan(price) {
return Util.fen2yuan(price)
},
formatDate: function(date) {
return dayjs(date).format("YYYY-MM-DD HH:mm:ss");
},
}, },
onReachBottom() { onReachBottom() {
this.getRecordOrderList() this.getRecordOrderList()