<template>
	<ciy-header title="提现历史记录" ref="header"></ciy-header>
	<view v-if="init.code != 1">
		<view class="px4 py4">
			<view style="height:2em;width:100%;" class="ciy-skeleton"></view>
			<view style="height:6em;width:100%;" class="ciy-skeleton"></view>
			<view style="height:6em;width:100%;" class="ciy-skeleton"></view>
		</view>
	</view>
	<view v-else>
		<view class="sti" :style="{top:(header_statusbar_height+header_title_height)+'px'}">
			<ciy-segment lis="90:已拒绝,100:已完成" all="全部" @change="segment_change"></ciy-segment>
		</view>
		<view class="ciy-list" v-for="(item,index) in init.list" :key="item.id">
			<view class="l2">
				<text class="kbd">{{cashtype==1?'银行':'微信'}}</text>
				{{item.taxmoney==-1?'企业开具发票':'代缴个税 ' + (item.taxmoney/100)+' 元'}}
			</view>
			<ciy-showimgs label="发票" :src="item.invfile"></ciy-showimgs>
			<view class="l2" v-if="item.invcode">发票号码 {{item.invcode}}</view>
			<view class="l2" v-if="item.cashtimes>0">操作时间 {{todatetime(item.cashtimes)}}</view>
			<view class="l2" v-if="item.cashno">支付编号 {{item.cashno}}</view>
			<view class="l2" v-if="item.auditmsg">拒绝原因 {{item.auditmsg}}</view>
			<view class="l2" v-if="item.bankaccount">账户名称 {{item.bankaccount}}</view>
			<view class="l2" v-if="item.bankno">银行卡号 {{item.bankno}}</view>
			<view class="l2" v-if="item.bankname">开户银行 {{item.bankname}}</view>
			<view class="l2" v-if="item.bankcode">联行号 {{item.bankcode}}</view>

			<view class="rt"><text class="kbd" :class="ccode(g.cashstatus, item.cashstatus,'clas')">{{ccode(g.cashstatus, item.cashstatus)}}</text></view>
			<view class="lb">{{todatetime(item.addtimes)}}</view>
			<view class="rb txt-lgg txt-wb">{{item.cashmoney/100}}</view>


		</view>
		<ciy-listend :page="pageno" :listlen="init.list.length" :nodataimg="file_stor('/img/mbnone.png')"></ciy-listend>
	</view>
</template>

<style>
</style>

<script>
	export default {
		data() {
			return {}
		},
		onLoad() {
			this.getlist();
		},
		onReachBottom(b) {
			if (this.init.code != 1)
				return;
			this.getlist();
		},
		onPullDownRefresh(b) {
			this.pageno = 0;
			this._stopPullDown = true;
			this.getlist();
		},
		watch: {},
		computed: {},
		methods: {
			async getlist() {
				if (this.pageno < 0)
					return;
				if (this._loading)
					return;
				this.pagepost.pageno = this.pageno + 1;
				this._loading = true;
				var retjson = await this.callfunc({
					func: 'me.cashout_lst_list',
					data: this.pagepost
				});
				this._loading = false;
				if (retjson.code != 1)
					return this.alert(retjson.errmsg);
				this.pageno++;
				if (this.pageno == 1)
					this.init.list = [];
				this.init = this.objdeepmerge(this.init, retjson);
				if (retjson.list.length < retjson.pagecount)
					this.pageno = -1;
			},
			segment_change(e) {
				this.pagepost.liid = e.value.id;
				this.pageno = 0;
				this.getlist();
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 800
				});
			}
		}
	}
</script>