<template>
	<view>
		<view v-for="(item,index) in productData" :key="inde" class="list">
			<view class="list-left">
				<view>{{item.name}}</view>
				<view class="money">
					<text style="font-size: 28rpx;">¥</text>{{parseFloat((item.sellingPrice).toFixed(2))}}
				</view>				
			</view>
			
			<view class="list-right">
				<text class="btn">购买</text>
			</view>
			
		</view>
		<view class="no-more">没有更多了...</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				productData:[],//产品数据
				merchantId:'',//商户Id
			}
		},
		onLoad(option) {
			this.merchantId=option.merchantId||''
			this.initProduct()
		},
		methods: {
			//---产品加载
			initProduct(){
				let data={
					merchantId:this.merchantId,//商户id
					type:1,//类型：1景区、2酒店、3餐饮
				}
				this.$request('scenic/user/product/findProductList',data).then((res)=>{
					if(res.code=="00"){
						this.productData=res.data.list||[]
					}else{
						uni.showToast({
						  title: res.message,
						  icon: 'none'
						})
					}
				})
			},
		}
	}
</script>

<style scoped lang="scss">
.list{
	display: flex;
	align-items: center;
	padding: 30rpx 20rpx;
	border-bottom: 1px solid #E6e6e6;
}
.list-left{
	flex: 1;
	margin-right: 30rpx;
}
.money{
	margin-top: 10rpx;
	font-size: 40rpx;
	color: #f9690e;
	font-weight: bolder;
}
.no-more{
	text-align: center;
	margin:30rpx 0;
}
</style>
