<template>
	<view class="page">
		<uni-nav-bar rightWidth='136rpx' title="战队奖励" fixed  :border="false" statusBar backgroundColor="#24234B" color="#FFFFFF">
			<template #left>
				<view class="cl-topbar__icon" @click="navigateBack">
					<text class="cl-icon-arrow-left"></text>
				</view>
			</template>
		</uni-nav-bar>
		<view class="topBody">
			<view class="header">
			</view>
			<view class="myinfo">


				<view style="margin-top: 24rpx;" class="numlist">
					<view class="numItem">
						<text>{{myinfo.num_gmb_today}}</text>
						<view class="name">今日获得暗物质</view>
					</view>
					<view class="numItem">
						<text>{{myinfo.num_gmb_all}}</text>
						<view class="name">累计获得暗物质</view>
					</view>
					<view class="numItem">
						<text>{{myinfo.num_gmc}}</text>
						<view class="name">待释放暗物质</view>
					</view>
				</view>


				<view class="friendList">
					<view class="title">
						<view class="left">
							<text style="font-size: 28rpx;color: #FFFFFF;">日期</text>
						</view>
						<view class="right">
							<text style="font-size: 28rpx;color: #FFFFFF;">暗物质</text>
						</view>
					</view>

					<view class="numlist2">
						<view v-if="nodata" class="empty">
							<view class="bg"></view>
							<text style="margin-top: 40rpx;font-size: 24rpx;color: #999999;">暂无数据</text>
						</view>
						<view v-else class="item" v-for="(item, index) in list" :key="index"
							:style="{ backgroundColor: index % 2 === 1 ? '#222644' : '#00000000' }">
							<view class="info">
								<view class="left">
									<view class="nameList">
										<view class="num">
											<view class="data">{{item.name}}</view>
										</view>
									</view>
								</view>
								<view class="right">
									<view class="txt">
										<text>{{item.type}}{{item.num}}</text>
									</view>
								</view>
							</view>

						</view>
					</view>
				</view>
			</view>


			<view class="blankHeight"></view>
		</view>

		<!-- 提示框 -->
		<DialogBox ref="DialogBox"></DialogBox>
	</view>
</template>

<script>
	import uniNavBar from '../../components/uni-ui/uni-nav-bar/uni-nav-bar.vue'
	export default {
		components: {uniNavBar},
		data() {
			return {
				title: '',
				sel: 1,
				nodata: true,
				myinfo: {},
				list: [],
				X_Info: {

					todayGet: 10,
					historyGet: 199999,

				},
				friendsInfo: [{
						value: 100,
						data: "2023-1-12"
					},
					{
						value: 200,
						data: "2023-1-12"
					},
					{
						value: 100,
						data: "2023-1-12"
					},
					{
						value: 100,
						data: "2023-1-12"
					}
				]
			}
		},
		onLoad() {
			// setTimeout(function() {
			// 	uni.setNavigationBarColor({
			// 		frontColor: '#ffffff',
			// 		backgroundColor: '#00000000',
			// 		animation: {
			// 			duration: 400,
			// 			timingFunc: 'easeIn'
			// 		}
			// 	})
			// }, 200);
			this.loadInfo();
			this.loadData();
		},
		onShow() {},
		methods: {
			navigateBack(){
				uni.navigateBack(1)
			},
			onBack() {},
			chkSel() {
				if (this.sel == 1) {
					this.sel = 0;
				} else {
					this.sel = 1;
				}
			},
			loadInfo() {
				console.log({
					uuid: getApp().globalData.uuid,
					skey: getApp().globalData.skey
				});
				uni.request({
					url: this.$apiHost + '/Web/getinfo',
					data: {
						uuid: getApp().globalData.uuid,
						type: 'tuan'
					},
					header: {
						"content-type": "application/json",
						'sign': getApp().globalData.headerSign
					},
					success: (res) => {
						console.log("----:", res.data);
						this.myinfo = res.data;
					},
					complete: (com) => {
						// uni.hideLoading();
					},
					fail: (e) => {
						console.log("----e:", e);
					}
				});
			},
			loadData() {
				console.log({
					uuid: getApp().globalData.uuid,
					skey: getApp().globalData.skey
				});
				uni.request({
					url: this.$apiHost + '/My/recordlist',
					data: {
						uuid: getApp().globalData.uuid,
						type: 'GMB',
						stype: "tuan"
					},
					header: {
						"content-type": "application/json",
						'sign': getApp().globalData.headerSign
					},
					success: (res) => {
						console.log("----:", res.data);
						this.list = res.data.list;
						if (this.list != null && this.list != undefined) {
							this.nodata = false;
						}
					},
					complete: (com) => {
						// uni.hideLoading();
					},
					fail: (e) => {
						console.log("----e:", e);
					}
				});
			},

		}
	}
</script>

<style scoped lang="scss">
	@import 'teamProfit.scss';
</style>