Browse Source

2023-10-20

zhang 1 year ago
parent
commit
6232c8613b

+ 4 - 4
libs/i18n/lang/en.json

@@ -41,10 +41,10 @@
 		"m19": "Join Now",
 		"b1": "Bet amount",
 		"b2": "Please enter the amount",
-		"b3": "确定",
-		"b4": "取消",
-		"b5": "请输入数字",
-		"b6": "质押成功"
+		"b3": "Confirm",
+		"b4": "Cancel",
+		"b5": "Please enter a number",
+		"b6": "Pledge successful"
 	},
 	"homeinformation":{
 		"m1":"Game Introduction",

+ 0 - 1
pages/index/pledge.vue

@@ -86,7 +86,6 @@
 				})
 			},
 			nav(url) {
-				console.log(url);
 				if (!this.hasLogin) {
 					// 保存地址
 					saveUrl();

+ 102 - 146
pages/myPledge/myPledge.vue

@@ -1,43 +1,25 @@
 <template>
 	<view class="all">
-		<view class="top">
-			<view class="zhiya"> {{ $t("myple.u1") }} </view>
+		<view class="top padding-v-30 padding-c-30">
+			<view class="zhiya padding-b-10"> {{ $t("myple.u1") }} </view>
 			<view class="zhiyashu">
-				<p class="shu">241,142,574.25</p>
-				<p class="wen">USDT</p>
+				<text class="shu">{{money|getMoneyStyle}}</text>
+				<text class="wen padding-l-10">USDT</text>
 			</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 v-for="(item, index) in navList" :key="index" class="nav-item"
+				:class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
 		</view>
-		<swiper
-			:current="tabCurrentIndex"
-			:style="{ height: height }"
-			class="swiper-box"
-			duration="300"
+		<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">
+			<swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
+				<scroll-view scroll-y="true" class="list-scroll-content" @scrolltolower="loadData">
 					<!-- 空白页 -->
-					<!-- 	<empty
-						v-if="
+					<empty v-if="
 							tabItem.loaded === true &&
 							tabItem.orderList.length === 0
-						"></empty> -->
+						"></empty>
 					<!-- 订单列表 -->
 					<view>
 						<!-- <view class="order-item flex" > -->
@@ -60,10 +42,7 @@
 								</view>
 							</view>
 							<view class="heng"></view>
-							<view
-								class="all-list"
-								v-for="item in 10"
-								:key="item">
+							<view class="all-list" v-for="(item,ind) in navList[tabCurrentIndex].orderList" :key="ind">
 								<view class="list">
 									<view class="list-item">
 										<view class="item"> 100 </view>
@@ -74,25 +53,19 @@
 										<view class="item"> USDT </view>
 									</view>
 									<view class="list-item">
-										<view
-											class="item"
-											style="margin-top: 18rpx">
+										<view class="item" style="margin-top: 18rpx">
 											7天
 										</view>
 									</view>
 									<view class="list-item">
 										<view class="l-item"> 2023.12.02 </view>
-										<view
-											class="l-item"
-											style="margin-top: 20rpx">
+										<view class="l-item" style="margin-top: 20rpx">
 											12:00:00
 										</view>
 									</view>
 									<view class="list-item">
 										<view class="l-item"> 2023.12.02 </view>
-										<view
-											class="l-item"
-											style="margin-top: 20rpx">
+										<view class="l-item" style="margin-top: 20rpx">
 											12:00:00
 										</view>
 									</view>
@@ -104,9 +77,6 @@
 							</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>
@@ -114,17 +84,17 @@
 </template>
 
 <script>
-	import { mapState, mapMutations } from "vuex";
-	import { getCommissionInfo, getUserInfo } from "@/api/user.js";
-	import { getLock } from "@/api/mypledge.js";
-	import { getMoneyStyle } from "@/utils/rocessor.js";
-	import { mapGetters } from "vuex";
+	import {
+		getUserInfo
+	} from "@/api/user.js";
+	import {
+		getLock
+	} from "@/api/mypledge.js";
 	import empty from "@/components/empty";
 	import {
-		spreadCommission,
-		userBalance,
-		// extractBank,
-	} from "@/api/wallet.js";
+		getTime
+	} from '@/utils/rocessor.js';
+	import { getMoneyStyle } from "@/utils/rocessor.js";
 	export default {
 		filters: {
 			getMoneyStyle,
@@ -137,49 +107,38 @@
 			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);
+					query.select('.swiper-box').boundingClientRect();
+					query.exec(function(res) {
+						console.log(resu);
+						_this.height = resu.windowHeight - res[0].top + 'px';
+						console.log('打印页面的剩余高度', _this.height);
 					});
 				},
-				fail: res => {},
+				fail: res => {}
 			});
 		},
 		data() {
 			return {
 				userInfo: {},
-				yj: "",
 				height: "",
-				// 头部图高度
-				maxheight: "",
 				tabCurrentIndex: 0,
-				orderStatusSum: 0,
-				recharge: 0,
-				navList: [
-					// {
-					// 	state: 0,
-					// 	text: '全部',
-					// 	loadingType: 'more',
-					// 	orderList: [],
-					// 	page: 1, //当前页数
-					// 	limit: 10 //每次信息条数
-					// },
-					{
-						state: 4,
+				navList: [{
+						state: 1,
 						text: "进行中",
 						loadingType: "more",
 						orderList: [],
 						page: 1, //当前页数
 						limit: 10, //每次信息条数
+						loaded: false
 					},
 					{
-						state: 3,
+						state: 2,
 						text: "已结束",
 						loadingType: "more",
 						orderList: [],
 						page: 1, //当前页数
 						limit: 10, //每次信息条数
+						loaded: false
 					},
 				],
 				money: "",
@@ -188,25 +147,21 @@
 		onLoad(options) {
 			uni.setNavigationBarTitle({
 				title: this.$t("tab.a1"),
-				 
 			});
 		},
 		onShow() {
 			this.getUserInfo();
 			this.loadData();
-			this.getLock();
 		},
 		methods: {
+			getTime,
 			getUserInfo() {
-				getUserInfo({}).then(({ data }) => {
+				getUserInfo({}).then(({
+					data
+				}) => {
 					this.userInfo = data;
 				});
 			},
-			async getLock() {
-				const res = await getLock();
-				console.log("123", res);
-			},
-
 			toBack() {
 				uni.switchTab({
 					url: "/pages/pledge/pledge",
@@ -220,53 +175,57 @@
 			},
 			//获取收入支出信息
 			async loadData(source) {
-				let obj = this;
+				const that = this;
 				//这里是将订单挂载到tab列表下
-				let index = this.tabCurrentIndex;
-				let navItem = this.navList[index];
+				let index = that.tabCurrentIndex;
+				let navItem = that.navList[index];
 				let state = navItem.state;
-				if (source === "tabChange" && navItem.loaded === true) {
+				if (source === 'tabChange' && navItem.loaded === true) {
 					//tab切换只有第一次需要加载数据
 					return;
 				}
-				if (navItem.loadingType === "loading") {
+				if (navItem.loadingType === 'loading') {
+					//防止重复加载
+					return;
+				}
+				if (navItem.loadingType === 'noMore') {
 					//防止重复加载
 					return;
 				}
 				// 修改当前对象状态为加载中
-				// navItem.loadingType = 'loading';
-				spreadCommission(
-					{
+				navItem.loadingType = 'loading';
+
+				getLock({
+						status: state,
 						page: navItem.page,
-						limit: navItem.limit,
-					},
-					state
-				)
-					.then(({ data }) => {
-						if (data.length > 0) {
-							data.forEach(e => {
-								navItem.orderList = navItem.orderList.concat(
-									e.list
-								);
-							});
-							console.log(navItem.orderList);
-							navItem.page++;
-						}
-						//判断是否还有数据, 有改为more, 没有改为noMore
+						limit: navItem.limit
+					})
+					.then(({
+						data
+					}) => {
+						// 保存我的总金额
+						that.money = data.sum;
+						
+						let arr = data.list.map(e => {
+							return e;
+						});
+						navItem.orderList = navItem.orderList.concat(arr);
 						if (navItem.limit == data.length) {
-							navItem.loadingType = "more";
+							navItem.page++;
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'more';
 							return;
 						} else {
-							navItem.loadingType = "noMore";
+							//判断是否还有数据, 有改为 more, 没有改为noMore
+							navItem.loadingType = 'noMore';
 						}
 						uni.hideLoading();
-						this.$set(navItem, "loaded", true);
+						that.$set(navItem, 'loaded', true);
 					})
 					.catch(e => {
 						console.log(e);
 					});
 			},
-
 			//swiper 切换
 			changeTab(e) {
 				this.tabCurrentIndex = e.target.current;
@@ -283,48 +242,37 @@
 <style lang="scss">
 	.all {
 		width: 750rpx;
-		height: 1660rpx;
 		background-color: $page-color-base;
 	}
+
 	.top {
-		margin-left: 30rpx;
-		width: 690rpx;
-		height: 137rpx;
+		margin: 0 30rpx;
+		height: 138rpx;
 		background-color: #191a1f;
-	}
-	.zhiya {
-		margin-left: 28rpx;
-		// margin-top: 31rpx;
-		padding-top: 31rpx;
-		height: 21rpx;
-		font-size: 21rpx;
-		font-family: PingFang SC;
-		font-weight: 500;
-		color: #757c8f;
-	}
-	.zhiyashu {
-		display: flex;
-		justify-content: start;
-	}
-	.shu {
-		margin-left: 29rpx;
-		margin-top: 30rpx;
-		font-size: 32rpx;
-		height: 30rpx;
-		color: #ffffff;
-		font-family: PingFang SC;
-		font-weight: bold;
-	}
-	.wen {
-		margin-left: 20rpx;
-		margin-top: 36rpx;
-		height: 26rpx;
-		font-size: 26rpx;
-		font-family: PingFang SC;
 		font-weight: bold;
 		color: #ffffff;
+		border-radius:20rpx ;
+
+		.zhiya {
+			font-size: $font-sm;
+			color: #757c8f;
+		}
+
+		.zhiyashu {
+			.shu {
+				font-size: $font-lg;
+			}
+
+			.wen {
+				font-size: $font-base;
+			}
+		}
 	}
 
+
+
+
+
 	.body {
 		background-color: #191a1f;
 		margin-left: 30rpx;
@@ -342,6 +290,7 @@
 		box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
 		position: relative;
 		z-index: 10;
+
 		.nav-item {
 			flex: 1;
 			display: flex;
@@ -351,8 +300,10 @@
 			font-size: 15px;
 			color: #999999;
 			position: relative;
+
 			&.current {
 				color: #fff;
+
 				&:after {
 					content: "";
 					position: absolute;
@@ -371,12 +322,14 @@
 	.order-item {
 		background: #191a1f;
 	}
+
 	.title-box {
 		margin-left: 38rpx;
 		display: flex;
 		justify-content: space-between;
 		width: 690rpx;
 	}
+
 	.title {
 		flex: 1;
 		margin-top: 30rpx;
@@ -397,6 +350,7 @@
 		justify-content: space-between;
 		width: 690rpx;
 	}
+
 	.item {
 		height: 40rpx;
 		font-size: 22rpx;
@@ -405,6 +359,7 @@
 		color: #ffffff;
 		line-height: 23rpx;
 	}
+
 	.l-item {
 		height: 15rpx;
 		font-size: 18rpx;
@@ -419,6 +374,7 @@
 		height: 2rpx;
 		background: #e9e9e9;
 	}
+
 	.btn-box {
 		width: 674rpx;
 		height: 88rpx;
@@ -436,4 +392,4 @@
 		right: 0;
 		margin: 0 auto;
 	}
-</style>
+</style>

+ 5 - 4
pages/myPledge/zyXingqing.vue

@@ -100,8 +100,8 @@
 			<inputPassword @commit='KeyInfo'></inputPassword>
 		</uni-popup>
 		<uni-popup ref="inputDialog" type="dialog">
-			<uni-popup-dialog ref="inputClose" mode="input" title="押注金额" :value="num" placeholder="请输入购买金额(USDT)"
-				@confirm="joinNum" confirmText='确定' cancelText='取消'></uni-popup-dialog>
+			<uni-popup-dialog ref="inputClose" mode="input" :title="$t('zy.b1')" :value="num" :placeholder="$t('zy.b2')"
+				@confirm="joinNum" :confirmText="$t('zy.b3')" :cancelText="$t('zy.b4')"></uni-popup-dialog>
 		</uni-popup>
 	</view>
 </template>
@@ -131,6 +131,7 @@
 				num: '',
 			};
 		},
+		
 		onLoad(option) {
 			this.id = option.id;
 			uni.setNavigationBarTitle({
@@ -158,7 +159,7 @@
 			joinNum(e) {
 				if (isNaN(Number(e))) {
 					uni.showToast({
-						title: "请输入数字",
+						title: this.$t("zy.b5"),
 						icon: "error"
 					})
 					return
@@ -180,7 +181,7 @@
 				lockJoin(data).then(
 					(res) => {
 						uni.showToast({
-							title:"质押成功"
+							title: this.$t("zy.b6"),
 						})
 						that.gameWallet();
 					}

+ 6 - 2
pages/user/shareQrCode.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="all" >
-		<view class="list" v-for="item in 12" :key="item">
+		<view class="list" v-for="item in 12" :key="item" :style="{color: item.status === '待开奖' ? 'green' : item.status === '已中奖' ? 'red' : 'yellow'}">
 			<view class="listO">
 				<view class="li">{{$t('set.a7')}}2022010223{{$t('set.a8')}}</view>
 				<view class="lis">
@@ -29,7 +29,11 @@
 	export default {
 		data() {
 			return {
-				
+				item: [
+					{
+						status: '待开奖'
+					}
+				]
 			};
 		},
 		onLoad() {