cmy 2 rokov pred
rodič
commit
7cb9247786

+ 0 - 1
pages.json

@@ -139,7 +139,6 @@
 				"navigationBarTitleText": "历史列表",
 				"enablePullDownRefresh": false
 			}
-
 		}
 
 	],

+ 15 - 27
pages/game/history.vue

@@ -1,44 +1,26 @@
 <template>
 	<view class="all">
-		<view
-			class="list"
-			v-for="item in 25"
-			:key="item">
+		<view class="list" v-for="item in 25" :key="item">
 			<view class="le">
 				<view class="qs">第2022010223期</view>
 				<view class="dy">0.064489</view>
 			</view>
 			<view class="ri">
-				<view
-					class="sx"
-					style="margin-left: 380rpx"
-					>{{ $t("enter.u6") }}</view
-				>
-				<view
-					class="sx"
-					style="margin-left: 30rpx"
-					>{{ $t("enter.u5") }}</view
-				>
+				<view class="sx" style="margin-left: 380rpx">{{ $t("enter.u6") }}</view>
+				<view class="sx" style="margin-left: 30rpx">{{ $t("enter.u5") }}</view>
 			</view>
 			<view class="ri">
-				<view
-					class="sx"
-					style="margin-left: 380rpx"
-					>{{ $t("enter.u4") }}</view
-				>
-				<view
-					class="sx"
-					style="margin-left: 30rpx"
-					>{{ $t("enter.u7") }}</view
-				>
+				<view class="sx" style="margin-left: 380rpx">{{ $t("enter.u4") }}</view>
+				<view class="sx" style="margin-left: 30rpx">{{ $t("enter.u7") }}</view>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
-	import { gameBetList } from "@/api/game.js";
-
+	import {
+		gameBetList
+	} from "@/api/game.js";
 	export default {
 		data() {
 			return {}
@@ -54,12 +36,14 @@
 		min-height: 100vh;
 		background-color: $page-color-base;
 	}
+
 	.list {
 		display: flex;
 		justify-content: start;
 		width: 750rpx;
 		height: 150rpx;
 	}
+
 	.qs {
 		height: 19rpx;
 		font-size: 20rpx;
@@ -68,6 +52,7 @@
 		margin-top: 27rpx;
 		margin-left: 30rpx;
 	}
+
 	.dy {
 		height: 35rpx;
 		font-size: 46rpx;
@@ -76,11 +61,13 @@
 		margin-top: 14rpx;
 		margin-left: 30rpx;
 	}
+
 	.ri {
 		display: flex;
 		justify-content: start;
 		margin-left: -45rpx;
 	}
+
 	.sx {
 		height: 28rpx;
 		font-size: 30rpx;
@@ -88,6 +75,7 @@
 		color: #df5660;
 		margin-top: 50rpx;
 	}
+
 	.xian {
 		width: 696rpx;
 		height: 2rpx;
@@ -96,4 +84,4 @@
 		margin-left: 30rpx;
 		margin-top: 43rpx;
 	}
-</style>
+</style>

+ 0 - 1044
pages/index/entertainment - 副本.vue

@@ -1,1044 +0,0 @@
-<template>
-	<view class="all">
-		<view class="padding-t-30"></view>
-		<view class="tab">
-			<view class="flex-start">
-				<view class="tab-item " @click="changeTab(item,ind)" :class="{action:actionIndex==ind}"
-					v-for="(item,ind) in gameList">
-					{{item.name}}
-				</view>
-			</view>
-			<l-echart class="top" ref="chart"></l-echart>
-		</view>
-
-		<view class="center flex">
-			<!-- 左 -->
-			<view class="le">
-				<view class="tit flex-start">
-					<view class="ti1">{{$t('enter.u1')}}</view>
-					<view class="ti2">({{$t('enter.u2')}} {{history.base.max_bet*1}}U)</view>
-				</view>
-				<view class="he">
-					<view class="numbox flex-start">
-						<view class="he1 flex" @click="upOnBtnData.value=it" v-for="it in arMoneyList">
-							<view class="wen">{{it}}</view>
-						</view>
-					</view>
-				</view>
-				<view class="yi flex-start">
-					<image class="img" src="../../static/icon/le.png" mode=""></image>
-					<view class="wz padding-l-10">{{history.base.token}}</view>
-					<view class="qx padding-l-10" v-if="history.next.id">{{history.next.no}}</view>
-				</view>
-				<view class="shu">
-					{{KlineList.c*1}}
-				</view>
-			</view>
-			<!--右 -->
-			<view class="ri">
-				<view class="ti flex-center">
-					<view class="t1">{{$t('enter.u3')}}</view>
-					<view class="t2 padding-l-10">{{history.base.timebar}}</view>
-				</view>
-
-				<view class="dh">
-					<input class="input" :placeholder="'USDT'+$t('enter.a9')" type="number" v-model="upOnBtnData.value">
-				</view>
-				<view class="btn">
-					<view class="bt flex">
-						<view class="btnItem btnle" @click="onPayBet(2)">
-							<image class="imag" src="../../static/icon/xia.png" mode=""></image>
-							<text class="xia">{{$t('enter.u4')}}</text>
-						</view>
-						<view class="btnItem btnri" @click="onPayBet(1)">
-							<image class="imag" src="../../static/icon/shang.png" mode=""></image>
-							<text class="xia">{{$t('enter.u6')}}</text>
-						</view>
-					</view>
-					<view class="bt flex">
-						<view class="btnItem btnle" @click="onPayBet(3)">
-							<view class="xia">{{$t('enter.u5')}}</view>
-						</view>
-						<view class="btnItem btnri" @click="onPayBet(4)">
-							<view class="xia">{{$t('enter.u7')}}</view>
-						</view>
-					</view>
-				</view>
-
-				<view class="db flex">
-					<view class="jl">{{$t('enter.u8')}}</view>
-					<view class="sj">
-						<text v-if="time.H<10">0</text>
-						{{time.H}}
-					</view>
-					<view class="sj">
-						<text v-if="time.M<10">0</text>
-						{{time.M}}
-					</view>
-					<view class="sj">
-						<text v-if="time.S<10">0</text>
-						{{time.S}}
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="kb"></view>
-
-		<view class="last">
-			<view class="flex">
-				<text>{{$t('enter.u9')}}</text>
-				<navigator url="/pages/history/history">
-					<view class="flex" @click="nav">
-						<text>{{$t('enter.u10')}}</text>
-						<image class="lb" src="../../static/icon/jt.png" mode=""></image>
-					</view>
-				</navigator>
-			</view>
-		</view>
-
-		<view class="bg">
-			<view class="biaotou flex">
-				<view class="biwe">{{$t('enter.u11')}}</view>
-				<view class="biwe">{{$t('enter.u12')}}</view>
-				<view class="biwe">{{$t('enter.u13')}}</view>
-				<view class="biwe">{{$t('enter.u14')}}</view>
-			</view>
-			<view class="list flex" v-for="(item,ind) in betList.list" :key="ind">
-				<view class="biwe flex-start">
-					<view class="tr">{{history.base.token}}</view>
-					<view class="nametip">{{history.base.timebar}}</view>
-					<image v-if="item.bet==1" class="zz" src="../../static/icon/shang.png" mode="scaleToFill"></image>
-					<image v-if="item.bet==2" class="zz" src="../../static/icon/xia.png" mode="scaleToFill"></image>
-					<view v-if="item.bet==3" class="nametip red">{{$t('enter.u5')}}</view>
-					<view v-if="item.bet==4" class="nametip green">{{$t('enter.u7')}}</view>
-				</view>
-				<view class="biwe">{{item.num*1}}</view>
-				<view class="biwe">{{item.get-item.num}}</view>
-				<view class="biwe flex">
-					<view v-if="item.status==1" class="list-buttom success margin-r-10">
-						{{$t('enter.u17')}}
-					</view>
-					<view class="list-buttom primary">
-						{{$t('enter.u18')}}
-					</view>
-				</view>
-			</view>
-		</view>
-
-		<view class="chz flex">
-			<view>
-				<view class="yue padding-b-10">{{$t('enter.u15')}}</view>
-				<view class="yes">{{userWallet}}U</view>
-			</view>
-			<navigator url="/pages/recharge/recharge">
-				<view class="flex-start">
-					<view class="quc">{{$t('enter.u16')}}</view>
-					<image class="choz" src="../../static/icon/jt.png" mode=""></image>
-				</view>
-			</navigator>
-		</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">
-						<navigator url="/pages/transaction/transaction">
-							<text>忘记支付密码?</text>
-						</navigator>
-					</view>
-				</view>
-				<cc-defineKeyboard ref="CodeKeyboard" passwrdType="pay" @KeyInfo="KeyInfo"
-					:viewShow="true"></cc-defineKeyboard>
-			</view>
-		</uni-popup>
-		<taber tab='entertainment' v-if="!upOnBtnData.show"></taber>
-	</view>
-</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,
-		gameKline,
-		getGameList,
-		test,
-		gameWallet,
-		gameBetList,
-		gameBetIn
-	} from "@/api/game.js";
-	import {
-		qianBao,
-	} from "@/api/wallet.js";
-	import {
-		mapState,
-		mapMutations
-	} from 'vuex';
-	import {
-		saveUrl,
-		interceptor
-	} from '@/utils/loginUtils.js';
-	import taber from "@/components/footer/footer.vue";
-
-	export default {
-		components: {
-			taber,
-			LEchart
-		},
-		computed: {
-			...mapState("user", ["hasLogin"])
-		},
-		data() {
-			return {
-				arMoneyList: [
-					1, 5, 10, 20, 50, 100
-				],
-				actionIndex: 0,
-				// 当前游戏列表
-				gameList: [],
-				// 游戏信息
-				history: {
-					list: [], //游戏进行记录
-					page: 1,
-					limit: 10,
-					// 基础数据
-					base: {},
-					next: {},
-					now: {}
-				},
-				time: {
-					H: 0,
-					M: 0,
-					S: 0,
-					// 保存倒计时对象
-					t: ''
-				},
-				// 游戏押注记录
-				betList: {
-					list: [], //游戏进行记录
-					page: 1,
-					limit: 10,
-				},
-				userWallet: 0,
-				// 当前最新K线数据
-				KlineList:{c:''},
-				upOnBtnData: {
-					// 是否显示底部导航栏
-					show: false,
-					type: '',
-					// 当前输入的密码
-					passwordArr: [],
-					value: '',
-				},
-			};
-		},
-		onLoad() {},
-		onShow() {
-			if (!this.hasLogin) {
-				uni.showModal({
-					title: this.$t('enter.c4'),
-					content: this.$t('enter.b5'),
-					success: (e) => {
-						// 判断是否点击确认按钮
-						if (e.confirm) {
-							// 保存当前页面地址
-							saveUrl()
-							// 跳转页面
-							interceptor()
-						}
-					}
-				})
-				return
-			}
-			this.getUserWallet();
-
-		},
-		// 关闭循环
-		onHide() {
-			clearInterval(this.time.t)
-		},
-		methods: {
-			// 点击触发支付事件
-			onPayBet(type) {
-				if (!this.upOnBtnData.value) {
-					uni.showToast({
-						title: this.$t('enter.a9'),
-						icon: "error"
-					})
-					return
-				}
-				this.upOnBtnData.type = type;
-				this.openPayPassword();
-			},
-			// 打开支付弹窗
-			openPayPassword() {
-				this.upOnBtnData.show = true;
-				this.$refs.popup.open();
-			},
-			// 关闭支付弹窗
-			colsePayPassword() {
-				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();
-				}
-			},
-			// 参与压住
-			gameBetIn(type) {
-				const that = this;
-				const upData = {
-					id: that.history.next.id,
-
-					bet: that.upOnBtnData.type,
-					num: that.upOnBtnData.value,
-					trade_password: that.upOnBtnData.passwordArr.join("")
-				};
-				this.upOnBtnData.passwordArr=[];
-				uni.showLoading({
-					mask: true
-				})
-				gameBetIn(upData).then((res) => {
-					uni.hideLoading()
-					uni.showToast({
-						title:  res.msg
-					});
-					that.gameBetList();
-				}).catch((res) => {
-					uni.hideLoading();
-					uni.showToast({
-						title:  res.msg
-					});
-				})
-			},
-			// 获取用户余额信息
-			getUserWallet() {
-				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 {
-					// 关闭循环
-					clearInterval(that.time.t);
-					if (that.history.base.id) {
-						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(() => {
-									test();
-									setTimeout(() => {
-										this.gameDataInit(that.gameList[that.actionIndex].id)
-									}, 1000)
-								}, 3000)
-
-							}
-						}, 1000)
-					}
-				} catch (e) {
-					console.log(e, '定时');
-				}
-
-			},
-			changeTab(item, ind) {
-				if (ind != this.actionIndex) {
-					this.actionIndex = ind;
-					clearInterval(this.time.t)
-					this.gameDataInit(item.id);
-				}
-			},
-			async gameInit() {
-				try {
-					await test();
-					// 获取游戏列表
-					await this.getGameList();
-					// 加载游戏数据
-					this.gameDataInit(this.history.next.id || this.gameList[0].id)
-
-				} catch (e) {
-					console.log(e, 'cuowu');
-				}
-			},
-			// 加载游戏列表
-			getGameList() {
-				return getGameList().then((res) => {
-					this.gameList = res.data.list;
-					// console.log('1111111111',this.gameList);
-				})
-			},
-			// 重新加载基础游戏信息
-			async gameDataInit(id, reload = true) {
-				// 获取基础信息
-				await this.getGame(id);
-				//获取K线
-				this.getGameKline(reload);
-				// 获取游戏压住记录
-				this.gameBetList();
-			},
-			// 获取游戏压住记录
-			gameBetList() {
-				gameBetList({
-					page: 1,
-					limit: 10,
-					id: this.history.base.id,
-				}).then((res) => {
-					this.betList.list = res.data.bet_log;
-					console.log('aaa', this.betList.list);
-				})
-			},
-			// 获取游戏K线信息
-			getGameKline(reload = true) {
-				const that = this;
-				gameKline({
-					page: 1,
-					limit: 60
-				}, that.history.base.id).then((res) => {
-					that.KlineList = res.data.list[0];
-					let list = res.data.list.reverse();
-					// x轴记录
-					let xarr = [];
-					// 打点数据
-					let linearr = [];
-					for (let i = 0; i < list.length; i++) {
-						const ll = list[i];
-						const time = new Date(+ll.ts);
-						const addar = [+(+ll.o).toFixed(5), +(+ll.c).toFixed(5), +(+ll.l).toFixed(5), +(+ll.h)
-							.toFixed(5)
-						];
-						xarr.push(`${time.getHours()}:${time.getMinutes()}`)
-						linearr.push(addar)
-					}
-					that.$nextTick(() => {
-						// 判断是否要重载数据
-						that.initKline({
-							xarr,
-							linearr
-						}, reload)
-					})
-				})
-			},
-			// 获取当前项目信息
-			getGame(type) {
-				const that = this;
-				return getGame({
-					page: that.history.page,
-					limit: that.history.limit
-				}, type).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) {
-						that.opTiem();
-					}
-				})
-			},
-			// 均值计算
-			calculateMA(dayCount, data) {
-				var result = [];
-				for (var i = 0, len = data.linearr.length; i < len; i++) {
-					if (i < dayCount) {
-						result.push('-');
-						continue;
-					}
-					var sum = 0;
-					for (var j = 0; j < dayCount; j++) {
-						sum += data.linearr[i - j][1];
-					}
-					result.push(+(sum / dayCount).toFixed(5));
-				}
-				return result;
-			},
-			// 重载K线
-			async initKline(data, reload = true) {
-				const that = this;
-				try {
-					const chart = await this.$refs.chart.init(echarts);
-					if (reload) {
-						const upColor = '#00da3c';
-						const downColor = '#ec0000';
-						chart.setOption(
-							(this.option = {
-								animation: false,
-								legend: {
-									top: 10,
-									left: 10,
-									data: ['MA5', 'MA10', 'MA20'],
-									textStyle: {
-										color: '#999999'
-									}
-								},
-								tooltip: {
-									trigger: 'axis',
-									axisPointer: {
-										type: 'cross'
-									},
-									borderWidth: 1,
-									borderColor: '#ccc',
-									padding: 10,
-									textStyle: {
-										color: '#000'
-									},
-									position: function(pos, params, el, elRect, size) {
-										const obj = {
-											top: 10
-										};
-										obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 40;
-
-										return obj;
-									}
-								},
-								dataZoom: [{
-									type: 'inside',
-									xAxisIndex: 0,
-									start: 50,
-									end: 100
-								}],
-								grid: [{
-									left: 10,
-									right: 55,
-									bottom: 20,
-									top: 45
-								}],
-								xAxis: [{
-									type: 'category',
-									data: data.xarr,
-									axisLine: {
-										onZero: false
-									},
-									splitLine: {
-										show: false
-									},
-									min: 'dataMin',
-									max: 'dataMax',
-									axisPointer: {
-										z: 100
-									}
-								}],
-								yAxis: [{
-									scale: true,
-									splitNumber: 4,
-									position: 'right',
-									axisTick: {
-										show: false
-									},
-									splitLine: {
-										show: false,
-										lineStyle: {
-											color: '#e3e3e3'
-										}
-									},
-									axisLabel: {
-										inside: false,
-										formatter: '{value}\n',
-										color: '#999999'
-									}
-								}],
-								series: [{
-										name: that.history.base.token + '-USDT',
-										type: 'candlestick',
-										data: data.linearr,
-										itemStyle: {
-											color: upColor,
-											color0: downColor,
-											borderColor: undefined,
-											borderColor0: undefined
-										}
-									},
-									{
-										name: "MA5",
-										smooth: true,
-										type: 'line',
-										data: that.calculateMA(5, data),
-										showSymbol: false,
-										lineStyle: {
-											width: 1
-										}
-									},
-									{
-										name: "MA10",
-										smooth: true,
-										type: 'line',
-										data: that.calculateMA(10, data),
-										showSymbol: false,
-										lineStyle: {
-											width: 1
-										}
-									},
-									{
-										name: "MA20",
-										smooth: true,
-										type: 'line',
-										data: that.calculateMA(20, data),
-										showSymbol: false,
-										lineStyle: {
-											width: 1
-										}
-									},
-								]
-							}),
-							true
-						)
-					} else {
-						chart.setOption({
-							xAxis: [{
-								type: 'category',
-								data: data.xarr,
-							}],
-							series: [{
-									name: that.history.base.token + '-USDT',
-									data: data.linearr,
-								},
-								{
-									name: "MA5",
-									data: that.calculateMA(5, data),
-								},
-								{
-									name: "MA10",
-									data: that.calculateMA(10, data),
-								},
-								{
-									name: "MA20",
-									data: that.calculateMA(20, data),
-								},
-							]
-						})
-					}
-
-
-				} catch (e) {
-					console.log(e, 'cuowu');
-					//TODO handle the exception
-				}
-
-			},
-			// 页面跳转
-			nav() {
-				uni.navigateTo({
-					url: "/pages/history/history",
-				});
-			},
-		},
-	};
-</script>
-
-<style lang="scss">
-	.all {
-		width: 750rpx;
-		/* height: 2500rpx; */
-		height: 100%;
-		padding-top: var(--status-bar-height);
-		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;
-		background-color: #191A1F;
-		border-radius: 20px;
-
-		.tab-item {
-			color: #FFF;
-			font-size: $font-sm;
-			padding: 0 20rpx;
-			padding-bottom: 10rpx;
-
-			&.action {
-				color: #F5A944;
-				border-bottom: 1px solid #F5A944;
-			}
-		}
-
-		.top {
-			height: 530rpx;
-			width: 100%;
-		}
-	}
-
-	.center {
-		padding: 30rpx;
-		line-height: 1;
-		align-items: flex-start;
-
-		.le,
-		.ri {
-			width: 50%;
-		}
-
-		.le {
-			.tit {
-				font-weight: bold;
-
-				.ti1 {
-					font-size: 26rpx;
-					color: #ffffff;
-				}
-
-				.ti2 {
-					font-size: 22rpx;
-					padding-left: 10rpx;
-					color: #999999;
-				}
-			}
-
-			.he {
-				padding-top: 40rpx;
-
-				.numbox {
-					flex-wrap: wrap;
-
-					.he1 {
-						background: #fdaf41;
-						border-radius: 10rpx;
-						margin-bottom: 40rpx;
-						margin-right: 20rpx;
-						width: 84rpx;
-						height: 84rpx;
-						justify-content: center;
-
-						.wen {
-							font-size: 30rpx;
-							font-weight: bold;
-							color: #000000;
-						}
-					}
-				}
-			}
-
-			.yi {
-				color: #ffffff;
-				font-size: $font-base;
-
-				.img {
-					width: 41rpx;
-					height: 42rpx;
-				}
-
-				.wz {
-					font-weight: bold;
-				}
-			}
-
-			.shu {
-				padding-top: 10rpx;
-				font-size: 51rpx;
-				font-weight: bold;
-				color: #fdb242;
-			}
-
-		}
-
-		.ri {
-			.ti {
-				font-size: 26rpx;
-				font-weight: bold;
-
-				.t1 {
-					color: #ffffff;
-				}
-
-				.t2 {
-					color: #fdaf41;
-				}
-			}
-
-			.dh {
-				width: 100%;
-				padding: 20rpx 30rpx;
-				margin-top: 30rpx;
-				background: #efefef;
-				border-radius: 10rpx;
-
-				.te {
-					font-size: 44rpx;
-					font-weight: 800;
-					color: #000000;
-				}
-			}
-
-			.btn {
-				padding-top: 30rpx;
-
-				.bt {
-					padding-bottom: 10rpx;
-
-					.btnItem {
-						width: 49%;
-						height: 70rpx;
-						line-height: 70rpx;
-						text-align: center;
-
-						.imag {
-							width: 32rpx;
-							height: 20rpx;
-						}
-
-						.xia {
-							font-size: 28rpx;
-							font-weight: 800;
-							color: #ffffff;
-						}
-
-					}
-
-					.btnle {
-						border-radius: 50rpx 0 0 50rpx;
-						background-color: #df5660;
-
-					}
-
-					.btnri {
-						border-radius: 0 50rpx 50rpx 0;
-						background-color: #5bb786;
-					}
-				}
-			}
-
-			.db {
-				justify-content: flex-end;
-				padding-top: 30rpx;
-
-				.jl {
-					font-size: 24rpx;
-					font-weight: 400;
-					color: #999999;
-				}
-
-				.sj {
-					width: 40rpx;
-					height: 40rpx;
-					background: #bfbfbf;
-					border-radius: 3rpx;
-					text-align: center;
-					line-height: 40rpx;
-					margin-left: 10rpx;
-				}
-
-			}
-		}
-	}
-
-	.kb {
-		width: 750rpx;
-		height: 20rpx;
-		background-color: #191a1f;
-	}
-
-	.last {
-		padding: 30rpx;
-		line-height: 1;
-		font-size: 24rpx;
-		font-weight: 800;
-		color: #fff;
-
-		.lb {
-			width: 14rpx;
-			height: 20rpx;
-			margin-left: 10rpx;
-		}
-
-	}
-
-
-
-
-
-	.bg {
-		padding: 0 30rpx;
-		background-color: #000000;
-		color: #fff;
-		text-align: center;
-		font-size: 28rpx;
-		padding-bottom: 30rpx;
-
-		.biaotou {
-			font-weight: 800;
-			padding-bottom: 10rpx;
-		}
-
-		.biwe {
-			width: 25%;
-
-			.zz {
-				width: 22rpx;
-				height: 14rpx;
-				margin-left: 8rpx;
-			}
-
-			.nametip {
-				font-size: 18rpx;
-				color: #999999;
-				padding-left: 8rpx;
-				&.green{
-					color:#5bb786;
-				}
-				&.red{
-					color:#df5660;
-				}
-			}
-		}
-
-		.biwe:nth-child(1) {
-			flex-shrink: 0;
-			text-align: left;
-			align-items: flex-end;
-		}
-
-		.biwe:nth-child(4) {
-			flex-shrink: 0;
-			width: 200rpx;
-		}
-
-		.list {
-			font-weight: bold;
-			padding: 20rpx 0;
-			border-bottom: 1px solid rgba(43, 42, 38, 0.52);
-		}
-
-		.list-buttom {
-			width: 100rpx;
-			border-radius: 30rpx;
-			font-size: 16rpx;
-			padding: 10rpx 0;
-
-			&.success {
-				background: #25b287;
-			}
-
-			&.primary {
-				background: #01ebf6;
-				color: #000000;
-			}
-		}
-	}
-
-	.chz {
-		background: #191a1f;
-		border-radius: 20rpx;
-		margin: 0 30rpx;
-		color: #ffffff;
-		font-weight: bold;
-		padding: 20rpx 30rpx;
-
-		.yue {
-			font-size: 28rpx;
-		}
-
-		.yes {
-			color: #fdaf41;
-		}
-
-		.quc {
-			font-size: 26rpx;
-			font-weight: 500;
-			color: #ffffff;
-		}
-
-		.choz {
-			width: 22rpx;
-			height: 14rpx;
-		}
-	}
-</style>

