<template>
	<view>
		<view class="list">
			<u-divider style="padding-top: 10px;">住哪儿</u-divider>
			<view class="r_item" v-for="(item, index) in list" :key="index" @click="detail(item)">
				<image :src="ip + item.showPictures[0]" mode="aspectFill" class="pic"></image>
				<view class="con">
					<view class="title omit">{{ item.name }}</view>
					<view class="ms omit">{{ item.addres }}</view>
					<view class="ms">
						<u-rate :count="5" v-model="value" active-color="#FF9800"></u-rate>
						(5.0)
					</view>
				</view>
				<view class="clear"></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			ip: this.$http.urls.ip,
			value: 5,
			list: []
		};
	},
	onLoad() {
		this.getData();
	},
	methods: {
		//获取数据
		getData() {
			this.$http.request({
				url: this.$http.urls.hotelList,
				success: res => {
					this.list = res.data.data;
					this.list.forEach(item => {
						item.showPictures = item.showPictures.split(',');
					});
				}
			});
		},
		//详情
		detail(item) {
			uni.navigateTo({ url: '/pages/shop/hotel/detail?shopId=' + item.shopId });
		}
	}
};
</script>

<style lang="scss">
.list {
	padding: 10px 10px 70px 10px;
	.ms {
		color: $dar2;
	}
}
</style>
