Browse Source

2024-6-21

cmy 8 months ago
parent
commit
ffe6bb6869

+ 18 - 2
api/index.js

@@ -78,7 +78,7 @@ export function gameWallet(data) {
 		data
 	});
 }
-// 提計算
+// 提計算
 export function extractCalculator(data) {
 	return request({
 		url: '/api/user/extractCalculator',
@@ -86,7 +86,14 @@ export function extractCalculator(data) {
 		data
 	});
 }
-
+// 提幣
+export function extract(data) {
+	return request({
+		url: '/api/user/extract',
+		method: 'post',
+		data
+	});
+}
 
 // 报单计算
 export function pointCalculator(data) {
@@ -116,6 +123,15 @@ export function payPoint(id,data) {
 }
 
 
+// 節點記錄
+export function myList(data) {
+	return request({
+		url: `/api/point/myList`,
+		method: 'get',
+		data
+	});
+}
+
 
 
 

+ 6 - 2
libs/i18n/lang/cn.json

@@ -54,12 +54,16 @@
 		"充值失败": "充值失败",
 		"请选择支付方式":"请选择支付方式",
 		"提现": "提现",
-		"节点认购": "节点认购",
+		"提币数量": "提幣數量请大于100",
+		"节点认购": "会员认购",
+		"已認購": "会员认购",
+		"已釋放": "会员认购",
 		"认购成功": "认购成功",
 		"认购失败": "认购失败",
 		"立即认购": "立即认购",
 		"认购价": "认购价",
-		"社区建设": "社区建设,人人有责"
+		"社区建设": "社区百倍币,正式启航",
+		"认购数":"认购数"
 		
 	},
 	"user": {

+ 5 - 1
libs/i18n/lang/en.json

@@ -54,12 +54,16 @@
 		"充值失败": "FAIL",
 		"请选择支付方式":"Please select payment method",
 		"提现": "Withdrawal",
+		"提币数量": "Quantity greater than 100",
 		"节点认购": "Node",
+		"已认购": "Subscribed",
+		"待释放": "Release",
 		"认购成功": "SUCCESS",
 		"认购失败": "FAIL",
 		"立即认购": "Confirm Buy",
 		"认购价": "Price",
-		"社区建设": "Community construction, everyone has a responsibility"
+		"社区建设": "Community construction, everyone has a responsibility",
+		"认购数":"All number"
 	},
 	"user":{
 		"数据统计": "Data statistics",

+ 6 - 2
libs/i18n/lang/tw.json

@@ -54,12 +54,16 @@
 		"充值失败": "充值失敗",
 		"请选择支付方式":"請選擇支付方式",
 		"提现": "提現",
-		"节点认购": "節點認購",
+		"提币数量": "提幣數量請大于100",
+		"节点认购": "會員認購",
+		"已认购": "已認購",
+		"待释放": "待釋放",
 		"认购成功": "認購成功",
 		"认购失败": "認購失敗",
 		"立即认购": "立即認購",
 		"认购价": "認購價",
-		"社区建设": "社區建設,人人有責"
+		"社区建设": "社區建設,人人有責",
+		"认购数":"認購數"
 	},
 	"user":{
 		"数据统计": "數據統計",

+ 2 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "BCMM",
-    "appid" : "__UNI__6C02EF8",
+    "appid" : "__UNI__7D786A5",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : 100,
@@ -109,6 +109,7 @@
             "proxy" : {
                 "/api" : {
                     "target" : "http://bcmm.frp.qiniu1314.com"
+                    // "target" : "http://bcmm.frp.qiniu1314.com",
                 }
             }
         },

+ 7 - 0
pages.json

@@ -12,6 +12,13 @@
 				"navigationStyle": "custom"
 			}
 		},