+ 123 - 34
pages/index/entertainment.vue

@@ -26,7 +26,7 @@
 					</view>
 				</view>
 				<view class="yi flex-start">
-					<image class="img" src="../../static/icon/le.png" mode=""></image>
+					<!-- <image class="img" src="../../static/icon/le.png" mode=""></image> -->
 					<view class="wz padding-l-10">{{history.base.token}}</view>
 					<view class="qx padding-l-10" v-if="history.next.id">{{history.next.no}}</view>
 				</view>
@@ -87,12 +87,10 @@
 		<view class="last">
 			<view class="flex">
 				<text>{{$t('enter.u9')}}</text>
-				<navigator url="/pages/history/history">
-					<view class="flex" @click="nav">
-						<text>{{$t('enter.u10')}}</text>
-						<image class="lb" src="../../static/icon/jt.png" mode=""></image>
-					</view>
-				</navigator>
+				<view class="flex" @click="nav('/pages/game/history')">
+					<text>{{$t('enter.u10')}}</text>
+					<image class="lb" src="../../static/icon/jt.png" mode="scaleToFill"></image>
+				</view>
 			</view>
 		</view>
 
@@ -118,24 +116,22 @@
 					<view v-if="item.status==1" class="list-buttom success margin-r-10">
 						{{$t('enter.u17')}}
 					</view>
