<template>
	<view>
		<view class="mart5 width100 backcorfff">
			<view class="notes">
				<view class="fcor666 width25">商户名称</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.merName}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">门店名称</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.storeName}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">交易模式</view>
				<view class="font14 fcor333 text2 width75 fotrt" v-if="orderByOutTradeOrder.payMode == 'ALIPAY' ">支付宝</view>
				<view class="font14 fcor333 text2 width75 fotrt" v-if="orderByOutTradeOrder.payMode == 'WECHAT' ">微信</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">支付时间</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.payTime | timeFormat('yyyy-mm-dd hh:mm:ss')}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">商户交易单号</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.outTradeNo}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">账户端交易单号</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.accTradeNo}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">交易状态</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{statusList[orderByOutTradeOrder.status]}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">交易金额</view>
				<view class="font14 fcor333 text2 width75 fotrt">¥ {{orderByOutTradeOrder.tradeAmount}}</view>
			</view>
			<view class="notes" v-if="orderByOutTradeOrder.storeDiscountPrice">
				<view class="fcor666 width25">门店优惠</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.storeDiscountPrice}}</view>
			</view>
			
			<view class="notes" v-if="orderByOutTradeOrder.userPhone">
				<view class="fcor666 width25">客户手机号</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.userPhone}}</view>
			</view>
			<view class="notes" v-if="orderByOutTradeOrder.userDiscountPrice">
				<view class="fcor666 width25">客户优惠券优惠</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.userDiscountPrice}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">交易实际金额</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.tradeActualAmount}}</view>
			</view>
			<view class="notes" v-if="orderByOutTradeOrder.feeRate">
				<view class="fcor666 width25">交易费率</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.feeRate}}</view>
			</view>
			<view class="notes">
				<view class="fcor666 width25">交易创建方式</view>
				<view class="font14 fcor333 text2 width75 fotrt">扫一扫</view>
			</view>
			<view class="notes" v-if="orderByOutTradeOrder.platformMerNo">
				<view class="fcor666 width25">平台商户号</view>
				<view class="font14 fcor333 text2 width75 fotrt">{{orderByOutTradeOrder.platformMerNo}}</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import {
		getOrderByOutTradeOrder
	} from '../../../Utils/Api.js';
	export default {
		data() {
			return {
				statusList: {
					1: "待支付",
					2: "支付中",
					3: "支付成功",
					4: "支付失败",
					5: "已取消",
					6: "已退款"
				},
				orderid: '', //交易流水号，
				orderByOutTradeOrder: '' //详情
			}
		},
		onLoad(options) {
			this.orderid = options.orderid;
			this.getOrderByOutTradeOrder();
		},
		methods: {
			//查询详情
			getOrderByOutTradeOrder() {
				uni.showLoading({
					title: '加载中...'
				})
				let datas = {
					outTradeOrder: this.orderid
				}
				getOrderByOutTradeOrder(datas).then(res => {
					if (res.return_code == '000000') {
						this.orderByOutTradeOrder = res.return_data.order;
					}
					uni.hideLoading();
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #f6f6f6;
	}

	.notes {
		width: calc(100% - 40rpx);
		display: flex;
		align-items: center;
		padding: 30rpx 0 30rpx 20rpx;
		border-bottom: 1px solid #f6f6f6;
	}
</style>