<template>
	<view>
		<van-index-bar>
			<loading v-if="loading" />
			<view v-for="(item,index) in cityList" :key='index'>
				<van-index-anchor :index="index" />
				<van-cell @click='selectCity(sonitem)' :title="sonitem.regionName" v-for="(sonitem,sonindex) in item" :key='sonindex' />
			</view>
		</van-index-bar>
	</view>
</template>

<script>
	export default {
		data: () => ({
			cityList: [],
			loading: true
		}),
		onLoad: async function(option) {
			let data = await this.goPageGetData()
			this.cityList = data.cityList
			this.loading = false
		},
		methods: {
			selectCity(obj) {
				this.$store.commit('SET_CITYOBJ', obj)
				this.$store.commit('SET_CITYID', obj.cityId)
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">

</style>
