<template>
	<view v-if="showUserInfoPop">
		<view class="ceng"></view>
		<view class="update-pop">
			<image src="/static/images/editInfo.png" class="update-img"></image>
			<view class="update-tip">您的资料未完善，是否完善资料以便我们提供更优质的服务。</view>
			<view class="ddflex" style="margin:0 30rpx;">
				<button class="update-btn fflex" @click="closeUpdate">取消</button>
				<button class="update-btn fflex" style="margin-left: 30rpx !important;" @click="jumpUrl('/mine/userinfo/userinfo')">去完善</button>
			</view>
			<!-- <image :src="picUrlss+'update_close.png'" class="update-close" @click="closeUpdate"></image> -->
		</view>
	</view>
</template>

<script>
	const app = getApp();
	const req = require("../../utils/request.js");

	export default {
		data() {
			return {
				picUrlss: req.public.picUrls,
				showUserInfoPop:false
			};
		},

		components: {},
		props: {
		},
		watch: {},

		mounted() {
			this.getInfo()
		},

		methods: {
			jumpUrl(url){
				uni.navigateTo({
					url:url
				})
				this.closeUpdate()
			},
			getInfo() {
				let that = this;
				req.getRequest('/api/user/myInfo', {}, data => {
					
					if( data.saleNo) return this.showUserInfoPop = false;
					
					if( !data.avatar) return this.showUserInfoPop = true;
					if( !data.nickName) return this.showUserInfoPop = true;
					// if( !data.realName) return this.showUserInfoPop = true;
					// if( !data.cardNo) return this.showUserInfoPop = true;
					if( !data.mobile) return this.showUserInfoPop = true;
					// if( !data.birthday) return this.showUserInfoPop = true;
					// if (!data.district) return this.showUserInfoPop = true;
					// if (!data.areaAdd) return this.showUserInfoPop = true;
				});
			},
			closeUpdate(){
				this.showUserInfoPop = false;
				this.$emit('closeUpdate',true)
			},
		}
	};
</script>

<style>
	@import "./index.css";
</style>