<!-- 我的-分享赚钱详情 -->

<template>
	<view>
		<view class="loading_text" v-if="loading">加载中...</view>
		<view v-else>
			<view :key="index" v-for="(item,index) in data" class="item">
				<view style="color: #1e2130;font-size: 32upx;">
					<navigator :url="'../order/detail?id='+item.btr_id">{{item.btr_title}}</navigator>
				</view>
				<view>订单编号：{{item.tdwk_sn}}</view>
				<view class="" style="display: flex;align-items: center;">
					<view class="" style="width: 100upx;">
						<image style="width: 100upx;height: 100upx;border-radius: 50%;" :src="item.profile_photo||'../../static/user.png'"></image>
					</view>
					<view class="">
						{{item.true_name}}
					</view>
				</view>
				<view>佣金：<text style="color: #f9663b;font-weight: bold;">{{item.money_total}}元</text></view>
				<view>订单时间：{{item.bwa_createtime}}</view>
			</view>
		</view>
		<view class="loading_text" v-if="data.length==0&&!loading">暂无数据</view>
	</view>
</template>

<script>
	import commonData from '../../commonData.js'
	import commonFun from '../../commonFun.js'

	export default {
		data() {
			return {
				data: [],
				id: '',
			}
		},
		methods: {
			// 获取数据
			get_data() {
				this.loading = true
				uni.showLoading({
					title: '加载中...',
					mask: true
				})
				let params = {
					bizCatalog: 'WorkerEntity',
					handleMode: 'fetchallShareWorkers',
					pageIndex: 1,
					pageSize: 1000,
					orderby: 0,
					query: {
						recruitid: this.id,
					}
				}
				console.log('我的分销详情列表请求参数')
				console.log(params)
				commonFun.requestUrl('&WsAjaxBiz=Worker&WsAjaxAction=fetchPageData', params, res => {
					if (res.status) {
						this.data = res.data.Result.pageData
						console.log('我的分销详情列表数据')
						console.log(this.data)
					}
					this.loading = false
					uni.hideLoading()
					uni.stopPullDownRefresh()
				})
			},
			onPullDownRefresh() {
				this.get_data()
			},
		},
		components: {},
		onLoad(e) {
			this.id = e.id
			this.get_data()
		},
	};
</script>

<style>
	.item {
		border-bottom: 2upx solid #dedede;
		padding: 20upx 0;
	}

	.item view {
		color: #999999;
		width: 92%;
		margin-left: 4%;
		line-height: 45upx;
		padding: 6upx 0;
	}
</style>
