Browse Source

2023-10-19

cmy 1 year ago
parent
commit
6923f2bd00
6 changed files with 115 additions and 269 deletions
  1. 1 6
      manifest.json
  2. 0 5
      pages.json
  3. 66 47
      pages/game/history.vue
  4. 47 32
      pages/index/entertainment.vue
  5. 0 178
      pages/user/set/phone.vue
  6. 1 1
      store/index.js

+ 1 - 6
manifest.json

@@ -74,12 +74,7 @@
         "devServer" : {
             "proxy" : {
                 "/api" : {
-					// kline.ns.liuniu946.com
-                    "target" : "http://kline.ns.liuniu946.com/api/",
-                    // "changeOrigin": true,
-                    "pathRewrite" : {
-                        "/api" : "" // rewrite path
-                    }
+                    "target" : "http://www.accle.shop/"
                 }
             }
         }

+ 0 - 5
pages.json

@@ -177,11 +177,6 @@
 					"enablePullDownRefresh": false
 				}
 
-			}, {
-				"path": "set/phone",
-				"style": {
-					"navigationBarTitleText": "实名认证"
-				}
 			},
 			{
 				"path": "set/password",

+ 66 - 47
pages/game/history.vue

@@ -1,6 +1,6 @@
 <template>
-	<view class="all">
-		<view class="list" v-for="item in 25" :key="item">
+	<view class="all padding-v-30 padding-c-30">
+		<view class="list flex" v-for="(item,ind) in list" :key="ind">
 			<view class="le">
 				<view class="qs">第2022010223期</view>
 				<view class="dy">0.064489</view>
@@ -21,67 +21,86 @@
 	import {
 		gameBetList
 	} from "@/api/game.js";
+	import empty from '@/components/empty';
 	export default {
+		components: {
+			empty
+		},
 		data() {
-			return {}
+			return {
+				id: '',
+				page: 1,
+				limit: 10,
+				loadingType: 'more',
+				loaded: false,
+				list: []
+			}
+		},
+		onLoad(option) {
+			this.id = option.id;
+			this.gameBetList()
+		},
+		onReachBottom() {
+			this.gameBetList()
+		},
+		methods: {
+			gameBetList() {
+				let that = this
+				if (that.loadingType == 'loading' || that.loadingType == 'noMore') {
+					return
+				}
+				gameBetList({
+					page: that.page,
+					limit: that.limit,
+					id: that.id,
+				}).then(res => {
+					let list = res.data.bet_log
+					that.list = that.list.concat(list)
+					that.page++
+					if (list.length == that.limit) {
+						that.loadingType = 'more'
+					} else {
+						that.loadingType = 'noMore'
+					}
+					that.loaded = true
+				})
+			}
 		},
-		onLoad() {},
-		methods: {},
 	};
 </script>
 
 <style lang="scss">
-	.all {
-		width: 750rpx;
-		min-height: 100vh;
-		background-color: $page-color-base;
-	}
 
 	.list {
-		display: flex;
-		justify-content: start;
-		width: 750rpx;
-		height: 150rpx;
-	}
+		.le {
+			font-weight: bold;
 
-	.qs {
-		height: 19rpx;
-		font-size: 20rpx;
-		font-weight: 500;
-		color: #ffffff;
-		margin-top: 27rpx;
-		margin-left: 30rpx;
-	}
+			.qs {
+				font-size: 20rpx;
+				color: #ffffff;
+			}
 
-	.dy {
-		height: 35rpx;
-		font-size: 46rpx;
-		font-weight: bold;
-		color: #fdb242;
-		margin-top: 14rpx;
-		margin-left: 30rpx;
+			.dy {
+				font-size: 46rpx;
+				color: #fdb242;
+			}
+
+		}
 	}
 
+
+
+
 	.ri {
 		display: flex;
 		justify-content: start;
 		margin-left: -45rpx;
-	}
-
-	.sx {
-		height: 28rpx;
-		font-size: 30rpx;
-		font-weight: bold;
-		color: #df5660;
-		margin-top: 50rpx;
-	}
-
-	.xian {
-		width: 696rpx;
-		height: 2rpx;
-		background: #f0f0f0;
-		opacity: 0.35;
-		margin-left: 30rpx;
-		margin-top: 43rpx;
+		.sx {
+			height: 28rpx;
+			font-size: 30rpx;
+			font-weight: bold;
+			color: #df5660;
+			margin-top: 50rpx;
+		}
 	}
 </style>

+ 47 - 32
pages/index/entertainment.vue

@@ -87,7 +87,7 @@
 		<view class="last">
 			<view class="flex">
 				<text>{{$t('enter.u9')}}</text>
-				<view class="flex" @click="nav('/pages/game/history')">
+				<view class="flex" @click="nav(`/pages/game/history?id=${history.base.id}`)">
 					<text>{{$t('enter.u10')}}</text>
 					<image class="lb" src="../../static/icon/jt.png" mode="scaleToFill"></image>
 				</view>
@@ -112,7 +112,7 @@
 				</view>
 				<view class="biwe">{{item.num*1}}</view>
 				<view class="biwe">{{item.get-item.num}}</view>
-				<view class="biwe flex">
+				<view class="biwe flex-center">
 					<view v-if="item.status==1" class="list-buttom success margin-r-10">
 						{{$t('enter.u17')}}
 					</view>
@@ -122,7 +122,7 @@
 				</view>
 			</view>
 		</view>
-		
+
 		<view class="chz flex" @click="nav('/pages/user/money/recharge')">
 			<view>
 				<view class="yue padding-b-10">{{$t('enter.u15')}}</view>
@@ -145,9 +145,7 @@
 						</view>
 					</view>
 					<view class="hint">
-						<navigator url="/pages/transaction/transaction">
-							<text>忘记支付密码?</text>
-						</navigator>
+						<text @click="nav('/pages/user/set/transaction')">忘记支付密码?</text>
 					</view>
 				</view>
 				<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"
@@ -232,6 +230,9 @@
 	import {
 		getTime
 	} from '@/utils/rocessor.js';
+	import {
+		clearInterval
+	} from 'timers';
 	export default {
 		components: {
 			taber,
@@ -287,7 +288,9 @@
 				// 弹窗数据像晴
 				alertDetail: {
 
-				}
+				},
+				// 保存获取下次游戏对象
+				getNextTimeObj: ''
 			};
 		},
 		onLoad() {},
