<script setup>
	import {
		ref
	} from 'vue';
	import {
		onLoad,
		onReady,
		onHide,
	} from '@dcloudio/uni-app'
	import intergralApi from '@/api/intergral.js';
	import util from '@/common/js/util.js'
	/**
	 * 受邀成功
	 */
	const user = ref({
		header:"",
		userId:"",
		userNickname:""
	})
	onLoad(options => {
		if(options!==null){
			user.value=options
			user.value.header = util.format_url(user.value.header, 'img')
		}
	})
	
	function nickname(hide) {
		intergralApi.nickname({
			query: {
				hide: hide,
			}
		}).then(rs => {
			util.alert({
				content: rs.msg,
				showCancel: false,
			})
			uni.navigateBack({
				delta: 1
			});
		})
	}
	
	
	  
</script>

<template>
	<view class="appbw tac">
		<!--  -->
		<view class="avatar mauto">
			<image class="cir" :src="user.header" mode="aspectFill" />
		</view>

		<view class="name mt20 tac c000 f32">{{user.userNickname}}</view>

		<view class="title mt90 tac c000 f36 b">受邀成功，选择是否隐藏个人账号昵称</view>

		<view class="btns fmid mt60 mlr30">
			<view class="button btn lg cancel f1" @click="nickname(1)">隐藏</view>
			<view class="button btn lg colourful f1 ml40" @click="nickname(0)">公开</view>
		</view>
	</view>
</template>

<style lang="scss">
	// 
	.avatar {
		width: 365rpx;
		height: 365rpx;
		margin-top: 100rpx;
	}
</style>