<template>
	<view>
		<view class="set-item ddflex" v-if="userInfo.manageSaleNo" @click="jumpUrl('/card/cardDetail/cardDetail?noBind=true&id='+recommendCard.id)">
			我的保险顾问
			<view class="ddflex set-info">
				<view>{{recommendCard.realName}}</view>
				<image src="../../static/pages/images/more.png"></image>
			</view>
		</view>
		<view class="set-item ddflex" @click="jumpUrl('/mine/userinfo/userinfo')">
			个人资料
			<view class="ddflex set-info">
				<image src="../../static/pages/images/more.png"></image>
			</view>
		</view>
	</view>
</template>

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

	export default {
		components: {},
		props: {},
		data() {
			return {
				userInfo:'',
				recommendCard:''
			}
		},
		onLoad(options) {
			
		},
		onShow() {
			this.userInfo = req.getStorage('userInfo')
			if(this.userInfo.manageSaleNo){
				this.getRecommendCard()
			}
		},
		methods: {
			jumpUrl(url){
				uni.navigateTo({
					url:url
				})
			},
			// 获取推荐销售
			getRecommendCard(){
				if(this.userInfo.manageSaleNo){
					req.getRequest('/api/visiting/card/recommendCardInfo',{},res=>{
						this.recommendCard = res
					})
				}
			},
		},
		mounted() {
			
		},
	}
</script>

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