<template>
	<view class="page">
		<view class="topBody">
			<view class="header">
			</view>
			<view class="myinfo">
				<view class="line"></view>

				<view style="margin-top: 20rpx;" class="imgList">

					<image style="height: 160rpx;" src="../../static/w3/invite_txt.png" mode="heightFix" />
					<image style="height: 160rpx;" src="../../static/w3/goldenCoin.png" mode="heightFix" />
				</view>

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



				<view style="margin-top: 36rpx;" class="inviteTitle" @click="goPage('/pages/w3/teamProfit')">
					<view class="left">
						<text style="font-size: 28rpx;color: #FFFFFF;">邀请战队奖励</text>
					</view>
					<view class="right">
						<text style="font-size: 18rpx;color: #999999;">邀请战队成员开启探索卡可获得暗物质奖励</text>
						<image class="icon" src="../../static/me/arrow_right.png" mode="heightFix" />
					</view>
				</view>

				<view class="friendList">
					<view class="title" @click="goPage('/pages/w3/friendsList')">
						<view class="left">
							<text style="font-size: 36rpx;color: #FFFFFF;">我的战队</text>
						</view>
						<view class="right">
							<text style="font-size: 28rpx;color: #FFFFFF;">更多</text>
							<image class="icon" src="../../static/me/arrow_right.png" mode="heightFix" />
						</view>
					</view>

					<view class="numlist2">
						<view v-if="nodata" class="empty">
							<view class="bg"></view>
							<text style="margin-top: 0rpx;font-size: 24rpx;color: #999999;">暂无数据</text>
						</view>
						<view class="item" v-for="(item, index) in zt_list" :key="index" v-if="index < 4">
							<view class="info">
								<view class="left">
									<image class="img" src="../../static/w3/w3_1.png" mode="heightFix" />
									<view class="nameList">
										<view class="num">
											<view class="name">
												<text>{{ item.nickname }}</text>
												<image v-if="item.is_vip===2" class="icon"
													src="../../static/w3/w3_black_vip.png" mode="heightFix" />
												<image v-else-if="item.is_vip===1" class="icon"
													src="../../static/w3/w3_vip.png" mode="heightFix" />
											</view>
											<view class="data">{{item.login_time}}</view>
										</view>
									</view>
								</view>
								<view class="right">
									<view class="txt">
										<text v-if="item.is_idcheck == 2">已实名</text>
										<text v-else>未实名</text>
									</view>
									<view class="txt txt1">
										<text>{{item.mobile}}</text>
									</view>
								</view>
							</view>
							<view class="line">

							</view>
						</view>
					</view>
					<image style="height: 42rpx; width: 690rpx;margin-top: 0rpx;"
						src="../../static/w3/invite_bg_bottom.png"></image>

				</view>


				<view class="btn_submit" @click="goPage('/pages/w3/share_img')">
					<image class="icon" src="../../static/w3/blackarrow.png" mode="heightFix" />
					<text>邀请战队成员</text>
				</view>
			</view>


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

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

<script>
	export default {
		components: {},
		data() {
			return {
				myinfo: {},
				sel: 1,
				nodata: true,
				zt_list: [],
				X_Info: {

					todayGet: 10,
					historyGet: 199999,

				},
				friendsInfo: [{
					reason: "txt.M币充值",
					p_name: "陈东大",
					vip: 1,
					value: 100,
					phoneNum: "133*****212",
					data: "2023-1-12 15:00"
				}]
			}
		},
		onLoad() {
			// setTimeout(function() {
			// 	uni.setNavigationBarColor({
			// 		frontColor: '#ffffff',
			// 		backgroundColor: '#00000000',
			// 		animation: {
			// 			duration: 400,
			// 			timingFunc: 'easeIn'
			// 		}
			// 	})
			// }, 200);
		},
		onShow() {
			this.loadInfo();
			this.loadZtList();
		},
		methods: {
			onBack() {},
			chkSel() {
				if (this.sel == 1) {
					this.sel = 0;
				} else {
					this.sel = 1;
				}
			},
			goPage(page) {
				uni.navigateTo({
					url: page,
				})
			},
			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", //自定义请求头信息
					},
					success: (res) => {
						console.log("----:", res.data);
						this.myinfo = res.data;
					},
					complete: (com) => {
						// uni.hideLoading();
					},
					fail: (e) => {
						console.log("----e:", e);
					}
				});
			},

			loadZtList() {
				console.log({
					uuid: getApp().globalData.uuid,
					skey: getApp().globalData.skey
				});
				uni.request({
					url: this.$apiHost + '/Xweb/ztlist',
					data: {
						uuid: getApp().globalData.uuid
					},
					header: {
						"content-type": "application/json", //自定义请求头信息
					},
					success: (res) => {
						console.log("----:", res.data);
						this.zt_list = res.data.list;
						if (res.data.list != null && res.data.list != undefined) {
							this.nodata = false;
						}
					},
					complete: (com) => {
						// uni.hideLoading();
					},
					fail: (e) => {
						console.log("----e:", e);
					}
				});
			},
		}
	}
</script>

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