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

<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>
					<view style="color: #1e2130;font-size: 32upx;">
						<navigator style="width: 500upx;" class="nowrap" :url="'../order/detail?id='+item.id">
							{{item.title}}
						</navigator>
					</view>
					<view>总佣金：<text style="color: #f9663b;font-weight: bold;">{{item.money_total}}元</text></view>
				</view>
				<view>
					<navigator class="btn_share" :url="'./makeMoneyDetail?id='+item.id">查看详情</navigator>
				</view>
			</view>
		</view>
		<view style="line-height: 35upx;margin-top: 10upx;text-align: left;width: 90%;margin-left: 5%;"
			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: [],
				loading:true,
			}
		},
		methods: {
			// 获取数据
			get_data() {
				this.loading = true
				uni.showLoading({
					title: '加载中...',
					mask: true
				})
				let params = {
					bizCatalog: 'WorkerEntity',
					handleMode: 'fetchallShareWorks',
					pageIndex: 1,
					pageSize: 1000,
					orderby: 0,
					query: {
						recuritTitle: '',
					}
				}
				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() {
			this.get_data()
		},
	};
</script>

<style>
	.btn_share {
		background-color: #00c7b2;
		color: #ffffff;
		padding: 10upx 14upx;
		width: 110upx;
		text-align: center;
		margin-top: 15upx;
	}

	.item {
		border-bottom: 2upx solid #dedede;
		padding: 20upx 0 30upx;
		width: 92%;
		margin-left: 4%;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.item view {
		color: #999999;
		line-height: 45upx;
		padding: 6upx 0;
	}
</style>
