<template>
	<view>
		<view @tap="navInfo(item)" v-for="(item,index) in list" :key="index" class="capital-list">
			<view>
				<view><text class="title">{{UserCapitalStreamType[item.capitalStreamType]}}</text></view>
				<view class="line-2"><text>{{PaymentPass[item.paymentPass]}}【{{UserCapitalStreamStatus[item.capitalStreamStatus]}}】</text></view>
			</view>
			<view class="right">
				<text class="title price">{{item.money}}</text>
				<view class="line-2">
					<view>
						<image class="time-icon" src="../../static/icon/Wallet-Background-Time.png"></image>
						<text>{{$dateFormat(item.editTime)}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		CAPITAL_INFO_KEY,
		UserCapitalStreamStatus,
		UserCapitalStreamType,
		PaymentPass
	} from '../js/request.js'

	export default {
		props: ['list'],
		computed: {
			[CAPITAL_INFO_KEY]: {
				get() {
					return this.$store.state[CAPITAL_INFO_KEY] || {}
				},
				set(val) {
					this.$store.state[CAPITAL_INFO_KEY] = val
				}
			}
		},
		data() {
			return {
				...{
					UserCapitalStreamStatus,
					UserCapitalStreamType,
					PaymentPass
				}
			}
		},
		methods: {
			navInfo(item) {
				this[CAPITAL_INFO_KEY] = item
				uni.navigateTo({
					url: '/pages/user/capital_info'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '../static/scss/capital.scss'
</style>
