|
@@ -98,54 +98,56 @@
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="history-list">
|
|
<view class="history-list">
|
|
|
- <view class="history-title-type flex" >
|
|
|
|
|
|
|
+ <view class="history-title-type flex">
|
|
|
<view class="history-item">
|
|
<view class="history-item">
|
|
|
{{$t('indexenter.期号')}}
|
|
{{$t('indexenter.期号')}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item" v-if="historyType==0">
|
|
<view class="history-item" v-if="historyType==0">
|
|
|
{{$t('indexenter.竞猜值')}}
|
|
{{$t('indexenter.竞猜值')}}
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="history-item" >
|
|
|
|
|
|
|
+ <view class="history-item">
|
|
|
{{$t('indexenter.竞猜数')}}
|
|
{{$t('indexenter.竞猜数')}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item">
|
|
<view class="history-item">
|
|
|
{{$t('indexenter.结果')}}
|
|
{{$t('indexenter.结果')}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="history-title-type flex margin-t-30" v-for="(item,ind) in betList.list" :key="ind" v-if="historyType==0">
|
|
|
|
|
- <view class="history-item font-color-yellow" :class="{'font-color-gray':item.result==0,'font-color-red':item.result==1}">
|
|
|
|
|
|
|
+ <view class="history-title-type flex margin-t-30" v-for="(item,ind) in betList.list" :key="ind"
|
|
|
|
|
+ v-if="historyType==0">
|
|
|
|
|
+ <view class="history-item font-color-yellow"
|
|
|
|
|
+ :class="{'font-color-gray':item.result==0,'font-color-red':item.result==1}">
|
|
|
{{item.room.no}}
|
|
{{item.room.no}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item font-color-red">
|
|
<view class="history-item font-color-red">
|
|
|
- <text class="margin-l-10"
|
|
|
|
|
- v-for="(ll,ind) in history.base.include_function" v-if="item.bet==ll.id">{{$t(`indexenter.${ll.name}`)}}</text>
|
|
|
|
|
|
|
+ <text class="margin-l-10" v-for="(ll,ind) in history.base.include_function"
|
|
|
|
|
+ v-if="item.bet==ll.id">{{$t(`indexenter.${ll.name}`)}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="history-item font-color-red" >
|
|
|
|
|
|
|
+ <view class="history-item font-color-red">
|
|
|
{{item.room.result_info||$t('enter.a2')}}
|
|
{{item.room.result_info||$t('enter.a2')}}
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item font-color-yellow" v-if="item.typelist.length>0">
|
|
<view class="history-item font-color-yellow" v-if="item.typelist.length>0">
|
|
|
- <text class="margin-l-10"
|
|
|
|
|
- v-for="ll in item.typelist">{{$t(`indexenter.${ll.type}`)}}</text>
|
|
|
|
|
|
|
+ <text class="margin-l-10" v-for="ll in item.typelist">{{$t(`indexenter.${ll.type}`)}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item font-color-yellow" v-else>
|
|
<view class="history-item font-color-yellow" v-else>
|
|
|
{{$t('enter.a2')}}
|
|
{{$t('enter.a2')}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="history-title-type flex margin-t-30" v-for="(item,ind) in history.list" :key="ind" v-if="historyType==1">
|
|
|
|
|
- <view class="history-item font-color-yellow" :class="{'font-color-gray':item.result==0,'font-color-red':item.result==1}">
|
|
|
|
|
|
|
+ <view class="history-title-type flex margin-t-30" v-for="(item,ind) in history.list" :key="ind"
|
|
|
|
|
+ v-if="historyType==1">
|
|
|
|
|
+ <view class="history-item font-color-yellow"
|
|
|
|
|
+ :class="{'font-color-gray':item.result==0,'font-color-red':item.result==1}">
|
|
|
{{item.no}}
|
|
{{item.no}}
|
|
|
</view>
|
|
</view>
|
|
|
<!-- <view class="history-item font-color-red">
|
|
<!-- <view class="history-item font-color-red">
|
|
|
<text class="margin-l-10"
|
|
<text class="margin-l-10"
|
|
|
v-for="(ll,ind) in history.base.include_function" v-if="item.bet==ll.id">{{$t(`indexenter.${ll.name}`)}}</text>
|
|
v-for="(ll,ind) in history.base.include_function" v-if="item.bet==ll.id">{{$t(`indexenter.${ll.name}`)}}</text>
|
|
|
</view> -->
|
|
</view> -->
|
|
|
- <view class="history-item font-color-red flex" >
|
|
|
|
|
- <image v-for="ls in item.result_info" class="dice-number"
|
|
|
|
|
- :src="`../../static/img/dice${ls}.png`" mode="scaleToFill"></image>
|
|
|
|
|
|
|
+ <view class="history-item font-color-red flex">
|
|
|
|
|
+ <image v-for="ls in item.result_info" class="dice-number" :src="`../../static/img/dice${ls}.png`"
|
|
|
|
|
+ mode="scaleToFill"></image>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item font-color-yellow" v-if="item.typelist.length>0">
|
|
<view class="history-item font-color-yellow" v-if="item.typelist.length>0">
|
|
|
- <text class="margin-l-10"
|
|
|
|
|
- v-for="ll in item.typelist">{{$t(`indexenter.${ll.type}`)}}</text>
|
|
|
|
|
|
|
+ <text class="margin-l-10" v-for="ll in item.typelist">{{$t(`indexenter.${ll.type}`)}}</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="history-item font-color-yellow" v-else>
|
|
<view class="history-item font-color-yellow" v-else>
|
|
|
{{$t('enter.a2')}}
|
|
{{$t('enter.a2')}}
|
|
@@ -191,7 +193,7 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- historyType:0,//记录类型
|
|
|
|
|
|
|
+ historyType: 0, //记录类型
|
|
|
// 当前选中的大小奇偶
|
|
// 当前选中的大小奇偶
|
|
|
actiontype: 0,
|
|
actiontype: 0,
|
|
|
id: '',
|
|
id: '',
|
|
@@ -244,8 +246,7 @@
|
|
|
},
|
|
},
|
|
|
// 保存获取下次游戏对象
|
|
// 保存获取下次游戏对象
|
|
|
getNextTimeObj: '',
|
|
getNextTimeObj: '',
|
|
|
- // 判断是否当前页面中
|
|
|
|
|
- loadPage: false,
|
|
|
|
|
|
|
+ loadPage:true,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
@@ -255,7 +256,6 @@
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
- this.loadPage = true;
|
|
|
|
|
if (!this.hasLogin) {
|
|
if (!this.hasLogin) {
|
|
|
uni.showModal({
|
|
uni.showModal({
|
|
|
title: this.$t('enter.c4'),
|
|
title: this.$t('enter.c4'),
|
|
@@ -279,29 +279,32 @@
|
|
|
},
|
|
},
|
|
|
// 关闭循环
|
|
// 关闭循环
|
|
|
onHide() {
|
|
onHide() {
|
|
|
- this.loadPage = false;
|
|
|
|
|
|
|
+ const that = this;
|
|
|
// 倒计时清理
|
|
// 倒计时清理
|
|
|
- this.initData();
|
|
|
|
|
|
|
+ that.initData();
|
|
|
|
|
+ },
|
|
|
|
|
+ onUnload() {
|
|
|
|
|
+ const that = this;
|
|
|
|
|
+ that.initData();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
getTime,
|
|
getTime,
|
|
|
// 初始化
|
|
// 初始化
|
|
|
- async gameInit(id) {
|
|
|
|
|
|
|
+ gameInit(id) {
|
|
|
console.log('id', id);
|
|
console.log('id', id);
|
|
|
// await gameTest();
|
|
// await gameTest();
|
|
|
// 获取基础信息
|
|
// 获取基础信息
|
|
|
- await this.getGame(id);
|
|
|
|
|
|
|
+ this.getGame(id);
|
|
|
},
|
|
},
|
|
|
// 获取游戏信息
|
|
// 获取游戏信息
|
|
|
getGame(id) {
|
|
getGame(id) {
|
|
|
const that = this;
|
|
const that = this;
|
|
|
- return getGame({
|
|
|
|
|
|
|
+ getGame({
|
|
|
page: that.history.page,
|
|
page: that.history.page,
|
|
|
limit: that.history.limit
|
|
limit: that.history.limit
|
|
|
}, id).then(({
|
|
}, id).then(({
|
|
|
data
|
|
data
|
|
|
}) => {
|
|
}) => {
|
|
|
-
|
|
|
|
|
that.history.base = data.game || {};
|
|
that.history.base = data.game || {};
|
|
|
that.history.base.include_function = that.history.base.include_function.map((res) => {
|
|
that.history.base.include_function = that.history.base.include_function.map((res) => {
|
|
|
res.bfb = res.ratio * 1 * that.history.base.success_ratio / 100;
|
|
res.bfb = res.ratio * 1 * that.history.base.success_ratio / 100;
|
|
@@ -309,7 +312,7 @@
|
|
|
})
|
|
})
|
|
|
that.history.next = data.now_game || '';
|
|
that.history.next = data.now_game || '';
|
|
|
that.history.now = data.now_game || '';
|
|
that.history.now = data.now_game || '';
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (data.list) {
|
|
if (data.list) {
|
|
|
that.history.list = data.list.map((res) => {
|
|
that.history.list = data.list.map((res) => {
|
|
|
res.result_info = res.result_info.split(",");
|
|
res.result_info = res.result_info.split(",");
|
|
@@ -321,14 +324,14 @@
|
|
|
that.history.list = [];
|
|
that.history.list = [];
|
|
|
}
|
|
}
|
|
|
// 判断是否不存在游戏,并且没有倒计时对象,且在当前页面
|
|
// 判断是否不存在游戏,并且没有倒计时对象,且在当前页面
|
|
|
- if (that.loadPage && !that.history.next && !that.getNextTimeObj) {
|
|
|
|
|
- that.getNextTimeObj = setInterval(() => {
|
|
|
|
|
|
|
+ if (that.loadPage && !that.history.next) {
|
|
|
|
|
+ that.getNextTimeObj = setTimeout(() => {
|
|
|
that.getGame(id)
|
|
that.getGame(id)
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (that.history.next && that.getNextTimeObj) {
|
|
if (that.history.next && that.getNextTimeObj) {
|
|
|
- clearInterval(that.getNextTimeObj);
|
|
|
|
|
|
|
+ clearTimeout(that.getNextTimeObj);
|
|
|
// 清空倒计时对象
|
|
// 清空倒计时对象
|
|
|
that.getNextTimeObj = '';
|
|
that.getNextTimeObj = '';
|
|
|
}
|
|
}
|
|
@@ -343,27 +346,27 @@
|
|
|
resultLottery(st) {
|
|
resultLottery(st) {
|
|
|
const that = this;
|
|
const that = this;
|
|
|
let typelist = [];
|
|
let typelist = [];
|
|
|
- if(st){
|
|
|
|
|
- st.split(",").forEach((r) => {
|
|
|
|
|
- const ar = r.split(':');
|
|
|
|
|
- if (ar[1] == '1') {
|
|
|
|
|
- for (let i = 0; i < that.history.base.include_function.length; i++) {
|
|
|
|
|
- if (that.history.base.include_function[i].id == ar[0] * 1) {
|
|
|
|
|
- typelist.push({
|
|
|
|
|
- type: that.history.base.include_function[i].name
|
|
|
|
|
- })
|
|
|
|
|
- break
|
|
|
|
|
|
|
+ if (st) {
|
|
|
|
|
+ st.split(",").forEach((r) => {
|
|
|
|
|
+ const ar = r.split(':');
|
|
|
|
|
+ if (ar[1] == '1') {
|
|
|
|
|
+ for (let i = 0; i < that.history.base.include_function.length; i++) {
|
|
|
|
|
+ if (that.history.base.include_function[i].id == ar[0] * 1) {
|
|
|
|
|
+ typelist.push({
|
|
|
|
|
+ type: that.history.base.include_function[i].name
|
|
|
|
|
+ })
|
|
|
|
|
+ break
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
return typelist
|
|
return typelist
|
|
|
},
|
|
},
|
|
|
// 游戏押注记录
|
|
// 游戏押注记录
|
|
|
gameBetList() {
|
|
gameBetList() {
|
|
|
const that = this;
|
|
const that = this;
|
|
|
- if(that.historyType==0){
|
|
|
|
|
|
|
+ if (that.historyType == 0) {
|
|
|
const lineNum = that.history.base.decimal;
|
|
const lineNum = that.history.base.decimal;
|
|
|
gameBetList({
|
|
gameBetList({
|
|
|
page: 1,
|
|
page: 1,
|
|
@@ -378,7 +381,7 @@
|
|
|
});
|
|
});
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
// 开始倒计时
|
|
// 开始倒计时
|
|
|
async opTiem() {
|
|
async opTiem() {
|
|
@@ -396,11 +399,12 @@
|
|
|
console.log(e, '定时');
|
|
console.log(e, '定时');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // 倒计时清理
|
|
|
|
|
|
|
+ // 清除加载
|
|
|
initData() {
|
|
initData() {
|
|
|
- const that = this
|
|
|
|
|
|
|
+ const that = this;
|
|
|
|
|
+ that.loadPage = false;
|
|
|
// 关闭倒计时
|
|
// 关闭倒计时
|
|
|
- clearInterval(that.getNextTimeObj);
|
|
|
|
|
|
|
+ clearTimeout(that.getNextTimeObj);
|
|
|
clearInterval(that.time.t);
|
|
clearInterval(that.time.t);
|
|
|
// 清空倒计时对象
|
|
// 清空倒计时对象
|
|
|
that.getNextTimeObj = '';
|
|
that.getNextTimeObj = '';
|
|
@@ -674,7 +678,8 @@
|
|
|
|
|
|
|
|
.history-title {
|
|
.history-title {
|
|
|
font-size: $font-lg;
|
|
font-size: $font-lg;
|
|
|
- .action{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .action {
|
|
|
color: $yellow;
|
|
color: $yellow;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -692,20 +697,25 @@
|
|
|
.history-item {
|
|
.history-item {
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
width: 25%;
|
|
width: 25%;
|
|
|
- .dice-number{
|
|
|
|
|
|
|
+
|
|
|
|
|
+ .dice-number {
|
|
|
width: 40rpx;
|
|
width: 40rpx;
|
|
|
height: 40rpx;
|
|
height: 40rpx;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
&:nth-child(1) {
|
|
&:nth-child(1) {
|
|
|
text-align: left;
|
|
text-align: left;
|
|
|
width: 30%;
|
|
width: 30%;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
&:nth-child(2) {
|
|
&:nth-child(2) {
|
|
|
width: 30%;
|
|
width: 30%;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
&:nth-child(3) {
|
|
&:nth-child(3) {
|
|
|
width: 20%;
|
|
width: 20%;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
&:nth-child(4) {
|
|
&:nth-child(4) {
|
|
|
text-align: right;
|
|
text-align: right;
|
|
|
width: 20%;
|
|
width: 20%;
|