-					<view class="list-buttom primary">
+					<view class="list-buttom primary" @click="alertDetailOpen(item)">
 						{{$t('enter.u18')}}
 					</view>
 				</view>
 			</view>
 		</view>
-
-		<view class="chz flex">
+		
+		<view class="chz flex" @click="nav('/pages/user/money/recharge')">
 			<view>
 				<view class="yue padding-b-10">{{$t('enter.u15')}}</view>
 				<view class="yes">{{userWallet}}U</view>
 			</view>
-			<navigator url="/pages/game/recharge">
-				<view class="flex-start">
-					<view class="quc">{{$t('enter.u16')}}</view>
-					<image class="choz" src="../../static/icon/jt.png" mode=""></image>
-				</view>
-			</navigator>
+			<view class="flex-start">
+				<view class="quc">{{$t('enter.u16')}}</view>
+				<image class="choz" src="../../static/icon/jt.png" mode="scaleToFill"></image>
+			</view>
 		</view>
 		<uni-popup type="bottom" ref="popup" :mask-click="false" @maskClick='colsePayPassword'>
 			<view class="page">
@@ -158,6 +154,54 @@
 					:viewShow="true"></cc-defineKeyboard>
 			</view>
 		</uni-popup>
+		<uni-popup type="center" ref="popupDetail">
+			<view class="alert-detail">
+				<view class="padding-c-30 padding-t-30 padding-b-30">
+					<view class="flex">
+						<view class="type">
+							{{$t('gameList.a5')}}
+						</view>
+						<view class="num">
+							{{getTime(alertDetail.ts)}}
+						</view>
+					</view>
+					<view class="flex">
+						<view class="type">
+							open
+						</view>
+						<view class="num">
+							{{alertDetail.o*1}}
+						</view>
+					</view>
+					<view class="flex">
+						<view class="type">
+							close
+						</view>
+						<view class="num">
+							{{alertDetail.c*1}}
+						</view>
+					</view>
+					<view class="flex">
+						<view class="type">
+							lowest
+						</view>
+						<view class="num">
+							{{alertDetail.l*1}}
+						</view>
+					</view>
+					<view class="flex">
+						<view class="type">
+							highest
+						</view>
+						<view class="num">
+							{{alertDetail.h*1}}
+						</view>
+					</view>
+				</view>
+				<button class="button" type="default" @click="$refs.popupDetail.close()"><text
+						class="button-text">关闭</text></button>
+			</view>
+		</uni-popup>
 		<taber tab='entertainment' v-if="!upOnBtnData.show"></taber>
 	</view>
 </template>
