<template>
	<view class="page">

		<view class="list_info">
			<view class="item">
				<view class="avator">
					<image class="icon" src="../../static/me/sex_2.png" mode="widthFix">
					</image>
				</view>
				<view class="tit">
					<view class="name">2023季迪奥限量款背包</view>
					<view class="desc">市场价：¥10,000.00</view>
				</view>
				<view class="jindu">
					<view class="bord">
						<view class="active" style="width:50%;"></view>
					</view>
					<text class="tips">50%</text>
				</view>
				<view class="title">助力好友</view>
				<view class="list_mem">
					<view class="mem" v-for="(item,index) in 12">
						<image class="icon" src="../../static/me/sex_2.png" mode="widthFix" />
						<text>冷桂霞</text>
					</view>
				</view>
				<view class="title">助力记录</view>
				<view class="list_record">
					<view class="record" v-for="(item,index) in 3">
						<view class="left">
							<image class="icon" src="../../static/me/sex_2.png" mode="widthFix" />
							<text>冷桂霞</text>
						</view>
						<text class="right">贡献助力值：+10</text>
					</view>
				</view>
				<!-- <view class="btn_submit">加入心愿</view> -->
			</view>

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

	</view>
</template>

<script>
	export default {
		components: {},
		data() {
			return {
				tab: 1,
				scrollTop: 0,
				old: {
					scrollTop: 0
				},
				list: [{
					name: '实名认证',
					'desc': '',
					'path': ''
				}]
			}
		},
		onLoad() {
			// setTimeout(function() {
			// 	uni.setNavigationBarColor({
			// 		frontColor: '#ffffff',
			// 		backgroundColor: '#00000000',
			// 		animation: {
			// 			duration: 400,
			// 			timingFunc: 'easeIn'
			// 		}
			// 	})
			// }, 200);
		},
		onShow() {
			this.loadData();
		},
		methods: {
			onBack() {},
			checkTab(tab) {
				this.tab = tab;
				// this.loadData();
			},
			scroll: function(e) {
				console.log(e)
				this.old.scrollTop = e.detail.scrollTop
			},
			loadData() {
				console.log("this.globalData", getApp().globalData);
				let obj2 = {
					is_first: 0
				}
				const postData = Object.assign({}, getApp().globalData.postHeader, obj2);

				console.log(postData);

				uni.request({
					url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例，并非真实接口地址。
					data: postData,
					method: 'POST',
					header: {
						'content-type': 'application/json', //自定义请求头信息
						'Access-Control-Allow-Origin': '*'
					},
					success: (res) => {
						console.log('data:', res.data);
						this.myinfo = res.data;
					}
				});



			},
			EditNickname() {
				let that = this;
				this.$refs['DialogBox'].confirm({
					title: '更改昵称',
					placeholder: '请输入修改的昵称',
					value: that.myinfo.nickname,
					DialogType: 'input',
					animation: 0
				}).then((res) => {
					if (res.value.length < 1) {
						uni.showToast({
							title: "请输入有效的昵称",
							icon: 'none'
						});
						return;
					}
					that.myinfo.nickname = res.value;
					let obj2 = {
						nickname: res.value
					}
					const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
					uni.request({
						url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
						data: postData,
						method: 'POST',
						header: {
							'content-type': 'application/json', //自定义请求头信息
							'Access-Control-Allow-Origin': '*'
						},
						success: (res) => {
							uni.showToast({
								title: res.data.str,
								icon: 'none'
							});
						}
					});
				})
			},
		}
	}
</script>

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