<template>
	<view class="orderFood-index">
		<view class="content">
			<view class="item" v-for="(item,index) in list" :key="index" @click="jump(item.type)">
				<image class="icon" :src="item.src" mode=""></image>
				<view class="name">
					{{item.name}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/xgJrwD0vChsW012ac1e138a0aa5a970e8f8c59dab926.png/1.png',
						name:'肯德基KFC',
						type:'Kfc'
					},
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/K64jffEqRIDr487e8cab971c3b890d4066a26f5856d2.png/1.png',
						name:'麦当劳',
						type:'MDL'
					},
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/xMwtPkICBcam5513c4ac644054e60009cb8b1eb52e8f.png/1.png',
						name:'星巴克',
						type:'XBK'
					},
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/U9j6fgVmKeAt522ed50aa1a72f798260e0e30138d4c6.png/1.png',
						name:'奈雪的茶',
						type:'NXDC'
					},
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/zS5Q8sC9AAQca76eef36da2bd5a2ec234d75d8dcc044.png/1.png',
						name:'瑞幸咖啡',
						type:'RXKF'
					},
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/fA95my16Qunf967a9d992fc41134332926bcb5665881.png/1.png',
						name:'喜茶',
						type:'XC'
					},
					{
						src:'https://hyxhsh.oss-cn-chengdu.aliyuncs.com/63b7c68b71a69169d1b33f92/store/bdb/user/avatar/wk5eyuvhighG206a7ea081e3f0b783ff2a9555375e85.png/1.png',
						name:'库迪咖啡',
						type:'KD'
					}
				]
			}
		},
		methods: {
			jump(type) {
				if (uni.getStorageSync('token')) {
					uni.setStorageSync('ot',type)
					uni.navigateTo({
						url:'./shopList'
					})
				}else{
					uni.showModal({
						title:'请登录',
						confirmText:'去登录',
						success(res){
							console.log(res);
							if(res.confirm){
								uni.navigateTo({
									url:`/login/login/login?redirect=/orderFood/index`
								})
							}
						}
					})
				}
				
				
				
			}
		},
	}
</script>

<style lang="scss" scoped>
.orderFood-index{
	background: #F9F9F9;
	padding: 24rpx;
	min-height: 100vh;
	.content{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		.item{
			width: 224rpx;
			background: #FFFFFF;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			padding: 24rpx;
			box-sizing: border-box;
			text-align: center;
			margin-bottom: 16rpx;
			.icon{
				width: 120rpx;
				height: 120rpx;
				border-radius: 50%;
			}
			.name{
				font-size: 32rpx;
				color: #222222;
				text-align: center;
				margin-top: 28rpx;
			}
		}
	}
}
</style>