@@ -309,6 +312,7 @@
 				return
 			}
 			this.getUserWallet();
+			this.gameInit();
 		},
 		// 关闭循环
 		onHide() {
@@ -331,6 +335,14 @@
 					})
 					return
 				}
+				if (!this.history.next) {
+					uni.showModal({
+						title: this.$t('enter.c4'),
+						content: "活动未开启,请等待活动开启",
+						showCancel: false,
+					});
+					return
+				}
 				this.upOnBtnData.type = type;
 				this.openPayPassword();
 			},
@@ -401,41 +413,40 @@
 				gameWallet().then((res) => {
 					this.userWallet = +res.data.back.USDT.money.money
 				})
-				if (this.history.next.id) {
-					this.opTiem();
-				} else {
-					this.gameInit();
-				}
 			},
 			// 开始倒计时
 			async opTiem() {
 				const that = this;
 				try {
+					console.log('kaishidaojishi');
 					// 关闭循环
-					clearInterval(that.time.t);
+					// 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,
 							'that.history.base.id && that.history.next');
-						that.time.t = setInterval(() => {
-							const da = (new Date()).getTime();
-							const timenum = that.history.next.open_time * 1000 - da;
-							that.time.H = Math.floor(timenum / 1000 / 60 / 60);
-							that.time.S = Math.floor(timenum / 1000 % 60)
-							that.time.M = Math.floor(timenum / 1000 / 60 % 60);
-							if (that.time.H == 0 && that.time.M == 0 && that.time.S == 0) {
-								clearInterval(that.time.t);
-								setTimeout(() => {
-									setTimeout(() => {
-										this.gameDataInit(that.gameList[that.actionIndex].id)
-									}, 1000)
-								}, 3000)
-
-							}
+						that.time.t = setTimeout(() => {
+							// that.getOutTime();
 						}, 1000)
+						clearTimeout(that.time.t);
 					}
 				} catch (e) {
 					console.log(e, '定时');
 				}
+			},
+			// 获取倒计时时间
+			getOutTime() {
+				const that = this;
+				const da = (new Date()).getTime();
+				const timenum = that.history.next.open_time * 1000 - da;
+				that.time.H = Math.floor(timenum / 1000 / 60 / 60);
+				that.time.S = Math.floor(timenum / 1000 % 60)
+				that.time.M = Math.floor(timenum / 1000 / 60 % 60);
+				if (that.time.H == 0 && that.time.M == 0 && that.time.S == 0) {
+					clearInterval(that.time.t);
+					that.getGame(that.history.base.id)
+				}
 
 			},
 			changeTab(item, ind) {
@@ -480,7 +491,6 @@
 					id: this.history.base.id,
 				}).then((res) => {
 					this.betList.list = res.data.bet_log;
-					console.log('aaa', this.betList.list);
 				})
 			},
 			// 获取游戏K线信息
@@ -515,19 +525,24 @@
 				})
 			},
 			// 获取当前项目信息
