zhang 1 рік тому
батько
коміт
18944abcf9

+ 5 - 4
libs/i18n/lang/cn.json

@@ -193,10 +193,11 @@
 	"set": {
 		"a1": "头像",
 		"a2": "昵称",
-		"a3":"账号",
-		"a4":"修改",
-		"a5":"提交",
-		"a6":"退出"
+		"a3": "账号",
+		"a4": "修改",
+		"a5": "提交",
+		"a6": "退出"
+		 
 	},
 	"tab": {
 		"a1": "我的质押",

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

@@ -196,7 +196,8 @@
 		"a3":"Login ID",
 		"a4":"Revise",
 		"a5":"Submit",
-		"a6":"Exit"
+		"a6":"Exit",
+		"a7": "Issue"
 	},
 	"tab": {
 		"a1": "My Pledge",

+ 9 - 1
pages/index/index.vue

@@ -57,7 +57,7 @@
 				{{item.data[0].idxPx}}
 			</view>
 			<view class="list-item ">
-				{{(item.data[0].idxPx - item.data[0].high24h) / item.data[0].high24h}}
+				{{((item.data[0].idxPx - item.data[0].high24h) / item.data[0].high24h) | decimalPlaces}}
 			</view>
 		</view>
 		<taber tab='index'></taber>
@@ -97,6 +97,14 @@
 				return label
 			}
 		},
+		filters: {
+		  decimalPlaces(value) {
+		    if (typeof value !== 'number') {
+		      return value;
+		    }
+		    return value.toFixed(5);
+		  }
+		},
 		onLoad() {
 			this.loadData()
 		},

+ 22 - 29
pages/user/money/recharge.vue

@@ -46,11 +46,12 @@
 </template>
 
 <script>
+	import {qianBao} from "@/api/wallet.js"
 	import UQRCode from "@/components/uqrcodejs/uqrcode.js"; // npm install uqrcodejs
 	export default {
 		data() {
 			return {
-				address: "ca87ca68ca68c6a986c98a678c7a8",
+				address: '',
 			};
 		},
 		mounted() {},
@@ -74,8 +75,15 @@
 			uni.setNavigationBarTitle({
 				title: this.$t("tab.a3"),
 			});
+			this.qianBao()
 		},
 		methods: {
+			// 二维码地址
+			async qianBao() {
+				const res = await qianBao()
+				console.log('qian', res);
+				this.address = res.data.back.USDT.address
+			},
 			// 复制地址
 			copy(value) {
 				uni.setClipboardData({
@@ -87,35 +95,20 @@
 				});
 			},
 			savePic(Url){
-					// Url = this.address //图片路径,也可以传值进来
-					// var triggerEvent = "touchstart"; //指定下载方式
-				 //    var blob=new Blob([''], {type:'application/octet-stream'}); //二进制大型对象blob
-				 //    var url = URL.createObjectURL(blob); //创建一个字符串路径空位
-				 //    var a = document.createElement('a'); //创建一个 a 标签
-				 //    a.href = Url;  //把路径赋到a标签的href上
-				 //    //正则表达式,这里是把图片文件名分离出来。拿到文件名赋到a.download,作为文件名来使用文本
-				 //    a.download = Url.replace(/(.*\/)*([^.]+.*)/ig,"$2").split("?")[0]; 
-				 //    /* var e = document.createEvent('MouseEvents');  //创建事件(MouseEvents鼠标事件)
-				 //    e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); //初始化鼠标事件(initMouseEvent已弃用)*/
+					Url = this.address //图片路径,也可以传值进来
+					var triggerEvent = "touchstart"; //指定下载方式
+				    var blob=new Blob([''], {type:'application/octet-stream'}); //二进制大型对象blob
+				    var url = URL.createObjectURL(blob); //创建一个字符串路径空位
+				    var a = document.createElement('a'); //创建一个 a 标签
+				    a.href = Url;  //把路径赋到a标签的href上
+				    //正则表达式,这里是把图片文件名分离出来。拿到文件名赋到a.download,作为文件名来使用文本
+				    a.download = Url.replace(/(.*\/)*([^.]+.*)/ig,"$2").split("?")[0]; 
 				    
-					// var e = new MouseEvent('click', ( true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null));  
-					// //派遣后,它将不再执行任何操作。执行保存到本地
-				 //    a.dispatchEvent(e); 
-				 //    //释放一个已经存在的路径(有创建createObjectURL就要释放revokeObjectURL)
-				 //    URL.revokeObjectURL(url);  
-				 
-				 
-				   var canvas = document.getElementById('qrcode'); // 获取二维码所在的canvas元素
-				   var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream"); // 将canvas转换为base64格式的图片数据
-				 
-				   var a = document.createElement('a');
-				   a.href = image;
-				   a.download = 'qrcode.png'; // 设置下载的文件名
-				   
-				   var event = new MouseEvent('click');
-				   a.dispatchEvent(event);
-				 
-
+					var e = new MouseEvent('click', ( true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null));  
+					//派遣后,它将不再执行任何操作。执行保存到本地
+				    a.dispatchEvent(e); 
+				    //释放一个已经存在的路径(有创建createObjectURL就要释放revokeObjectURL)
+				    URL.revokeObjectURL(url);  
 				},
 		},
 	};

