cmy 2 anos atrás
pai
commit
7225b1825c

+ 4 - 23
components/input-password/input-password.vue

@@ -32,29 +32,9 @@
 		// 关闭循环
 		methods: {
 			// 点击触发支付事件
-			onPayBet(type) {
-				if (!this.upOnBtnData.value) {
-					uni.showToast({
-						title: this.$t('enter.a9'),
-						icon: "error"
-					})
-					return
-				}
-				if (!this.history.next) {
-					uni.showModal({
-						title: this.$t('enter.c4'),
-						content: "活动未开启,请等待活动开启",
-						showCancel: false,
-					});
-					return
-				}
-				this.upOnBtnData.type = type;
-				this.openPayPassword();
-			},
-
 			KeyInfo(val) {
 				console.log(val);
-				let arr = this.upOnBtnData.passwordArr;
+				let arr = this.passwordArr;
 				if (val.index >= 6) {
 					return;
 				}
@@ -72,8 +52,9 @@
 				}
 				// 开始交易
 				if (arr.length == 6) {
-					this.colsePayPassword();
-					this.gameBetIn();
+					this.$emit('commit',this.passwordArr.join(''))
+					//初始化对象
+					this.passwordArr = [];
 				}
 			},
 		},

+ 14 - 119
pages/index/entertainment.vue

@@ -134,23 +134,7 @@
 			</view>
 		</view>
 		<uni-popup type="bottom" ref="popup" :mask-click="false" @maskClick='colsePayPassword'>
-			<view class="page">
-				<view>
-					<view class="pay-title">
-						<text>{{$t('enter.b3')}}</text>
-					</view>
-					<view class="pay-password" @click="onPayUp">
-						<view class="list" v-for="item in 6">
-							<text v-show="upOnBtnData.passwordArr.length >= item">●</text>
-						</view>
-					</view>
-					<view class="hint">
-						<text @click="nav('/pages/user/set/transaction')">忘记支付密码?</text>
-					</view>
-				</view>
-				<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"
-					:viewShow="true"></cc-defineKeyboard>
-			</view>
+			<inputPassword @commit='KeyInfo'></inputPassword>
 		</uni-popup>
 		<uni-popup type="center" ref="popupDetail">
 			<view class="alert-detail">
@@ -205,7 +189,6 @@
 </template>
 
 <script>