@@ -169,7 +213,6 @@
 		getGame,
 		gameKline,
 		getGameList,
-		test,
 		gameWallet,
 		gameBetList,
 		gameBetIn
@@ -186,14 +229,16 @@
 		interceptor
 	} from '@/utils/loginUtils.js';
 	import taber from "@/components/footer/footer.vue";
-
+	import {
+		getTime
+	} from '@/utils/rocessor.js';
 	export default {
 		components: {
 			taber,
 			LEchart
 		},
 		computed: {
-			...mapState("user", ["hasLogin"])
+			...mapState("user", ["hasLogin"]),
 		},
 		data() {
 			return {
@@ -210,7 +255,7 @@
 					limit: 10,
 					// 基础数据
 					base: {},
-					next: {},
+					next: "",
 					now: {}
 				},
 				time: {
@@ -228,7 +273,9 @@
 				},
 				userWallet: 0,
 				// 当前最新K线数据
-				KlineList:{c:''},
+				KlineList: {
+					c: ''
+				},
 				upOnBtnData: {
 					// 是否显示底部导航栏
 					show: false,
@@ -237,6 +284,10 @@
 					passwordArr: [],
 					value: '',
 				},
+				// 弹窗数据像晴
+				alertDetail: {
+
+				}
 			};
 		},
 		onLoad() {},