+ 66 - 188
pages/user/money/team.vue

@@ -12,18 +12,18 @@
 			</view>
 			<view class="money-box">
 				<view>{{$t('money.a2')}}</view>
-				<view class="money">{{ yj || 0 }}</view>
+				<view class="money">{{userWallet}}U</view>
 				
 			</view>
 			<!-- 数据代办 -->
 			<view class="box">
 				<view class="moneybtn-box1">
 					<view class="money-btn"></view>
-					<view class="money-btn" @click="navto('/pages/recharge/recharge')">{{$t('money.a3')}}</view>
+					<view class="money-btn" @click="navto('/pages/user/money/recharge')">{{$t('money.a3')}}</view>
 				</view>
 				<view class="moneybtn-box">
 					<view class="money-btn"></view>
-					<view class="money-btn" @click="navto('/pages/withdrawal/withdrawal')">{{$t('money.a4')}}</view>
+					<view class="money-btn" @click="navto('/pages/user/money/withdrawal')">{{$t('money.a4')}}</view>
 				</view>
 			</view>
 			
@@ -40,40 +40,21 @@
 				<view class="info-num">{{userInfo.extract || '0'}}</view>
 			</view>
 		</view>
-		<view class="navbar">
-			<view v-for="(item, index) in navList" :key="index" class="nav-item"
-				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
+		<view class="list flex" v-for="(item, index) in navList" :key="index">
+			<view class="">
+				<view class="tit" v-if="item.title === '充值'">{{$t('user.a7')}}</view>
+				<view class="tit" v-else>{{$t('user.a6')}}</view>
+				<view class="tim">{{item.time}}</view>
+			</view>
+			<view class="boxT">
+				<view class="mon">{{item.money}}</view>
+			</view>
 		</view>
-		<swiper :current="tabCurrentIndex" :style="{ height: height }" class="swiper-box" duration="300"
-			@change="changeTab">
-			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
-				<scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
-					<!-- 订单列表 -->
-					<view>
-						<view class="order-item flex" v-for="(item, index) in tabItem.orderList" :key="index">
-							<view class="title-box">
-								<view class="title">
-									<text>{{ item.title }}</text>
-								</view>
-								<view class="time">
-									<text>{{ item.add_time }}</text>
-								</view>
-							</view>
-							<view class="money">
-								<view>{{ (item.pm == 0 ? '-' : '+') + item.number * 1 }}</view>
-							</view>
-						</view>
-					</view>
-					
-					<uni-load-more :status="tabItem.loadingType"
-						v-if="!(tabItem.orderList.length == 0 && tabItem.loaded)"></uni-load-more>
-				</scroll-view>
-			</swiper-item>
-		</swiper>
 	</view>
 </template>
 
 <script>
+	import {qianBao} from "@/api/wallet.js"
 	import {
 		gameWallet,
 	} from "@/api/game.js";
