cmy 4 years ago
parent
commit
5e12416461
4 changed files with 156 additions and 84 deletions
  1. 25 0
      api/finance.js
  2. 115 82
      pages/assets/myPing.vue
  3. 16 2
      pages/assets/teamDetails.vue
  4. BIN
      static/img/pgTip.png

+ 25 - 0
api/finance.js

@@ -99,10 +99,35 @@ export function tbjl(data) {
 		data
 	})
 }
+// 用去币种
 export function moneyType(data) {
 	return request({
 		url: '/api/all/money_type',
 		method: 'get',
 		data
 	});
+}
+// 获取拼购记录
+export function pinkLog(data) {
+	return request({
+		url: '/api/lala/join',
+		method: 'get',
+		data
+	});
+}
+// 获取详细记录
+export function pinkLogDate(data,id) {
+	return request({
+		url: '/api/lala/join/'+id,
+		method: 'get',
+		data
+	});
+}
+// 获取拼购记录
+export function systemWallet(data) {
+	return request({
+		url: '/api/systemWallet',
+		method: 'get',
+		data
+	});
 }

+ 115 - 82
pages/assets/myPing.vue

@@ -7,8 +7,8 @@
 				<view class="info-font">福气值</view>
 			</view> -->
 			<view class="info">
-				<view class="info-num">{{luck || '0.00' }}</view>
-				<view class="info-font">幸运值</view>
+				<view class="info-num">{{ luck || '0.00' }}</view>
+				<view class="info-font">昨日USDT分红值</view>
 			</view>
 			<!-- <view class="info">
 				<view class="info-num">{{honor || '0.00' }}</view>
@@ -29,96 +29,131 @@
 			<view class="xian"></view>
 			<view class="join-font">参与记录</view>
 		</view>
-		<scroll-view scroll-y="true" @scrolltolower="loadData">
-			<view v-for="(item,index) in list" :key="index" class="box" @click="nav(item)">
-				<view class="title">
-					<view class="log"><image src="" mode=""></image></view>
-					<view class="name">{{item.name}}</view>
-					<view class="lun">{{item.lun}}</view>
-					<view class="more">详情</view>
+		<view v-for="(item, index) in list" :key="index" class="box" @click="nav(item)">
+			<view class="title flex">
+				<view class="flex clamp">
+					<view class="log"><image src="../../static/img/pgTip.png" mode="scaleToFill"></image></view>
+					<view class="name clamp">{{ item.name }}</view>
+					<view class="lun">{{ item.lun }}</view>
 				</view>
-				<view class="main">
-					<view class="main-info">
-						<view class="main-left">参与份数</view>
-						<view class="main-right">{{item.fen}}人份</view>
-					</view>
-					<view class="main-info">
-						<view class="main-left">参与金额</view>
-						<view class="main-right">{{item.money}}USDT</view>
-					</view>
-					<view class="main-info">
-						<view class="main-left">参与时间</view>
-						<view class="main-right">{{item.time}}</view>
-					</view>
+				<view class="more">详情</view>
+			</view>
+			<view class="main">
+				<view class="main-info">
+					<view class="main-left">参与份数</view>
+					<view class="main-right">{{ item.fen }}人份</view>
+				</view>
+				<view class="main-info">
+					<view class="main-left">参与金额</view>
+					<view class="main-right">{{ item.money + item.type }}</view>
+				</view>
+				<view class="main-info">
+					<view class="main-left">参与时间</view>
+					<view class="main-right">{{ item.time }}</view>
 				</view>
 			</view>
-		</scroll-view>
+		</view>
+		<u-loadmore style="margin-top: 10rpx;" :icon="true" icon-type="flower" :status="loadtype" />
 	</view>
 </template>
 
 <script>
+import { pinkLog,systemWallet } from '@/api/finance.js';
 export default {
 	data() {
 		return {
-			happy: '0.00',
-			luck: '0.00',
-			honor: '0.00',
-			usdt: '0.00',
-			fil: '0.00',
-			list: [
-				{
-					name: 'FilsCoin矿机拼购',
-					lun: '36轮',
-					fen: 1,
-					money: 100,
-					time: '2021-07-23 14:00:20'
-				},
-				{
-					name: 'FilsCoin矿机拼购',
-					lun: '36轮',
-					fen: 1,
-					money: 100,
-					time: '2021-07-23 14:00:20'
-				},
-				{
-					name: 'FilsCoin矿机拼购',
-					lun: '36轮',
-					fen: 1,
-					money: 100,
-					time: '2021-07-23 14:00:20'
-				},
-			],
-			loadtype: '',
+			// happy: '0.00',
+			// luck: '0.00',
+			// honor: '0.00',
+			// usdt: '0.00',
+			// fil: '0.00',
+			list: [],
+			loadtype: 'loadmore',
 			page: 1,
 			limit: 10,
-		}
+			bonus:0,//分红
+		};
 	},
