<template>
	<view class="successTransaction">
		<u-navbar :safeAreaInsetTop="false" :placeholder="true" @leftClick="toHome">
		</u-navbar>
		<view class="success">
			<view class="text">
				<img src="/static/46660.png" alt="" style="margin-right: 10px;" />
				<text>{{ $t('page.successTransaction.successTransaction') }}</text>
			</view>
			<button class="btn" @click="toHome">{{ $t('toHome') }}</button>
		</view>
		<productList :list="list" />
	</view>
</template>

<script>
	import productList from '@/components/product/productList.vue'
	export default {
		components: {
			productList,
		},
		data() {
			return {
				list: [],
			}
		},
		onShow(){
			this.getProduct();
		},
		methods: {
			toHome() {
				uni.switchTab({
					url: '/pages/home/home'
				})
			},
			getProduct(){
				this.request('getShopPage', {},
					{
						"pageSize":20, 
						"currentPage": 0
					}
				)
				.then(res => {
					this.list = parseList(res.result.records);
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.successTransaction {
		.success {
			display: flex;
			flex-direction: column;
			background-color: #fff;
			margin: 10px;
			border-radius: 10px;
			justify-content: center;
			align-items: center;
			padding: 20px;

			.text {
				display: flex;
				justify-content: center;
				align-items: center;
				margin-bottom: 20px;
				font-size: 20px;
			}

			.btn {
				height: 30px;
				line-height: 30px;
				font-size: 25rpx;
				background-color: #fff;
				border-radius: 15px;
				border: 1px solid #00000033;
			}
		}
	}
</style>