-			getGame(type) {
+			getGame(id) {
 				const that = this;
 				return getGame({
 					page: that.history.page,
 					limit: that.history.limit
-				}, type).then(({
+				}, id).then(({
 					data
 				}) => {
 					that.history.list = data.list || [];
 					that.history.base = data.game || {};
 					that.history.next = data.next_game || '';
 					that.history.now = data.now_game || '';
-					if (that.history.next) {
+					if (!that.history.next && !that.getNextTimeObj) {
+						setTimeout(() => {
+							that.getGame(id)
+						}, 1000)
+					}
+					if (that.history.next && !that.getNextTimeObj) {
 						that.opTiem();
 					}
 				})

+ 0 - 178
pages/user/set/phone.vue

@@ -1,178 +0,0 @@
-<template>
-	<view class="container">
-		<view class="row b-b">
-			<text class="tit">手机号</text>
-			<input class="input" v-model="account" type="text" placeholder="请填写手机号" placeholder-class="placeholder" />
-		</view>
-		<view>
-			<view class="row b-b">
-				<text class="tit">验证码</text>
-				<input class="input" v-model="captcha" type="text" placeholder="请填写验证码"
-					placeholder-class="placeholder" />
-				<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
-			</view>
-			<button class="add-btn" :class="{ 'bg-gray': loding }" @click="loding ? '' : confirm()">提交</button>
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		verify
-	} from '@/api/login.js';
-	import {
-		mapState
-	} from 'vuex';
-	import {
-		registerReset,
-		binding
-	} from '@/api/set.js';
-	export default {
-		data() {
-			return {
-				time: '', //保存倒计时对象
-				countDown: 0, //倒计时
-				account: '', //手机号
-				captcha: '', //验证码
-				password: '', //新密码
-				loding: false //是否载入中
-			};
-		},
-		watch: {
-			// 监听倒计时
-			countDown(i) {
-				if (i == 0) {
-					clearInterval(this.time);
-				}
-			}
-		},
-		computed: {
-			...mapState(['userInfo'])
-		},
-		onLoad() {
-			if (this.userInfo.phone == null) {
-				this.account = '';
-			} else {
-				this.account = this.userInfo.phone;
-				this.show = false;
-			}
-		},
-		methods: {
-			//发送验证码
-			verification() {
-				let obj = this;
-				if (this.account == '') {
-					this.$api.msg('请输入电话号码');
-					return;
-				}
-				if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.account)) {
-					this.$api.msg('请输入正确的手机号');
-					return;
-				}
-				// 判断是否在倒计时
-				if (obj.countDown > 0) {
-					return false;
-				} else {
-					obj.countDown = 60;
-					obj.time = setInterval(() => {
-						obj.countDown--;
-					}, 1000);
-					//调用验证码接口
-					verify({
-							phone: obj.account,
-							type: 'BDING_CODE'
-						})
-						.then(({
-							data
-						}) => {})
-						.catch(err => {
-							console.log(err);
-						});
-				}
-			},
-			confirm(e) {
-				let obj = this;
-				obj.loding = true;
-				binding({
-						phone: obj.account,
-						captcha: obj.captcha
-					})
-					.then(({
-						data
-					}) => {
-						obj.$api.msg('绑定成功!');
-						setTimeout(function() {
-							obj.loding = false;
-							uni.switchTab({
-								url: '/pages/user/user'
-							});
-						}, 1000);
-					})
-					.catch(err => {
-						obj.loding = false;
-						console.log(err);
-					});
-			}
-		}
-	};
-</script>
-
-<style lang="scss">
-	page {
-		background: $page-color-base;
-	}
-
-	.row {
-		display: flex;
-		align-items: center;
-		position: relative;
-		padding: 0 30rpx;
-		height: 110rpx;
-		background: #fff;
-
-		.tit {
-			flex-shrink: 0;
-			width: 120rpx;
-			font-size: 30rpx;
-			color: $font-color-dark;
-		}
-
-		.input {
-			flex: 1;
-			font-size: 30rpx;
-			color: $font-color-dark;
-		}
-
-		.iconlocation {
-			font-size: 36rpx;
-			color: $font-color-light;
-		}
-	}
-
-	.add-btn {
-		display: flex;
-		align-items: center;
-		justify-content: center;
-		width: 690rpx;
-		height: 80rpx;
-		margin: 60rpx auto;
-		font-size: $font-lg;
-		color: #fff;
-		background-color: $base-color;
-		border-radius: 10rpx;
-		// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
-	}
-
-	.bg-gray {
-		background-color: $color-gray;
-	}
-
-	.code {
-		color: #9C0B18;
-		font-size: 23rpx;
-		border-left: 1px solid #eeeeee;
-		width: 150rpx;
-		flex-shrink: 0;
-		text-align: center;
-	}
-</style>

+ 1 - 1
store/index.js

@@ -6,7 +6,7 @@ Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
-		baseURL: 'http://kline.ns.liuniu946.com', //请求地址配置
+		baseURL: 'http://www.accle.shop', //请求地址配置
 		urlFile: '/index', //项目部署所在文件夹
 		userInfo: {}, //登录信息
 		loginInterceptor: false, //是否打开强制登录