-	import LEchart from '@/uni_modules/lime-echart/components/l-echart/l-echart.vue';
 	import * as echarts from '@/uni_modules/lime-echart/static/echarts.min'
 	import {
 		getGame,
@@ -227,14 +210,11 @@
 	import {
 		getTime
 	} from '@/utils/rocessor.js';
-	import {
-		clearInterval,
-		setInterval
-	} from 'timers';
+	import inputPassword from "@/components/input-password/input-password.vue";
 	export default {
 		components: {
 			taber,
-			LEchart
+			inputPassword
 		},
 		computed: {
 			...mapState("user", ["hasLogin"]),
@@ -280,7 +260,7 @@
 					show: false,
 					type: '',
 					// 当前输入的密码
-					passwordArr: [],
+					passwordArr: '',
 					value: '',
 				},
 				// 弹窗数据像晴
@@ -370,30 +350,11 @@
 				this.upOnBtnData.show = false;
 				this.$refs.popup.close();
 			},
-
+			// 密码输入完成后调用下注
 			KeyInfo(val) {
-				console.log(val);
-				let arr = this.upOnBtnData.passwordArr;
-				if (val.index >= 6) {
-					return;
-				}
-				// 判断是否输入的是删除键
-				if (val.keyCode === 8) {
-					// 删除最后一位
-					arr.splice(val.index + 1, 1)
-				}
-				// 判断是否输入的是取消案件
-				else if (val.keyCode == 190) {
-					this.colsePayPassword();
-					// 输入.无效
-				} else {
-					arr.push(val.key);
-				}
-				// 开始交易
-				if (arr.length == 6) {
-					this.colsePayPassword();
-					this.gameBetIn();
-				}
+				this.upOnBtnData.passwordArr = val;
+				this.colsePayPassword();
+				this.gameBetIn();
 			},
 			// 参与压住
 			gameBetIn(type) {
@@ -402,9 +363,8 @@
 					id: that.history.next.id,
 					bet: that.upOnBtnData.type,
 					num: that.upOnBtnData.value,
-					trade_password: that.upOnBtnData.passwordArr.join("")
+					trade_password: that.upOnBtnData.passwordArr
 				};
-				this.upOnBtnData.passwordArr = [];
 				uni.showLoading({
 					mask: true
 				})
@@ -432,11 +392,6 @@
 			async opTiem() {
 				const that = this;
 				try {
-					console.log('kaishidaojishi');
-					// 关闭循环
-					// if (that.time.t) {
-					// 	clearInterval(that.time.t);
-					// }
 					// 判斷是否有游戲信息并且有正在進行中游戏
 					if (that.history.base.id && that.history.next) {
 						console.log(that.history.base.id, that.history.next,
@@ -451,7 +406,6 @@
 			},
 			// 获取倒计时时间
 			getOutTime() {
-				console.log('计算');
 				const that = this;
 				const da = (new Date()).getTime();
 				const timenum = that.history.next.open_time * 1000 - da;
@@ -472,6 +426,7 @@
 				}
 
 			},
+			// 游戏tab切换
 			changeTab(item, ind) {
 				const that = this;
 				if (ind != this.actionIndex) {
@@ -484,10 +439,10 @@
 			},
 			// 初始化
 			async gameInit() {
-					// 获取游戏列表
-					await this.getGameList();
-					// 加载游戏数据
-					this.gameDataInit(this.history.base.id || this.gameList[0].id)
+				// 获取游戏列表
+				await this.getGameList();
+				// 加载游戏数据
+				this.gameDataInit(this.history.base.id || this.gameList[0].id)
 
 			},
 			// 加载游戏列表
@@ -796,66 +751,6 @@
 		padding-bottom: 30rpx;
 	}
 
-	$base: orangered; // 基础颜色
-
-	.page {
-		width: 100%;
-		background-color: #FFFFFF;
-
-		.pay-title {
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			width: 100%;
-			height: 200rpx;
-
-			text {
-				font-size: 28rpx;
-				color: #555555;
-			}
-		}
-
-		.pay-password {
-			display: flex;
-			align-items: center;
-			width: 90%;
-			height: 80rpx;
-			margin: 20rpx auto;
-			border: 2rpx solid $base;
-
-			.list {
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				width: 16.666%;
-				height: 100%;
-				border-right: 2rpx solid #EEEEEE;
-
-				text {
-					font-size: 32rpx;
-				}
-			}
-
-			.list:nth-child(6) {
-				border-right: none;
-			}
-		}
-
-		.hint {
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			width: 100%;
-			height: 100rpx;
-
-			text {
-				font-size: 28rpx;
-				color: $base;
-			}
-		}
-	}
-
-
 	.tab {
 		padding: 30rpx 20rpx;
 		margin: 0 30rpx;

+ 50 - 15
pages/myPledge/zyXingqing.vue

@@ -62,7 +62,8 @@
 
 				<view class="icon flex-start">
 					<image class="ic" src="../../static/img/xq3.png" mode=""></image>
-					<view class="jiaru">{{$t('zy.m14')}}:{{base.single_time_max*1}}*({{base.day_get}}%+100%)*{{base.day}}</view>
+					<view class="jiaru">
+						{{$t('zy.m14')}}:{{base.single_time_max*1}}*({{base.day_get}}%+100%)*{{base.day}}</view>
 				</view>
 
 				<view class="icon flex-start">
@@ -94,6 +95,9 @@
 				<view class="jia">{{$t('zy.m19')}}</view>
 			</view>
 		</view>
+		<uni-popup type="bottom" ref="popup">
+			<inputPassword @commit='KeyInfo'></inputPassword>
+		</uni-popup>
 	</view>
 </template>
 
@@ -105,13 +109,21 @@
 	import {
 		gameWallet
 	} from "@/api/game.js";
+	import inputPassword from "@/components/input-password/input-password.vue";
 	export default {
+		components: {
+			inputPassword
+		},
 		data() {
 			return {
 				id: '',
 				base: {},
 				userWallet: '',
-				allMoney:'',
+				allMoney: '',
+				// 保存支付密码
+				password: '',
+				//购买的数量
+				num: '',
 			};
 		},
 		onLoad(option) {
@@ -124,19 +136,33 @@
 			this.gameWallet();
 		},
 		methods: {
-			joinLock(){
+			// 关闭支付弹窗
+			colsePayPassword() {
+				this.$refs.popup.close();
+			},
+			KeyInfo(val) {
+				this.password = val;
+				this.colsePayPassword();
+				this.joinLock();
+			},
+			// 购买数量
+			joinNum() {
+
+			},
+			// 购买质押
+			joinLock() {
 				lockJoin({
-					id:this.id,
-					number:this.num,
-					trade_password:this.password
+					id: this.id,
+					number: this.num,
+					trade_password: this.password
 				}).then(
-				(res) => {
-					console.log(res);
-				}
+					(res) => {
+						console.log(res);
+					}
 				).then(
-				() => {
-					
-				}
+					() => {
+
+					}
 				)
 			},
 			gameWallet() {
@@ -151,7 +177,8 @@
 				}).then(
 					(res) => {
 						that.base = res.data.data;
-						that.allMoney = that.base.single_time_max*(that.base.day_get*1+100)*that.base.day/100;
+						that.allMoney = that.base.single_time_max * (that.base.day_get * 1 + 100) * that.base.day /
+						100;
 					}
 				).catch(
 					(res) => {
@@ -164,9 +191,10 @@
 </script>
 
 <style lang="scss">
-	page{
+	page {
 		background-color: #191a1f;
 	}
+
 	.all {
 		line-height: 1;
 		padding-bottom: 190rpx;
@@ -175,6 +203,7 @@
 	.shang {
 		font-weight: 800;
 		background-color: $page-color-base;
+
 		.tz {
 			font-size: 33rpx;
 			color: #FFFFFF;
@@ -222,6 +251,7 @@
 
 	.sygc {
 		background-color: $page-color-base;
+
 		.gc {
 			font-size: 28rpx;
 			font-weight: 800;
@@ -246,6 +276,7 @@
 
 	.wenben {
 		background-color: $page-color-base;
+
 		.wb {
 			width: 33.3%;
 
@@ -259,6 +290,7 @@
 
 	.icon-box {
 		background-color: $page-color-base;
+
 		.icon:nth-child(2n-1) {
 			background: #161616;
 		}
@@ -282,6 +314,7 @@
 			}
 		}
 	}
+
 	.jine {
 		background-color: $page-color-base;
 		font-weight: 800;
@@ -320,6 +353,7 @@
 			color: #FEB041;
 		}
 	}
+
 	.liji {
 		padding: 40rpx 30rpx;
 		position: fixed;
@@ -327,7 +361,8 @@
 		left: 0;
 		right: 0;
 		background-color: $page-color-base;
-		box-shadow:0rpx 0rpx 20rpx  #FFF;
+		box-shadow: 0rpx 0rpx 20rpx #FFF;
+
 		.jr {
 			background: linear-gradient(90deg, #feb041 0%, #feb041 100%);
 			border-radius: 10rpx;