+		{
+			"path": "pages/index/nodeDetail",
+			"style": {
+				"navigationBarTitleText": "BCMM",
+				"navigationStyle": "custom"
+			}
+		},
 		{
 			"path": "pages/index/bind",
 			"style": {

+ 3 - 4
pages/index/buling.vue

@@ -110,14 +110,13 @@
 				exchange({
 					num: this.bcmm
 				}).then((res) => {
-
-					this.bl = res.data.price;
 					uni.showToast({
 						title: this.$t('user.兑换成功'),
 					})
-
-
+					this.bcmm='';
+					this.getUserInfo();
 				}).catch((res) => {
+					console.log(res)
 					uni.showToast({
 						title: this.$t('user.兑换失败'),
 						icon: 'error'

+ 125 - 15
pages/index/node.vue

@@ -4,11 +4,13 @@
 		<view class="text-center border-linear-gradient">
 			<image class="contentImg" src="../../static/img/nodeBg.png" mode="widthFix"></image>
 			<view class="title flex-center" style="margin-top: -80rpx;">
-				<view>{{$t('home.认购价')}}:</view><view class="num text-linear-gradient">{{num}}U</view>
+				<view>{{$t('home.认购价')}}:</view>
+				<view class="num text-linear-gradient">{{.1}}U</view>
+			</view>
+			<view class="title flex-center">
+				<view>认购数:</view>
+				<view class="num text-linear-gradient">10000个</view>
 			</view>
-			<!-- <view class="title flex-center">
-				<view>认购数:</view><view class="num text-linear-gradient">0.1U</view>
-			</view> -->
 			<view class="title flex-center">
 				<view>{{$t('home.社区建设')}}</view>
 			</view>
@@ -16,6 +18,47 @@
 				{{$t('home.立即认购')}}
 			</view>
 		</view>
+		<view class="detail border-linear-gradient">
+			<view class="flex  top">
+				<view class="item">
+					<view class="text-linear-gradient">
+						{{order_num||0}}
+					</view>
+					<view class="tipText margin-t-20">
+						已認購
+					</view>
+				</view>
+				<view class="lineH">
+
+				</view>
+				<view class="item">
+					<view class="text-linear-gradient">
+						{{wait||0}}
+					</view>
+					<view class="tipText margin-t-20">
+						已釋放
+					</view>
+				</view>
+			</view>
+			<view class="flex padding-c-30 padding-v-20">
+				<view class="flex">
+					<view class="imageTip margin-r-10">
+						<image class="nodeImg" src="../../static/img/nodeIcon.png" mode=""></image>
+					</view>
+					<view class="typename">
+						釋放記錄
+					</view>
+				</view>
+				<navigator url="./nodeDetail">
+					<view class="flex-center">
+						<view class="rightTip margin-r-10">
+							查看詳細
+						</view>
+						<image class="nextImg" src="../../static/img/mininext.png" mode="scaleToFill"></image>
+					</view>
+				</navigator>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -24,7 +67,8 @@
 		loadIndexs,
 		creatorPoint,
 		payPoint,
-		pointCalculator
+		pointCalculator,
+		myList
 	} from '@/api/index.js';
 	import {
 		mapMutations
@@ -36,7 +80,9 @@
 	export default {
 		data() {
 			return {
-				num:''
+				num: '',
+				order_num:'',
+				wait:'',
 			}
 		},
 		components: {
@@ -59,6 +105,12 @@
 				}).catch((res) => {
 					console.log(res);
 				})
+				myList().then(({data}) => {
+					this.order_num = data.order_num;
+					this.wait = data.wait;
+				}).catch((res) => {
+					console.log(res);
+				})
 			},
 			// 报单
 			openPayMoney() {
@@ -72,13 +124,13 @@
 						});
 						that.creatorOrder(res.tapIndex)
 					}
-			
+
 				})
 			},
 			// 生成订单
 			creatorOrder(index) {
 				creatorPoint({
-					num: this.num*1,
+					num: this.num * 1,
 				}).then(({
 					data
 				}) => {
@@ -91,7 +143,7 @@
 			async payOrder(ind, id) {
 				const that = this;
 				let pushData = {
-					num:  this.num*1,
+					num: this.num * 1,
 					type: ind
 				}
 				try {
@@ -121,12 +173,12 @@
 						});
 					}
 					that.getUserInfo();
-					
+
 					uni.showToast({
 						title: that.$t('home.认购成功')
 					})
 				} catch (e) {
-					console.log(e,'err');
+					console.log(e, 'err');
 					uni.showToast({
 						title: that.$t('home.认购失败'),
 						icon: 'error'
@@ -143,29 +195,87 @@
 		width: 100%;
 		margin-top: -200rpx;
 	}
+
 	.container {
 		width: 100%;
 		line-height: 1;
 		background-color: rgb(12, 8, 21);
 		min-height: 100vh;
 	}
-	.text-center{
+
+	.detail {
+		margin: 30rpx 30rpx 0 30rpx;
+		border-radius: 30rpx;
+
+		.top {
+			justify-content: space-around;
+			padding: 30rpx;
+			color: #FFF;
+			font-weight: 500;
+			border-bottom: 1px solid #E1E1E1;
+			margin: 0 30rpx;
+
+			.item {
+				text-align: center;
+				font-weight: bold;
+				font-size: 38rpx;
+
+				.tipText {
+					font-size: 22rpx;
+					opacity: 0.8;
+				}
+			}
+
+			.lineH {
+				height: 92rpx;
+				width: 2px;
+				background: linear-gradient(0deg, rgba(255, 255, 255, 0), #FFFFFF, rgba(255, 255, 255, 0));
+			}
+		}
+
+		.typename {
+			font-size: 30rpx;
+			color: #FFF;
+		}
+
+		.imageTip {
+			.nodeImg {
+				width: 36rpx;
+				height: 33rpx;
+			}
+		}
+
+		.rightTip {
+			color: #FFF;
+			font-size: 24rpx;
+		}
+
+		.nextImg {
+			width: 8rpx;
+			height: 14rpx;
+		}
+	}
+
+	.text-center {
 		border-radius: 30rpx;
 		margin: 100rpx 30rpx 0 30rpx;
 		color: #FFF;
 		padding: 80rpx 50rpx;
-		.title{
+
+		.title {
 			font-weight: 500;
 			font-size: 33rpx;
 			padding-bottom: 50rpx;
 			// align-items: flex-end;
 		}
-		.num{
+
+		.num {
 			font-weight: bold;
 			font-size: 52rpx;
 		}
 	}
-	.buttom{
+
+	.buttom {
 		font-weight: bold;
 		font-size: 32rpx;
 		border-radius: 20rpx;

+ 137 - 0
pages/index/nodeDetail.vue

@@ -0,0 +1,137 @@
+<template>
+	<view class="container">
+		<view class="centerBox ">
+			<view class="itemList border-linear-gradient">
+				<view class="list">
+					<view class="item flex" v-for="(item,index) in listAll">
+						<view class="leftItem">
+							<view class="itemName">
+								{{item.title}}
+							</view>
+							<view class="itemTime margin-t-20">
+								{{item.createtime|dateFormat}}
+							</view>
+						</view>
+						<view class="rightItem">
+							<view class="on text-linear-gradient">
+								+{{item.money}}
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+			<u-loadmore :status="loading" line :loadmoreText="$t('base.加载更多')" :loadingText="$t('base.正在加载')"
+				:nomoreText="$t('base.没有更多了')" />
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		mapMutations
+	} from "vuex";
+	import {
+		moneyLog
+	} from '@/api/index.js';
+	import dayjs from '@/libs/dayjs/dayjs.min.js';
+	export default {
+		data() {
+			return {
+				listAll: [],
+				loading: 'loadmore', //'上拉加載更多','加載中','沒有更多'
+				page: 1,
+				limit: 10,
+				shareNum: 0,
+				itemNum: 0,
+			}
+		},
+		filters: {
+			dateFormat: function(value) {
+				return dayjs(value * 1000).format('YYYY/MM/DD hh:mm:ss');
+			},
+		},
+		onLoad(option) {
+			this.getList();
+		},
+		onReachBottom() {
+			this.getList()
+		},
+		methods: {
+			...mapMutations('user', ['setUserInfo']),
+			// 获取列表
+			getList() {
+				const that = this;
+				if (that.loading == 'nomore' || that.loding == "loading") {
+					return
+				}
+				that.loading = 'loading';
+				moneyLog({
+					page: that.page,
+					limit: that.limit,
+					type:"point_day_send"
+				}).then((res) => {
+					const list = res.data.list.map((rs) => {
+						rs.money = +rs.money;
+						return rs
+					})
+					that.listAll = that.listAll.concat(list);
+					if (list.length != that.limit) {
+						that.loading = 'nomore'
+					} else {
+						that.page++
+						that.loading = 'loadmore'
+					}
+				}).catch((res) => {
+					console.log(res);
+				})
+
+			},
+		},
+	}
+</script>
+
+<style lang="scss">
+	.container {
+		width: 100%;
+		line-height: 1;
+		background-color: rgb(12, 8, 21);
+		min-height: 100vh;
+	}
+
+	.centerBox {
+		padding: 30rpx;
+		color: #FFF;
+
+		.itemList {
+			border-radius: 20rpx;
+			padding: 20rpx 30rpx 40rpx;
+
+			.list {
+				min-height: 700rpx;
+				.item {
+					border-bottom: 1px solid rgba(240, 240, 240, .3);
+					padding: 20rpx 0;
+				}
+
+				.leftItem {
+					.itemName {
+						font-weight: bold;
+						font-size: 29rpx;
+					}
+
+					.itemTime {
+						font-weight: 500;
+						font-size: 22rpx;
+						color: #FFFFFF;
+						opacity: 0.5;
+					}
+				}
+
+				.rightItem {
+					font-weight: 500;
+					font-size: 30rpx;
+				}
+			}
+		}
+	}
+</style>

+ 1 - 1
pages/user/user.vue

@@ -83,7 +83,7 @@
 	} from "vuex";
 	import {
 		loadIndexs
-	} from '@/api/user.js';
+	} from '@/api/index.js';
 	import {
 		getUserInfo
 	} from '@/api/user.js';

+ 60 - 12
pages/user/withdrawal.vue

@@ -44,11 +44,15 @@
 	import {
 		gameWallet,
 		extractCalculator,
-		loadIndexs
+		loadIndexs,
+		extract
 	} from "@/api/index.js";
 	import {
 		getUserInfo
 	} from "@/api/user.js";
+	import {
+		mapState,
+	} from "vuex";
 	import navBar from "@/components/nav/nav.vue"
 	export default {
 		components: {
@@ -65,6 +69,7 @@
 			};
 		},
 		computed: {
+			...mapState("user", ['userInfo']),
 			charge() {
 				return Number((this.withdrawal * this.num / 100).toFixed(18))
 			}
@@ -88,30 +93,73 @@
 					// console.log(that.userWallet)
 				})
 				loadIndexs().then((res) => {
-					
+
 					// console.log(res)
 					that.num = +res.data.commission;
 					// console.log(that.userWallet)
 				})
 			},
 			// 提交
-			submit() {
+			async submit() {
 				const that = this;
 				uni.showLoading({
 					mask: true
 				});
 				if (that.userWallet < that.withdrawal) {
 					uni.showToast({
-						title:this.$t('user.余额不足'),
+						title: this.$t('user.余额不足'),
+						icon: 'error'
+					});
+					return
+				};
+
+				if (that.withdrawal < 100) {
+					uni.showToast({
+						title: this.$t('user.提币数量'),
 						icon: 'error'
 					});
 					return
 				};
+
 				that.loding = true;
-				extractCalculator({
-					number: that.withdrawal,
-					token: "USDT",
-				}).then((res) => {
+				try {
+					const {
+						data
+					} = await extractCalculator({
+						number: that.withdrawal,
+						token: "USDT",
+					})
+					let pushData = {
+						number: that.withdrawal,
+						token: "USDT",
+					}
+					// console.log(data,'data')
+					if (data.to) {
+						// console.log(hexString,'data2')
+						let gas = data.gas*1;
+						let hexString = '';
+						while (gas > 0) {
+						  let remainder = gas % 16;
+						  if (remainder < 10) {
+						    hexString = remainder + hexString;
+						  } else {
+						    hexString = String.fromCharCode(65 + remainder - 10) + hexString;
+						  }
+						  gas = Math.floor(gas / 16);
+						}
+						// console.log(hexString,'data2')
+						const txHash = await ethereum.request({
+							method: 'eth_sendTransaction',
+							params: [{
+								from: that.userInfo.address, // The user's active address.
+								to: data.to,
+								value:hexString,
+							}]
+						})
+						// console.log('data3')
+						pushData.transactionHash = txHash;
+					}
+					const res = await extract(pushData)
 					that.loding = false;
 					uni.hideLoading()
 					uni.showToast({
@@ -120,16 +168,15 @@
 					this.address = '';
 					this.withdrawal = ''; //提现金额
 					this.password = '';
-				}).catch((res) => {
+				} catch (e) {
 					uni.showToast({
 						title: this.$t("user.提现失败"),
 						icon: 'error'
 					});
 					that.loding = false;
 					uni.hideLoading()
-				})
-
-
+					//TODO handle the exception
+				}
 			}
 		}
 	}
@@ -153,6 +200,7 @@
 		border-radius: 20rpx;
 		padding: 40rpx 30rpx;
 		margin: 0 30rpx;
+
 		.topO {
 			font-size: $font-lg;
 			padding-bottom: 30rpx;

BIN
static/img/indexInfo.png


BIN
static/img/nodeIcon.png