-	methods:{
-		nav(e) {
-			uni.navigateTo({
-				url: '/pages/assets/teamDetails'
+	onReachBottom() {
+		this.loadData();
+	},
+	onLoad() {
+		this.loadData();
+		this.systemWallet()
+	},
+	methods: {
+		// 获取昨日分红
+		systemWallet(){
+			systemWallet().then((e) => {
+				console.log(e);
+			}).catch((e) => {
+				console.log(e);
 			})
 		},
+		loadData() {
+			let that = this;
+			if (that.loadtype == 'nomore') {
+				return;
+			}
+			that.loadtype = 'loading';
+			pinkLog({
+				page: that.page,
+				limit: that.limit
+			})
+				.then(e => {
+					const data = e.data.list.map(ls => {
+						const lun = ls.group_num > 0 ? ls.group_num + '轮' : '未开奖';
+						const time = new Date(ls.pay_time * 1000);
+						return {
+							name: ls.activity.name,
+							lun,
+							fen: 1,
+							money: +ls.cost,
+							type: ls.cost_money_type,
+							time: time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate(),
+							image: ls.activity.background_image,
+							id:ls.id
+						};
+					});
+					that.list.push(...data);
+					// 判断是否还有数据
+					if (that.list.length >= that.limit) {
+						that.page++;
+						that.loadtype = 'loadmore';
+					} else {
+						that.loadtype = 'nomore';
+					}
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		},
+		nav(e) {
+			uni.navigateTo({
+				url: '/pages/assets/teamDetails?id='+e.id
+			});
+		}
 	}
-}
+};
 </script>
 
 <style lang="scss">
-.center,page {
+.center,
+page {
 	height: 100%;
-	background: #F7FBFE;
+	background: #f7fbfe;
 }
 .bg {
 	width: 750rpx;
 	height: 248rpx;
-	background: linear-gradient(90deg, #60BAB0, #60BAB0, #45969B);
+	background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
 	border-bottom-left-radius: 150rpx;
 	border-bottom-right-radius: 150rpx;
 }
 .zong {
 	width: 690rpx;
 	height: 181rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
 	border-radius: 20rpx;
 	margin: -150rpx auto 0;
@@ -132,20 +167,20 @@ export default {
 			font-size: 50rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #0F253A;
+			color: #0f253a;
 		}
 		.info-font {
 			font-size: 28rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #6D7C88;
+			color: #6d7c88;
 		}
 	}
 }
 .money {
 	width: 690rpx;
 	height: 143rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
 	border-radius: 20rpx;
 	margin: 10rpx auto 0;
@@ -158,13 +193,13 @@ export default {
 			font-size: 40rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #0F253A;
+			color: #0f253a;
 		}
 		.money-font {
 			font-size: 24rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #6D7C88;
+			color: #6d7c88;
 		}
 	}
 }
@@ -177,7 +212,7 @@ export default {
 	.xian {
 		width: 6rpx;
 		height: 30rpx;
-		background: #0F253A;
+		background: #0f253a;
 		border-radius: 4rpx;
 	}
 	.join-font {
@@ -185,7 +220,7 @@ export default {
 		font-size: 30rpx;
 		font-family: PingFang SC;
 		font-weight: bold;
-		color: #0F253A;
+		color: #0f253a;
 	}
 }
 .box:first-child {
@@ -194,20 +229,16 @@ export default {
 .box {
 	margin: 20rpx auto 0;
 	width: 690rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
 	border-radius: 20rpx;
 	padding: 26rpx 36rpx 30rpx 30rpx;
 	position: relative;
 	.title {
-		display: flex;
-		justify-content: flex-start;
-		align-items: center;
 		.log {
 			width: 48rpx;
 			height: 46rpx;
-			background: #00BCD4;
-			image{
+			image {
 				width: 100%;
 				height: 100%;
 			}
@@ -217,26 +248,28 @@ export default {
 			font-size: 34rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #0F253A;
+			color: #0f253a;
+			max-width: 100%;
 		}
 		.lun {
 			padding-left: 10rpx;
 			font-size: 26rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
-			color: #6D7C88;
+			color: #6d7c88;
 		}
 		.more {
-			padding-left: 158rpx;
+			padding-left: 10rpx;
 			font-size: 28rpx;
 			font-family: PingFang SC;
 			font-weight: bold;
-			color: #44969D;
+			color: #44969d;
+			flex-shrink: 0;
 		}
 	}
 	.main {
 		margin-top: 26rpx;
-		.main-info{
+		.main-info {
 			padding-top: 16rpx;
 			display: flex;
 			justify-content: space-between;
@@ -244,13 +277,13 @@ export default {
 				font-size: 26rpx;
 				font-family: PingFang SC;
 				font-weight: 500;
-				color: #6D7C88;
+				color: #6d7c88;
 			}
 			.main-right {
 				font-size: 26rpx;
 				font-family: PingFang SC;
 				font-weight: bold;
-				color: #0F253A;
+				color: #0f253a;
 			}
 		}
 	}

+ 16 - 2
pages/assets/teamDetails.vue

@@ -51,12 +51,26 @@
 </template>
 
 <script>
+	import { pinkLogDate } from '@/api/finance.js';
 export default {
 	data() {
 		return {
-			data: ''
+			id:''
 		};
-	}
+	},
+	onLoad(e) {
+		this.id = e.id;
+		this.getDate()
+	},
+	methods: {
+		getDate() {
+			pinkLogDate({},this.id).then((e) => {
+				console.log(e);
+			}).catch((e) => {
+				console.log(e);
+			})
+		}
+	},
 };
 </script>
 

BIN
static/img/pgTip.png