@@ -258,13 +309,19 @@
 				return
 			}
 			this.getUserWallet();
-
 		},
 		// 关闭循环
 		onHide() {
 			clearInterval(this.time.t)
 		},
 		methods: {
+			getTime,
+			// 弹窗详情
+			alertDetailOpen(item) {
+				console.log(item);
+				this.alertDetail = item.room.result_info;
+				this.$refs.popupDetail.open();
+			},
 			// 点击触发支付事件
 			onPayBet(type) {
 				if (!this.upOnBtnData.value) {
@@ -322,20 +379,20 @@
 					num: that.upOnBtnData.value,
 					trade_password: that.upOnBtnData.passwordArr.join("")
 				};
-				this.upOnBtnData.passwordArr=[];
+				this.upOnBtnData.passwordArr = [];
 				uni.showLoading({
 					mask: true
 				})
 				gameBetIn(upData).then((res) => {
 					uni.hideLoading()
 					uni.showToast({
-						title:  res.msg
+						title: res.msg
 					});
 					that.gameBetList();
 				}).catch((res) => {
 					uni.hideLoading();
 					uni.showToast({
-						title:  res.msg
+						title: res.msg
 					});
 				})
 			},
@@ -356,7 +413,9 @@
 				try {
 					// 关闭循环
 					clearInterval(that.time.t);
-					if (that.history.base.id) {
+					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;
@@ -366,7 +425,6 @@
 							if (that.time.H == 0 && that.time.M == 0 && that.time.S == 0) {
 								clearInterval(that.time.t);
 								setTimeout(() => {
-									test();
 									setTimeout(() => {
 										this.gameDataInit(that.gameList[that.actionIndex].id)
 									}, 1000)
@@ -389,7 +447,6 @@
 			},
 			async gameInit() {
 				try {
-					await test();
 					// 获取游戏列表
 					await this.getGameList();
 					// 加载游戏数据
@@ -468,8 +525,8 @@
 				}) => {
 					that.history.list = data.list || [];
 					that.history.base = data.game || {};
-					that.history.next = data.next_game || {};
-					that.history.now = data.now_game || {};
+					that.history.next = data.next_game || '';
+					that.history.now = data.now_game || '';
 					if (that.history.next) {
 						that.opTiem();
 					}
@@ -656,8 +713,28 @@
 			},
 			// 页面跳转
 			nav(url) {
+				console.log('tz');
+				if (!this.hasLogin) {
+					uni.showModal({
+						title: this.$t('enter.c4'),
+						content: this.$t('enter.b5'),
+						success: (e) => {
+							// 判断是否点击确认按钮
+							if (e.confirm) {
+								// 保存当前页面地址
+								saveUrl()
+								// 跳转页面
+								interceptor()
+							}
+						}
+					})
+					return
+				}
 				uni.navigateTo({
 					url,
+					fail(err) {
+						console.log(err);
+					}
 				});
 			},
 		},
@@ -971,11 +1048,13 @@
 				font-size: 18rpx;
 				color: #999999;
 				padding-left: 8rpx;
-				&.green{
-					color:#5bb786;
+
+				&.green {
+					color: #5bb786;
 				}
-				&.red{
-					color:#df5660;
+
+				&.red {
+					color: #df5660;
 				}
 			}
 		}
@@ -1041,4 +1120,14 @@
 			height: 14rpx;
 		}
 	}
+
+	.alert-detail {
+		background-color: #FFF;
+		border-radius: 10rpx;
+		width: 500rpx;
+
+		.flex {
+			padding: 10rpx 0;
+		}
+	}
 </style>

+ 0 - 147
plugin/image-tools/index.js

@@ -1,147 +0,0 @@
-function getLocalFilePath(path) {
-    if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf('_downloads') === 0) {
-        return path
-    }
-    if (path.indexOf('file://') === 0) {
-        return path
-    }
-    if (path.indexOf('/storage/emulated/0/') === 0) {
-        return path
-    }
-    if (path.indexOf('/') === 0) {
-        var localFilePath = plus.io.convertAbsoluteFileSystem(path)
-        if (localFilePath !== path) {
-            return localFilePath
-        } else {
-            path = path.substr(1)
-        }
-    }
-    return '_www/' + path
-}
-
-export function pathToBase64(path) {
-    return new Promise(function(resolve, reject) {
-        if (typeof window === 'object' && 'document' in window) {
-            if (typeof FileReader === 'function') {
-                var xhr = new XMLHttpRequest()
-                xhr.open('GET', path, true)
-                xhr.responseType = 'blob'
-                xhr.onload = function() {
-                    if (this.status === 200) {
-                        let fileReader = new FileReader()
-                        fileReader.onload = function(e) {
-                            resolve(e.target.result)
-                        }
-                        fileReader.onerror = reject
-                        fileReader.readAsDataURL(this.response)
-                    }
-                }
-                xhr.onerror = reject
-                xhr.send()
-                return
-            }
-            var canvas = document.createElement('canvas')
-            var c2x = canvas.getContext('2d')
-            var img = new Image
-            img.onload = function() {
-                canvas.width = img.width
-                canvas.height = img.height
-                c2x.drawImage(img, 0, 0)
-                resolve(canvas.toDataURL())
-                canvas.height = canvas.width = 0
-            }
-            img.onerror = reject
-            img.src = path
-            return
-        }
-        if (typeof plus === 'object') {
-            plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
-                entry.file(function(file) {
-                    var fileReader = new plus.io.FileReader()
-                    fileReader.onload = function(data) {
-                        resolve(data.target.result)
-                    }
-                    fileReader.onerror = function(error) {
-                        reject(error)
-                    }
-                    fileReader.readAsDataURL(file)
-                }, function(error) {
-                    reject(error)
-                })
-            }, function(error) {
-                reject(error)
-            })
-            return
-        }
-        if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
-            wx.getFileSystemManager().readFile({
-                filePath: path,
-                encoding: 'base64',
-                success: function(res) {
-                    resolve('data:image/png;base64,' + res.data)
-                },
-                fail: function(error) {
-                    reject(error)
-                }
-            })
-            return
-        }
-        reject(new Error('not support'))
-    })
-}
-
-export function base64ToPath(base64) {
-    return new Promise(function(resolve, reject) {
-        if (typeof window === 'object' && 'document' in window) {
-            base64 = base64.split(',')
-            var type = base64[0].match(/:(.*?);/)[1]
-            var str = atob(base64[1])
-            var n = str.length
-            var array = new Uint8Array(n)
-            while (n--) {
-                array[n] = str.charCodeAt(n)
-            }
-            return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], { type: type })))
-        }
-        var extName = base64.match(/data\:\S+\/(\S+);/)
-        if (extName) {
-            extName = extName[1]
-        } else {
-            reject(new Error('base64 error'))
-        }
-        var fileName = Date.now() + '.' + extName
-        if (typeof plus === 'object') {
-            var bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
-            bitmap.loadBase64Data(base64, function() {
-                var filePath = '_doc/uniapp_temp/' + fileName
-                bitmap.save(filePath, {}, function() {
-                    bitmap.clear()
-                    resolve(filePath)
-                }, function(error) {
-                    bitmap.clear()
-                    reject(error)
-                })
-            }, function(error) {
-                bitmap.clear()
-                reject(error)
-            })
-            return
-        }
-        if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
-            var filePath = wx.env.USER_DATA_PATH + '/' + fileName
-            wx.getFileSystemManager().writeFile({
-                filePath: filePath,
-                data: base64.replace(/^data:\S+\/\S+;base64,/, ''),
-                encoding: 'base64',
-                success: function() {
-                    resolve(filePath)
-                },
-                fail: function(error) {
-                    reject(error)
-                }
-            })
-            return
-        }
-        reject(new Error('not support'))
-    })
-}