@@ -83,7 +64,8 @@
 	} from 'vuex';
 	import {
 		getCommissionInfo,
-		getUserInfo
+		getUserInfo,
+		// getUser
 	} from '@/api/user.js';
 	import {
 		getMoneyStyle
@@ -95,7 +77,6 @@
 	import {
 		spreadCommission,
 		userBalance,
-		extractBank,
 	} from '@/api/wallet.js';
 	export default {
 		filters: {
@@ -104,24 +85,11 @@
 		components: {
 			empty,
 		},
-		onReady(res) {
-			var _this = this;
-			uni.getSystemInfo({
-				success: resu => {
-					const query = uni.createSelectorQuery();
-					query.select('.swiper-box').boundingClientRect();
-					query.exec(function(res) {
-						_this.height = resu.windowHeight - res[0].top + 'px';
-						console.log('打印页面的剩余高度', _this.height);
-					});
-				},
-				fail: res => {}
-			});
-		},
+		
 		data() {
 			return {
 				userInfo: {},
-				yj: '',
+				userWallet: '', //余额
 				height: '',
 				// 头部图高度
 				maxheight: '',
@@ -129,29 +97,15 @@
 				orderStatusSum: 0,
 				recharge: 0,
 				navList: [
-					// {
-					// 	state: 0,
-					// 	text: '全部',
-					// 	loadingType: 'more',
-					// 	orderList: [],
-					// 	page: 1, //当前页数
-					// 	limit: 10 //每次信息条数
-					// },
 					{
-						state: 4,
-						// text: '历史充值',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
+					title: '充值',
+					time: '10.12',
+					money: '100',
 					},
 					{
-						state: 3,
-						// text: '历史提现',
-						loadingType: 'more',
-						orderList: [],
-						page: 1, //当前页数
-						limit: 10 //每次信息条数
+					title: '提现',
+					time: '10.12',
+					money: '300',
 					}
 				],
 				money: ''
@@ -159,11 +113,24 @@
 		},
 		onLoad(options) {},
 		onShow() {
-			this.extractBank()
-			this.getUserInfo()
+			this.getUserInfo();
 			this.loadData();
+			this.getUserWallet();
+			this.qianBao()
 		},
 		methods: {
+			// 钱包
+			async qianBao() {
+				const res = await qianBao()
+				console.log('qian', res);
+			},
+			
+			// 获取用户余额信息
+			getUserWallet() {
+				gameWallet().then((res) => {
+					this.userWallet = +res.data.back.USDT.money.money
+				})
+			},
 			getUserInfo() {
 				getUserInfo({}).then(({
 					data
@@ -171,12 +138,6 @@
 					this.userInfo = data
 				});
 			},
-			extractBank() {
-				extractBank().then(res => {
-					console.log(res)
-					this.yj = res.data.brokerage_price
-				})
-			},
 			toBack() {
 				uni.switchTab({
 					url: '/pages/index/user'
@@ -206,11 +167,8 @@
 				}
 				// 修改当前对象状态为加载中
 				navItem.loadingType = 'loading';
-
+			
 				spreadCommission({
-						page: navItem.page,
-						limit: navItem.limit,
-
 					}, state)
 					.then(({
 						data
@@ -237,11 +195,6 @@
 					});
 			},
 
-			//swiper 切换
-			changeTab(e) {
-				this.tabCurrentIndex = e.target.current;
-				this.loadData('tabChange');
-			},
 			//顶部tab点击
 			tabClick(index) {
 				this.tabCurrentIndex = index;
@@ -423,92 +376,7 @@
 		font-weight: bold;
 		color: #ffffff;
 	}
-
-
-	.navbar {
-		margin-top: 20rpx;
-		display: flex;
-		height: 88rpx;
-		padding: 0 5px;
-		background: #000;
-		box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
-		position: relative;
-		z-index: 10;
-
-		.nav-item {
-			flex: 1;
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			height: 100%;
-			font-size: 15px;
-			color: #ffffff;
-			position: relative;
-
-			&.current {
-				color: #ffffff;
-
-				&:after {
-					content: '';
-					position: absolute;
-					left: 50%;
-					bottom: 0;
-					transform: translateX(-50%);
-					width: 44px;
-					height: 0;
-					border-bottom: 2px solid #fdb242;
-				}
-			}
-		}
-	}
-
-	//列表
-	.swiper-box {
-		// background-color: #000000;
-		.order-item:last-child {
-			margin-bottom: 60rpx;
-		}
-
-		.order-item {
-			background-color: #000000;
-			padding: 20rpx 30rpx;
-			line-height: 1.5;
-
-			.title-box {
-				.title {
-					font-size: $font-lg;
-					color: #ffffff;
-				}
-
-				.time {
-					font-size: $font-base;
-					color: #999999 ;
-				}
-			}
-
-			.money {
-				color: #fdb242;
-				font-size: $font-lg;
-				text-align: right;
-
-				.status {
-					color: $font-color-light;
-				}
-			}
-		}
-	}
 	
-	// .heng {
-	// 	width: 696rpx;
-	// 	height: 1rpx;
-	// 	background: #F0F0F0;
-	// }
-
-	.list-scroll-content {
-		background: #ffffff;
-		height: 100%;
-	}
-
 	.content {
 		height: 100%;
 
@@ -517,22 +385,32 @@
 		}
 
 	}
-
-	.btn-box {
-		width: 674rpx;
-		height: 88rpx;
-		background: linear-gradient(0deg, #2e58ff, #32c6ff);
-		border-radius: 44rpx;
-		font-size: 36rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #ffffff;
-		text-align: center;
-		line-height: 88rpx;
-		position: fixed;
-		bottom: 48rpx;
-		left: 0;
-		right: 0;
-		margin: 0 auto;
+   
+   // border-bottom: 1px solid #ffffff;
+	.list {
+		margin: 40rpx 31rpx;
+			.tit {
+				height: 26rpx;
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #FFFFFF;
+			}
+			.tim {
+				padding-top: 30rpx;
+				height: 17rpx;
+				font-size: 22rpx;
+				font-weight: 400;
+				color: #999999;
+			}
+			.boxT {
+				.mon {
+					height: 23rpx;
+					font-size: 30rpx;
+					font-weight: bold;
+					color: #FDB242;
+				}
+				
+			}
 	}
+	
 </style>

+ 9 - 18
pages/user/money/withdrawal.vue

@@ -11,13 +11,14 @@
 				{{$t('userinfo.u7')}}
 			</view>
 			<view class="topF">
-				<input class="FF" v-model="withdrawal" :placeholder="placeholder" placeholder-class="placeholder" />
+				<input class="FF" type="text" v-model="withdrawal" placeholder="请输入提现地址" placeholder-class="placeholder" />
 			</view>
 			<view class="topS">
 				{{$t('userinfo.u8')}}
 			</view>
 			<view class="topF">
-				<input class="FF" v-model="withdrawal" :placeholder="placeholder" placeholder-class="placeholder" />
+				<input class="FF" type="text" v-model="withdrawal" placeholder="请输入提现数量" placeholder-class="placeholder" />
+			    <view class="btn">全部</view>
 			</view>
 		</view>
 		<view class="center">
@@ -42,7 +43,6 @@
 		data() {
 			return {
 				withdrawal: '', //提现地址
-				placeholder: '',
 			};
 		},
 		onLoad() {
@@ -57,7 +57,6 @@
 .all {
 	width: 750rpx;
 	height: 1334rpx;
-	background-color: #000000;
 }
 .top {
 	width: 690rpx;
@@ -69,10 +68,7 @@
 .topO {
 	height: 31rpx;
 	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
 	color: #FFFFFF;
-	line-height: 24rpx;
 	margin-left: 21rpx;
 	padding-top: 37rpx;
 }
@@ -88,10 +84,7 @@
 	width: 168rpx;
 	height: 20rpx;
 	font-size: 26rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
 	color: #FEB041;
-	line-height: 24rpx;
 	margin-left: 23rpx;
 	margin-top: 20rpx;
 }
@@ -100,10 +93,7 @@
 	margin-left: 20rpx;
 	height: 31rpx;
 	font-size: 32rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
 	color: #FFFFFF;
-	line-height: 24rpx;
 }
 .topF {
 	width: 648rpx;
@@ -115,12 +105,13 @@
 	margin-top: 39rpx;
 	.FF {
 		height: 25rpx;
-		font-size: 26rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
+		font-size: 32rpx;
+		color: #FFFFFF;
+		padding: 35rpx;
+	}
+	.btn {
+		font-size: 30rpx;
 		color: #FFFFFF;
-		line-height: 24rpx;
-		opacity: 0.51;
 	}
 }
 

+ 1 - 22
pages/user/shareQrCode.vue

@@ -33,9 +33,8 @@
 			};
 		},
 		onLoad() {
-			// this.test()
 			this.getGame()
-			// this.request()
+			
 			uni.setNavigationBarTitle({
 				title: this.$t("tab.a9"),
 			});
@@ -50,25 +49,6 @@
 			}, 1000);
 		},
 		methods: {
-			// async request() {
-			// 	try{
-			// 		const res1 = await test();   //第一个异步函数
-			// 		const res2 = await getGame();  //第二个异步函数
-					
-			// 		console.log('11',res1);
-			// 	}catch(error) {
-			// 		console.log(error);
-			// 	}
-			// }
-			// async test() {
-			//   try {
-			//     const res = await test();
-			//     console.log('312', res);
-			//   } catch (error) {
-			//     console.error('请求出错', error);
-			//   }
-			// },
-			
 			// 互娱记录
 			async getGame() {
 			  try {
@@ -86,7 +66,6 @@
 <style lang="scss">
 	.all {
 		width: 750rpx;
-		// height: 100%;
 		min-height: 100vh;
 		background-color: $page-color-base;
 	}