<template>
	<template v-for="(col,index) in list" :key="index">
		<view class="title">{{col.title}}</view>
		<u-cell-group>
			<u-cell-item :title="item.title" v-for="(item,i) in col.columns" :key="i" @click="itemClick(item)"
				:titleStyle="titleStyle"></u-cell-item>
		</u-cell-group>
	</template>
</template>

<script setup lang="ts">
	import { navTo } from '@/utils/utils';
	import { onLoad } from "@dcloudio/uni-app"
	import {
		reactive
	} from "vue";
	const titleStyle = { fontSize: '28rpx', color: '#333333' };
	const basePath = "/subpackage/personal-center/setting/";
	const list = [
		{
			columns: [
				{ title: 'ETC预留手机号验证', path: 'personal-information/change-phone', login: true },
				{ title: '上传审核资料', path: 'personal-information/user-card-ETC', login: true },
			]
		},
	]
	const state = reactive({
		userType:1  ,//1个人 2单位
		customerId:"",
		duigong:"2"//1 单位对公  2 用户或者单位etc
	})
    onLoad((options) => {
		console.log("options",options)
		state.userType=options.userType
		state.customerId=options.customerId
		state.duigong=options.duigong
	})
	/* item点击 */
	const itemClick = (item) => {
		if(state.userType==1 && state.duigong=='2'){
			navTo(basePath + item.path+`?customerId=${state.customerId}&userType=${state.userType}&changeMobileType=ETC_MOBILE`, item.login);
		}else{
			navTo(basePath + item.path+`?customerId=${state.customerId}&userType=${state.userType}&changeMobileType=ENTERPRISE_ACCOUNT_MOBILE`, item.login);
		}
	}
</script>

<style>
	page {
		background: #EEF7F7;
	}
</style>

<style lang="scss" scoped>
	.title {
		font-size: 26rpx;
		font-family: Microsoft YaHei;
		font-weight: 400;
		color: #666666;
		height: 20rpx;
		padding-left: 30rpx
	}
</style>