<template>
	<view class="content">
		<view class="container">
			<view class="box_f">
				<view class="box_top">
					<view class="">订单号:{{orderInfo.orderNumber}}</view>
					<view class="">{{orderInfo.orderStatus}}</view>
				</view>
				<view class="box_cont">
					<view class="">
						<image :src="baseUrl+orderInfo.coverImage" v-if="orderInfo.coverImage" style="width: 60px; height: 60px; "></image>
						<image src="../../static/logo.png" v-else style="width: 60px; height: 60px; "></image>
					</view>
					<view class="r-bas">
						<view style="font-size: 16px;color: #333333; margin-bottom: 5px;">{{orderInfo. giftName}}</view>
						<view class="">x{{orderInfo.exchangeQuantity || 0}}</view>
						<view class="b-bs">
							<view class="size1">
								实付: <text style="color: #E02020;">{{orderInfo.integral}}积分</text>
								<text style="color: #E02020;" v-if="orderInfo.amount">+{{orderInfo.amount}}元</text>
							</view>

						</view>
					</view>
				</view>
			</view>
			<view class="box_">
				<view class="">请向商家出示此码使用</view>
				<view style="display: flex;align-items: center;justify-content: center; margin: 10px auto;">
					<w-qrcode :options="options"></w-qrcode>
				</view>

				<view class="">核销码:6688172293684182</view>
			</view>
			<view class="box_" style="font-size: 14px;">
				<view class="title_">自提信息</view>
				<view class="b-s">
					<view class="">油站名称</view>
					<view class="">{{orderInfo.storeName}}</view>
				</view>
				<view class="b-s">
					<view class="">油站地址</view>
					<view class="">{{orderInfo.storeAddress}}</view>
				</view>
				<view class="b-s">
					<view class="">预留信息</view>
					<view class="">{{orderInfo.addrName}} {{orderInfo.addrMobile}}</view>
				</view>
			</view>
			<view class="box_" style="font-size: 14px;">
				<view class="title_">金额信息</view>
				<view class="b-s">
					<view class="">订单金额</view>
					<view class="r-size">¥{{orderInfo.amount || 0}}</view>
				</view>
				<view class="b-s">
					<view class="">订单积分</view>
					<view class="r-size">{{orderInfo.integral || 0}}积分</view>
				</view>
				<view class="b-s">
					<view class="">共{{orderInfo.exchangeQuantity}}件商品</view>
					<view class="r-size">实付:{{orderInfo.integral || 0}}积分</view>
				</view>
			</view>
			<view class="box_" style="font-size: 14px;">
				<view class="title_">订单信息</view>
				<view class="b-s">
					<view class="">订单编号</view>
					<view class="">{{orderInfo.orderNumber}}</view>
				</view>
				<view class="b-s">
					<view class="">下单油站</view>
					<view class="">{{orderInfo.storeName}}</view>
				</view>
				<view class="b-s">
					<view class="">下单时间</view>
					<view class="">{{orderInfo.createTime}}</view>
				</view>
				<view class="b-s">
					<view class="">支付方式</view>
					<view class="">{{orderInfo.paymentType}}</view>
				</view>
				<view class="b-s">
					<view class="">支付时间</view>
					<view class="">{{orderInfo.createTime}}</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	import config from '@/config'
	import request from '../../utils/request';
	export default {
		data() {
			return {
				title: '',
				baseUrl: config.baseUrl,
				List: [],
				pageNo: 1,
				pageSize: 10,
				totalPage: '',
				options: {
					code: 'https://qm.qq.com/cgi-bin/qm/qr?k=LKqML292dD2WvwQfAJXBUmvgbiB_TZWF&noverify=0', // 生成二维码的值
					size: 300, // 460代表生成的二维码的宽高均为460rpx
				},
				orderId: '',
				orderInfo: {}
			}
		},
		onPullDownRefresh() {
			//下拉刷新
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			// 触底加载
			if (this.pageNo >= this.totalPage) {

			} else {
				this.pageNo++
			}
		},
		onLoad(e) {
			this.orderId = e.orderId
			this.getInfo()
		},

		components: {

		},
		methods: {
			getInfo() {
				request({
					url: 'business/integral/integralOrders/' + this.orderId,
					method: 'get',
				}).then((res) => {
					if (res.code == 200) {
						console.log(res, 132);
						this.orderInfo = res.data
					}
				})
			},
			goback() {
				uni.navigateBack()
			}
		}
	}
</script>

<style scoped lang="scss">
	.content {
		width: 100%;
		height: 100vh;
		box-sizing: border-box;
		background: #f4f5f6;
	}

	.container {
		background: #f4f5f6;
		box-sizing: border-box;
		padding-top: 1px;

	}

	.box_f {
		width: 95%;
		border-radius: 8px;
		background: #ffffff;
		margin: 15px auto;
	}

	.box_ {
		width: 95%;
		border-radius: 8px;
		background: #ffffff;
		margin: 15px auto;
		box-sizing: border-box;
		padding: 10px;
		text-align: center;

	}

	.box_top {
		width: 100%;
		box-sizing: border-box;
		padding: 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		font-size: 14px;
		border-bottom: 1px;
		border-bottom: 1px dashed #eee;
	}

	.box_cont {
		width: 100%;
		box-sizing: border-box;
		padding: 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.r-bas {
		width: 80%;
		font-size: 12px;
	}

	.b-bs {
		display: flex;
		align-items: center;
		justify-content: space-between;

	}

	.anniu {
		width: 80px;
		height: 25px;
		background: #FF9655;
		color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 14px;
		border-radius: 50px;
	}

	.title_ {
		font-weight: 600;
		font-size: 16px;
		color: #333333;
		text-align: left;
	}

	.b-s {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 10px auto;
	}

	.r-size {
		color: #E02020;
	}
</style>