<template>
	<view class="money-running-detail">
		<view class="app-item">
			<text>金额</text>
			<text>{{ (info.type == 1 || info.type == 3) ? '- ' : '+ ' }}{{ info.pay_money }}</text>
		</view>
		<view class="app-item">
			<text>摘要</text>
			<text>{{ info.type | getRunningStatus }}</text>
		</view>
		<view v-if="info.order_num" class="app-item">
			<text>订单号</text>
			<text>{{ info.order_num }}</text>
		</view>
		<view class="app-item">
			<text>流水号</text>
			<text>{{ info.pay_num }}</text>
		</view>
		<view class="app-item">
			<text>时间</text>
			<text>{{ info.updated_at }}</text>
		</view>
		<view class="app-item">
			<text>备注</text>
			<text>{{ info.remark }}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: {}
			};
		},
		filters: {
			getRunningStatus(status) {
				switch (status.toString()) {
					case '0': 
						return '账户充值'
					case '1':
						return '购买商品'
					case '2':
						return '订单退款'
					case '3':
						return '后台扣款'
					default:
						return ''
				}
			}
		},
		onLoad({ key }) {
			this.info = JSON.parse(uni.getStorageSync(key))
			uni.removeStorageSync(key)
		}
	}
</script>

<style lang="scss">
	.money-running-detail {
		height: 100vh;
		background: $app-base-bg;
	}
</style>
