<template>
	<view class="box">
		<up-search v-model="query.shopName" @search="getData" @custom="getData"></up-search>
		<view class="u-m-t-32">
			<view class="u-flex list-item" v-for="(item,index) in list" :key="index">
				<up-avatar size="84rpx" shape="square" round="16rpx" :src="item.logo"></up-avatar>
				<view class=" u-p-l-16 color-333 font-14">{{item.shopName}}</view>
			</view>
		</view>

	</view>
</template>

<script setup>
	import {
		shopList
	} from '@/common/api/market/recharge.js'
	import {
		onMounted,
		reactive,
		ref
	} from 'vue';
	import {
		onLoad
	} from '@dcloudio/uni-app';

	const list = ref([])
	const query = reactive({
		shopName: '',
		shopId:''
	})
	async function getData() {
		const res = await shopList(query)
		if (res) {
			list.value = res || []
		}
	}

	function toDuihuan() {
		uni.showToast({
			title: '待开放！',
			icon: 'none'
		})
	}
	onLoad((opt) => {
		Object.assign(query, opt)
	})
	// function toDetail(item) {
	// 	uni.navigateTo({
	// 		url: '/pages/user/member/billDetails?type=2&shopId=' + item.shopId
	// 	})
	// }
	onMounted(getData)
</script>

<style lang="scss" scoped>
	.box {
		padding: 32rpx 28rpx;
	}

	.color-1 {
		color: #FF6300;
	}

	.list-item {
		align-items: center;
		padding: 36rpx 0;
		border-bottom: 1px solid #EDEDED;
	}
</style>