<template>
	<view class="City">
		<view class="express-item" @click="nav(item.name)" v-for="(item,index) of list" :key='index'>
			{{item.name}}
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad(e) {
			this.express(e.id)
		},
		methods: {
			
			nav(expressName){
				  var pages = getCurrentPages();
				  var prevPage = pages[pages.length - 2]; //上一个页面
				 //小程序用setData带参
	
					prevPage.$vm.expressName = expressName;
		
				uni.navigateBack();
			},
			
			express(id) {
				this.request({
					url: 'Smdcshop/express',
					data: {
						id,
					}
				}).then(res => {
					console.log(res)
					if (res.code == 200) {
						this.list = res.data
					}
				})
			}
		}
	}
</script>

<style>
	.express-item{
		padding: 20rpx;
	}
</style>
