<template>
	<view style="background-color: white;">
		<view class="img">
			<image slot="icon" src="@/static/order/搜索@2x.png" style="width: 250rpx; height: 200rpx" />
		</view>
		<view class="queryWriteOff">
			<input type="text" v-model="value" placeholder="请输入订单号查询" />
			<button @click='verification()'>查询核销</button>
		</view>

	</view>
</template>

<script>
	import {
		getOrderListApi,
		getVerificationApi
	} from '@/api/merchant/order'
	// import {
	// 	mapGetters
	// } from 'vuex';
	export default {
		data() {
			return {
				value: '',
				params: {
					pageNum: 1,
					pageSize: 10,
				}
			}
		},
		// computed: {
		// 	...mapGetters(['userId']),
		// },
		methods: {
			verification() {
				this.getOrderList()
			},
			async getOrderList() {
				console.log(this.value,"输入的")
				let result = Object.assign({}, {
					paging: `${this.params.pageNum},${this.params.pageSize}`,
					status: 0,
					orderSn: this.value
				}, );
				let res = await getOrderListApi({
					...result
				});
				if (res.code === 'OK' && res.data.records.length > 0) {
					uni.navigateTo({
						url: `/pageMerchant/components/toBeVerified?list=${JSON.stringify(res.data.records)}`
					})
				} else {
					uni.showToast({
						title: "没有该订单信息",
						dration: 2000,
					});
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
	.img {
		padding-top: 100rpx;

		image {
			display: block;
			margin: 0 auto;
		}
	}

	.queryWriteOff {
		margin-top: 50rpx;
		padding-left: 100rpx;
		padding-right: 100rpx;

		input {

			border: 1px solid blue;
			font-size: 30rpx;
			/* 设置输入框文本大小 */
			height: 70rpx;
			/* 设置输入框高度 */
		}

		button {
			margin-top: 20rpx;
			background-color: blue;
			color: aliceblue;
		}
	}
</style>