+ 0 - 110
utils/SubscribeMessage.js

@@ -1,110 +0,0 @@
-import {
-	SUBSCRIBE_MESSAGE
-} from '../config/cache.js';
-
-export function auth() {
-	let tmplIds = {};
-	let messageTmplIds = uni.getStorageSync(SUBSCRIBE_MESSAGE);
-	tmplIds = messageTmplIds ? JSON.parse(messageTmplIds) : {};
-	return tmplIds;
-}
-
-/**
- * 支付成功后订阅消息id
- * 订阅  确认收货通知 订单支付成功  新订单管理员提醒 
- */
-export function openPaySubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.oreder_takever,
-		tmplIds.order_pay_success,
-		tmplIds.order_new,
-	]);
-}
-
-/**
- * 订单相关订阅消息
- * 送货 发货 取消订单
- */
-export function openOrderSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.order_deliver_success,
-		tmplIds.order_postage_success,
-		tmplIds.order_clone
-	]);
-}
-
-/**
- * 提现消息订阅
- * 成功 和 失败 消息
- */
-export function openExtrctSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.user_extract
-	]);
-}
-
-/**
- * 拼团成功
- */
-export function openPinkSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.pink_true
-	]);
-}
-
-/**
- * 砍价成功
- */
-export function openBargainSubscribe() {
-	let tmplIds = auth();
-	return subscribe([
-		tmplIds.bargain_success
-	]);
-}
-
-/**
- * 订单退款
- */
-export function openOrderRefundSubscribe() {
-	let tmplIds = auth();
-	return subscribe([tmplIds.order_refund]);
-}
-
-/**
- * 充值成功
- */
-export function openRechargeSubscribe() {
-	let tmplIds = auth();
-	return subscribe([tmplIds.recharge_success]);
-}
-
-/**
- * 提现
- */
-export function openEextractSubscribe() {
-	let tmplIds = auth();
-	return subscribe([tmplIds.user_extract]);
-}
-
-/**
- * 调起订阅界面
- * array tmplIds 模板id
- */
-export function subscribe(tmplIds) {
-	 let wecaht = wx;
-	return new Promise((reslove, reject) => {
-		wecaht.requestSubscribeMessage({
-			tmplIds: tmplIds,
-			success(res) {
-				return reslove(res);
-			},
-			fail(res) {
-				return reslove(res);
-			}
-		})
-	});
-}

