Commit d8836db3 by MichaelJier

feature

1. 增加6种红包的区域限制提示
parent 8c6951ee
...@@ -91,6 +91,8 @@ export default { ...@@ -91,6 +91,8 @@ export default {
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.redInfo = res.data; this.redInfo = res.data;
this._timerWait(res.data.wait); this._timerWait(res.data.wait);
} else {
res.errorMessage && this.$layer.msg(res.errorMessage);
} }
}, },
async _openRed() { async _openRed() {
......
...@@ -101,13 +101,20 @@ export default { ...@@ -101,13 +101,20 @@ export default {
this.isAjax = true; this.isAjax = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.countDownInfo.svSalt = res.data.svSalt || ''; this.countDownInfo.svSalt = res.data.svSalt || '';
return res
} else {
res.errorMessage && this.$layer.msg(res.errorMessage);
return false
} }
}, },
async _openRed() { async _openRed() {
if (this.times > 0) { if (this.times > 0) {
return false return false
} }
await this._robRedpacket() const rob = await this._robRedpacket()
if (!rob) {
return
}
if (!this.isAjax) { if (!this.isAjax) {
return '红包不存在'; return '红包不存在';
} }
......
<template> <template>
<div class="default" v-show="redInfo.rid" @click="_closeRed"> <div class="default" v-if="redInfo.rid" @click="_closeRed">
<div class="box" @click.stop> <div class="box" @click.stop>
<i class="close" @click="_closeRed"></i> <i class="close" @click="_closeRed"></i>
<div class="red-info" v-if="!showLuck"> <div class="red-info" v-if="!showLuck">
...@@ -75,6 +75,8 @@ export default { ...@@ -75,6 +75,8 @@ export default {
this.isAjax = true; this.isAjax = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.redInfo = res.data; this.redInfo = res.data;
} else {
res.errorMessage && this.$layer.msg(res.errorMessage);
} }
}, },
async _openRed() { async _openRed() {
......
<template> <template>
<div class="password" v-show="redInfo.rid" @click="_closeRed"> <div class="password" v-if="redInfo.rid" @click="_closeRed">
<div class="box" @click.stop> <div class="box" @click.stop>
<i class="close" @click="_closeRed"></i> <i class="close" @click="_closeRed"></i>
<div class="red-info" v-if="!showLuck"> <div class="red-info" v-if="!showLuck">
...@@ -82,6 +82,8 @@ export default { ...@@ -82,6 +82,8 @@ export default {
this.isAjax = true; this.isAjax = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.redInfo = res.data; this.redInfo = res.data;
} else {
res.errorMessage && this.$layer.msg(res.errorMessage);
} }
}, },
async _openRed() { async _openRed() {
......
...@@ -85,6 +85,10 @@ export default { ...@@ -85,6 +85,10 @@ export default {
this.isAjax = true; this.isAjax = true;
if (res.code === 200 && res.errorCode === 0) { if (res.code === 200 && res.errorCode === 0) {
this.rainInfo.svSalt = res.data.svSalt || ''; this.rainInfo.svSalt = res.data.svSalt || '';
return res
} else {
res.errorMessage && this.$layer.msg(res.errorMessage);
return false
} }
}, },
async checkRainIsOpen() { async checkRainIsOpen() {
...@@ -100,7 +104,6 @@ export default { ...@@ -100,7 +104,6 @@ export default {
} }
}, },
async _openRed() { async _openRed() {
await this._robRedpacket()
if (!this.isAjax) { if (!this.isAjax) {
return '红包不存在'; return '红包不存在';
} }
...@@ -130,8 +133,12 @@ export default { ...@@ -130,8 +133,12 @@ export default {
} }
return '未抢到' return '未抢到'
}, },
playGame() { async playGame() {
if (this.userInfo.id) { if (this.userInfo.id) {
const rob = await this._robRedpacket()
if (!rob) {
return
}
const rainGame = require('./game') const rainGame = require('./game')
this.showGame = !this.showGame this.showGame = !this.showGame
this.$nextTick(() => { this.$nextTick(() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment