Browse Source

2021-5-14 tibi

hwq 4 years ago
parent
commit
39ba8b6570
5 changed files with 226 additions and 0 deletions
  1. 8 0
      api/finance.js
  2. 7 0
      pages.json
  3. 197 0
      pages/finance/Tdetails.vue
  4. 14 0
      pages/finance/withdraw.vue
  5. BIN
      static/img/tbjl.png

+ 8 - 0
api/finance.js

@@ -102,4 +102,12 @@ export function newMining(data) {
 		method: 'get',
 		data
 	})
+}
+//提币记录
+export function tbjl(data) {
+	return request({
+		url: '/api/extract/list',
+		method: 'get',
+		data
+	})
 }

+ 7 - 0
pages.json

@@ -133,6 +133,13 @@
 				"enablePullDownRefresh": true
 			}
 		},
+		{
+			"path": "pages/finance/Tdetails",
+			"style": {
+				"navigationBarTitleText": "提币记录",
+				"enablePullDownRefresh": true
+			}
+		},
 		{
 			"path": "pages/finance/today",
 			"style": {

+ 197 - 0
pages/finance/Tdetails.vue

@@ -0,0 +1,197 @@
+<template>
+	<view class="center">
+		<scroll-view scroll-y="true" >
+			<empty v-if="list.loaded === true && list.length === 0"></empty>
+			<view v-for="(item,index) in list" :key="index" >
+				<view class="box">
+					<view class="top">
+						<view class="time">交易时间:{{item.add_time}}</view>
+						<view class="type" v-if="item.status == 0">审核中</view>
+						<view class="type1" v-if="item.status == 1">已完成</view>
+						<view class="type2" v-if="item.status == 2">提现失败</view>
+					</view>
+					<view class="content flex">
+						<view class="main flex">
+							<image class="img" src="../../static/img/tbjl.png" mode=""></image>
+							<view class="font">
+								<view class="title">提币记录</view>
+								<view class="font-money">提现金额:{{item.extract_price * 1}}{{item.money_type}}</view>
+								<view class="font-money">手续费:{{item.service * 1}}{{item.service_type}}</view>
+							</view>
+						</view>
+						<view class="money">
+							合计:<text>{{item.real_get * 1}}{{item.money_type}}</text>
+						</view>
+					</view>
+				</view>
+			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+import empty from '@/components/empty';
+import { tbjl } from '@/api/finance.js';
+export default{
+	components: {
+		empty,
+		uniLoadMore,
+	},
+	data(){
+		return {
+			list: [],
+			page: 1,
+			limit: 10,
+			loadingType: 'more', //加载更多状态
+		}
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		this.dataBase('refresh');
+	},
+	onLoad() {
+		this.dataBase();
+	},
+	methods: {
+		async dataBase(type = 'add',loading){
+			let obj = this;
+			let data = {
+				page: obj.page,
+				limit: obj.limit
+			};
+			if (type === 'add') {
+				if (obj.loadingType === 'nomore') {
+					return;
+				}
+				obj.loadingType = 'loading';
+			} else {
+				obj.loadingType = 'more';
+			}
+			if (type === 'refresh') {
+				// 清空数组
+				obj.page = 1;
+				this.list = []
+			}
+			tbjl(data)
+				.then(({data}) => {
+					if(data.data.length > 0) {
+						data.data.forEach(e => {
+							e.add_time = obj.timestampToTime(e.add_time);
+							obj.list.push(e);
+							
+						})
+						
+					}
+					if (obj.limit == data.data.length) {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						obj.page++;
+						obj.loadingType = 'more';
+					} else {
+						//判断是否还有数据, 有改为 more, 没有改为noMore
+						obj.loadingType = 'noMore';
+					}
+					if (type === 'refresh') {
+						if (loading == 1) {
+							uni.hideLoading();
+						} else {
+							uni.stopPullDownRefresh();
+						}
+					}
+					obj.$set(obj.list, 'loaded', true);
+				})
+		},
+		timestampToTime(timestamp) {
+			var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+			        var Y = date.getFullYear() + '-';
+			        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1):date.getMonth()+1) + '-';
+			        var D = (date.getDate()< 10 ? '0'+date.getDate():date.getDate())+ ' ';
+			        var h = (date.getHours() < 10 ? '0'+date.getHours():date.getHours())+ ':';
+			        var m = (date.getMinutes() < 10 ? '0'+date.getMinutes():date.getMinutes()) + ':';
+			        var s = date.getSeconds() < 10 ? '0'+date.getSeconds():date.getSeconds();
+			        return Y+M+D+h+m+s;
+		}
+	}
+}
+</script>
+
+<style lang="scss">
+page {
+	height: 100%;
+	background: #FFFFFF;
+}
+.box {
+	position: relative;
+	padding: 20rpx;
+	width: 90%;
+	margin: 0 auto;
+	margin-top: 10rpx;
+	height: 216rpx;
+	background: #FFFFFF;
+	border-radius: 10rpx;
+	.top {
+		display: flex;
+		justify-content: space-between;
+		.time {
+			font-size: 22rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #999999;
+		}
+		.type {
+			font-size: 24rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #5771DF;
+		}
+		.type1 {
+			font-size: 24rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #999999;
+		}
+		.type2 {
+			font-size: 24rpx;
+			font-family: PingFang SC;
+			font-weight: 400;
+			color: #ff0000;
+		}
+	}
+	.content {
+		margin-top: 30rpx;
+		.img{
+			width: 60rpx;
+			height: 66rpx;
+		}
+		.font{
+			padding-left: 20rpx;
+			.title {
+				font-size: 30rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #333333;
+			}
+			.font-money {;
+				font-size: 24rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #666666;
+			}
+		}
+	}
+	.money {
+		position: absolute;
+		bottom: 24rpx;
+		right: 20rpx;
+		font-size: 24rpx;
+		font-family: PingFang SC;
+		font-weight: 500;
+		color: #999999;
+		text {
+			color: #FA2740;
+			font-size: 30rpx;
+		}
+	}
+}
+</style>

+ 14 - 0
pages/finance/withdraw.vue

@@ -25,6 +25,9 @@
 			</view>
 			<view class="all-num">可用<text>{{money *1 }}</text>{{name}}</view>
 			<view class="submit" @click="cash">确定</view>
+			<view class="jilv" @click="nav('/pages/finance/Tdetails')">
+				提币记录
+			</view>
 			<view class="tpl-box" v-show="showText == true">提币数量在{{less}}-10000.0个之间,认真核对提币地址;手续费:{{data.service}}{{data.service_type}}</view>
 		</view>
 	</view>
@@ -135,6 +138,11 @@
 			useOutClickSide() {
 				this.$refs.easySelect.hideOptions && this.$refs.easySelect.hideOptions()
 			},
+			nav(url) {
+				uni.navigateTo({
+					url:url
+				})
+			}
 		}
 	};
 </script>
@@ -220,4 +228,10 @@
 			margin-top: 26rpx;
 		}
 	}
+	.jilv {
+		margin-top: 30rpx;
+		text-align: center;
+		color: #999999;
+		font-size: 30rpx;
+	}
 </style>

BIN
static/img/tbjl.png