+ 3 - 2
utils/rocessor.js

@@ -101,7 +101,7 @@ export function openMap(e) {
 	})
 }
 //时间戳转换成时间
-export function getTime(time) {
+export function getTime(time,type) {
 	const num =13 - (time+'').length;
 	let l = 1;//倍数
 	for (let i = 0; i < num; i++) {
@@ -116,5 +116,6 @@ export function getTime(time) {
 	const hours = date.getHours();
 	const minu = date.getMinutes();
 	const sec = date.getSeconds();
-	return year + '-' + mon + '-' + day + ' ' + hours + ':' + minu + ':' + sec;
+	
+	return year + '-' + mon + '-' + day + ' ' + (hours<10?`0${hours}`:hours) + ':' + (minu<10?`0${minu}`:minu) + ':' + (sec<10?`0${sec}`:sec);
 }

+ 0 - 42
utils/uni-copy.js

@@ -1,42 +0,0 @@
-export default function uniCopy({content,success,error}) {
-	if(!content) return error('复制的内容不能为空 !')
-	content = typeof content === 'string' ? content : content.toString() // 复制内容,必须字符串,数字需要转换为字符串
-	/**
-	 * 小程序端 和 app端的复制逻辑
-	 */
-	//#ifndef H5
-	uni.setClipboardData({
-		data: content,
-		success: function() {
-			success("复制成功~")
-			console.log('success');
-		},
-		fail:function(){
-			success("复制失败~")
-		}
-	});
-	//#endif
-	
-	/**
-	 * H5端的复制逻辑
-	 */
-	// #ifdef H5
-	if (!document.queryCommandSupported('copy')) { //为了兼容有些浏览器 queryCommandSupported 的判断
-		// 不支持
-		error('浏览器不支持')
-	}
-	let textarea = document.createElement("textarea")
-	textarea.value = content
-	textarea.readOnly = "readOnly"
-	document.body.appendChild(textarea)
-	textarea.select() // 选择对象
-	textarea.setSelectionRange(0, content.length) //核心
-	let result = document.execCommand("copy") // 执行浏览器复制命令
-	if(result){
-		success("复制成功~")
-	}else{
-		error("复制失败,请检查h5中调用该方法的方式,是不是用户点击的方式调用的,如果不是请改为用户点击的方式触发该方法,因为h5中安全性,不能js直接调用!")
-	}	
-	textarea.remove()
-	// #endif
-}