<template>
	<view class="">
		<view class="profile_fun">
			<view class="profile_item" @click="setPeopleDataClick">
				<view class="itemleft">
					<view class="lxs_font">修改个人信息</view>
				</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
			<view class="profile_item" @click="toEditPassword">
				<view class="itemleft">
					<view class="lxs_font">修改密码</view>
				</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
			<!-- #ifdef MP-WEIXIN || H5 -->
			<view class="profile_item" @click="toBindAccount">
				<view class="itemleft">
					<view class="lxs_font">第三方账号绑定</view>
				</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
			<!-- #endif -->
			<view class="profile_item" @click="toIdea">
				<view class="itemleft">
					<view class="lxs_font">意见反馈</view>
				</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
			
			<view class="profile_item" @click="toOut">
				<view class="itemleft">
					<view class="lxs_font">退出登录</view>
				</view>
				<view class="iconfont icon-arrows_right"></view>
			</view>
		</view>
	</view>	
</template>

<script>
	import { BASE_IMG_URL } from '@/util/api.js'
	import { netOutLogin } from '@/api/login'
	
	
	export default{
		data(){
			return{
				BASE_IMG_URL:BASE_IMG_URL
			}
		},
		methods:{
			// 个人资料
			setPeopleDataClick() {
				uni.navigateTo({
					url:'/pagesA/profile/mySet/setPersonData/setPersonData'
				})
			},
			// 意见反馈
			toIdea() {
				uni.navigateTo({
					url: '/pagesA/profile/feedback/feedback'
				})
			},
			//第三方账号绑定
			toBindAccount() {
				uni.navigateTo({
					url:'/pagesA/user/bindaccount',
					fail:(err)=>{
						console.log(err)
					}
				})
			},
			//去修改密码
			toEditPassword() {
				uni.navigateTo({
					url: '/pagesA/profile/editPassword'
				})
			},
			//退出登录
			toOut() {
				uni.showModal({
					title:'提示',
					content:'请确认是否退出登录?',
					success:(res)=> {
						if(res.confirm){
							netOutLogin().then(res=>{
								uni.showToast({
									title:'退出登录',
									icon:'none'
								})
								setTimeout(()=>{
									uni.redirectTo({
										url:'/pages/public/login'
									})
								},2000)
							})
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	// 功能模块
	.profile_fun {
		background-color: #fff;
		.profile_item {
			display: flex;
			background:#fff;
			color:#666;
			padding: 0 30rpx;
			justify-content: space-between;
			border-bottom:1rpx solid #f5f5f5;
			height: 110rpx;
			line-height: 110rpx;
			font-size: 28rpx;
			.itemleft{
				display: flex;
				justify-content: flex-start;
				align-items: center;
				.leftimg{
					height:25px;
					width:25px;
					margin-right:25rpx;
				}
			}
		}
		button::after{
			border:none;
		}
	}
</style>