Commit 7ee3ae78 authored by Edwise's avatar Edwise 🍷

1234

parent 46414ec2
...@@ -46956,6 +46956,7 @@ var MainScene = (function (_super) { ...@@ -46956,6 +46956,7 @@ var MainScene = (function (_super) {
if (Ins_1.Ins.catIsOut) { if (Ins_1.Ins.catIsOut) {
that.cat.visible = false; that.cat.visible = false;
that.letter.visible = true; that.letter.visible = true;
that.initRecallCatTimer();
} }
}; };
MainScene.prototype.initRecallCatTimer = function () { MainScene.prototype.initRecallCatTimer = function () {
...@@ -47171,6 +47172,8 @@ var MainScene = (function (_super) { ...@@ -47171,6 +47172,8 @@ var MainScene = (function (_super) {
Ins_1.Ins.senceInfo = r.data; Ins_1.Ins.senceInfo = r.data;
if (r.data.sence < 4) { if (r.data.sence < 4) {
Ins_1.Ins.catIsOut = false; Ins_1.Ins.catIsOut = false;
clearTimeout(that.recallTimer);
console.log("删除召回倒计时", that.recallTimer);
that.letter.visible = false; that.letter.visible = false;
if (r.data.sence == 3) { if (r.data.sence == 3) {
that.cat.visible = true; that.cat.visible = true;
This diff is collapsed.
...@@ -46958,6 +46958,7 @@ var MainScene = (function (_super) { ...@@ -46958,6 +46958,7 @@ var MainScene = (function (_super) {
if (Ins_1.Ins.catIsOut) { if (Ins_1.Ins.catIsOut) {
that.cat.visible = false; that.cat.visible = false;
that.letter.visible = true; that.letter.visible = true;
that.initRecallCatTimer();
} }
}; };
MainScene.prototype.initRecallCatTimer = function () { MainScene.prototype.initRecallCatTimer = function () {
...@@ -47173,6 +47174,8 @@ var MainScene = (function (_super) { ...@@ -47173,6 +47174,8 @@ var MainScene = (function (_super) {
Ins_1.Ins.senceInfo = r.data; Ins_1.Ins.senceInfo = r.data;
if (r.data.sence < 4) { if (r.data.sence < 4) {
Ins_1.Ins.catIsOut = false; Ins_1.Ins.catIsOut = false;
clearTimeout(that.recallTimer);
console.log("删除召回倒计时", that.recallTimer);
that.letter.visible = false; that.letter.visible = false;
if (r.data.sence == 3) { if (r.data.sence == 3) {
that.cat.visible = true; that.cat.visible = true;
...@@ -33,7 +33,8 @@ export class Ins { ...@@ -33,7 +33,8 @@ export class Ins {
"senceTips":string[], //场景互动文案(猫咪说话) "senceTips":string[], //场景互动文案(猫咪说话)
"energyMax":number, "energyMax":number,
"experienceMax":number, "experienceMax":number,
"senceGuide":boolean "senceGuide":boolean,
"lastEnergyTime":number
} }
......
...@@ -49,6 +49,8 @@ export class MainScene extends Scene { ...@@ -49,6 +49,8 @@ export class MainScene extends Scene {
/**场景引导 */ /**场景引导 */
private Guide: Guide; private Guide: Guide;
/**是否是重新进入游戏场景 */
initUi() { initUi() {
var that = this; var that = this;
that.initSceneEle(); that.initSceneEle();
...@@ -112,7 +114,7 @@ export class MainScene extends Scene { ...@@ -112,7 +114,7 @@ export class MainScene extends Scene {
//当猫出走的时候,隐藏猫咪,创建信封 //当猫出走的时候,隐藏猫咪,创建信封
that.letter.visible = true; that.letter.visible = true;
// that.initRecallCatTimer() that.initRecallCatTimer()
} }
} }
...@@ -354,7 +356,8 @@ export class MainScene extends Scene { ...@@ -354,7 +356,8 @@ export class MainScene extends Scene {
Ins.senceInfo = r.data; Ins.senceInfo = r.data;
if (r.data.sence < 4) { if (r.data.sence < 4) {
Ins.catIsOut = false; Ins.catIsOut = false;
// clearTimeout(that.recallTimer) clearTimeout(that.recallTimer)
console.log("删除召回倒计时",that.recallTimer)
that.letter.visible = false; that.letter.visible = false;
if (r.data.sence == 3) { if (r.data.sence == 3) {
that.cat.visible = true; that.cat.visible = true;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<label class="recallcathappycoin">{{happyCoinCnt}}</label> <label class="recallcathappycoin">{{happyCoinCnt}}</label>
<view class="recallbtngroup"> <view class="recallbtngroup">
<image class="recallbtncancel btn" onTap="onModalClose" src={{resList['6957d9f3-9aa4-4ed6-9b83-57cc68f16512'].url}} /> <image class="recallbtncancel btn" onTap="onModalClose" src={{resList['6957d9f3-9aa4-4ed6-9b83-57cc68f16512'].url}} />
<image class="recallbtngo btn" disable="{{btnEnable}}" onTap="onRecallCat" src={{resList['6d8cdd11-fbc5-4e84-b5ef-1f74c9070738'].url}} /> <image class="recallbtngo btn" disabled="{{btnEnable}}" onTap="onRecallCat" src={{resList['6d8cdd11-fbc5-4e84-b5ef-1f74c9070738'].url}} />
</view> </view>
<image class="recallbtnclose" onTap="onModalClose" src={{resList['29e80fbb-98ed-40fb-a11b-e14b45fee158'].url}} /> <image class="recallbtnclose" onTap="onModalClose" src={{resList['29e80fbb-98ed-40fb-a11b-e14b45fee158'].url}} />
</view> </view>
...@@ -3,17 +3,21 @@ ...@@ -3,17 +3,21 @@
import API from '../../api'; import API from '../../api';
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
const app = getApp(); const app = getApp();
const { tbcc } = app; const {
const { commonToast } = tbcc.tb; tbcc
} = app;
const {
commonToast
} = tbcc.tb;
Component({ Component({
props: { props: {
mydata:null mydata: null
}, },
data: { data: {
resList: resList, resList: resList,
timeText: '', timeText: '',
happyCoinCnt: '', happyCoinCnt: '',
btnEnable:true btnEnable: true
}, },
methods: { methods: {
onModalClose() { onModalClose() {
...@@ -33,7 +37,7 @@ Component({ ...@@ -33,7 +37,7 @@ Component({
let hours = date.getHours(); let hours = date.getHours();
let minutes = date.getMinutes();; let minutes = date.getMinutes();;
let seconds = date.getSeconds(); let seconds = date.getSeconds();
if (hours <= 0) { if (hours <= 0) {
if (minutes <= 0) { if (minutes <= 0) {
// if (seconds <= 0) { // if (seconds <= 0) {
...@@ -55,11 +59,11 @@ Component({ ...@@ -55,11 +59,11 @@ Component({
}, },
/**计算两个时间戳相差的时间,小时,分,秒 */ /**计算两个时间戳相差的时间,小时,分,秒 */
compareTime(startTime,endTime){ compareTime(startTime, endTime) {
let between = (endTime - startTime)/1000; let between = (endTime - startTime) / 1000;
let hours = Math.floor(between%(24*36000)/3600); let hours = Math.floor(between % (24 * 36000) / 3600);
let minutes = Math.floor(between%3600/60); let minutes = Math.floor(between % 3600 / 60);
let seconds = Math.floor(between%60/60); let seconds = Math.floor(between % 60 / 60);
let date; let date;
if (hours <= 0) { if (hours <= 0) {
if (minutes <= 0) { if (minutes <= 0) {
...@@ -81,14 +85,14 @@ Component({ ...@@ -81,14 +85,14 @@ Component({
/**召回猫,打开召回猫的奖励弹窗 */ /**召回猫,打开召回猫的奖励弹窗 */
async onRecallCat() { async onRecallCat() {
if(!this.data.btnEnable) return; // if (!this.data.btnEnable) return;
console.log("召回猫") console.log("召回猫")
my.__clickDelay__(this); // my.__clickDelay__(this);
my.showLoading(); my.showLoading();
const recallCat = await API.recallCat().catch(r=>{ const recallCat = await API.recallCat().catch(r => {
my.hideLoading(); my.hideLoading();
commonToast(r&&r.message); commonToast(r && r.message);
})||{}; }) || {};
if (recallCat && recallCat.success) { if (recallCat && recallCat.success) {
my.hideLoading(); my.hideLoading();
this.onModalClose(); this.onModalClose();
...@@ -96,8 +100,8 @@ Component({ ...@@ -96,8 +100,8 @@ Component({
onRecallCat onRecallCat
} = this.props; } = this.props;
onRecallCat && onRecallCat(recallCat.data); onRecallCat && onRecallCat(recallCat.data);
} }
} }
}, },
...@@ -108,11 +112,11 @@ Component({ ...@@ -108,11 +112,11 @@ Component({
// })||{}; // })||{};
// console.log(recall); // console.log(recall);
// if (recall && recall.success) { // if (recall && recall.success) {
var text = "猫咪预计" + this.compareTime(this.props.mydata.recallInfo.serverTime , this.props.mydata.recallInfo.backTime) + "后回寝"; var text = "猫咪预计" + this.compareTime(this.props.mydata.recallInfo.serverTime, this.props.mydata.recallInfo.backTime) + "后回寝";
this.setData({ this.setData({
timeText: text, timeText: text,
happyCoinCnt: this.props.mydata.recallInfo.value + '' happyCoinCnt: this.props.mydata.recallInfo.value + ''
}) })
// } // }
} }
......
...@@ -46958,6 +46958,7 @@ var MainScene = (function (_super) { ...@@ -46958,6 +46958,7 @@ var MainScene = (function (_super) {
if (Ins_1.Ins.catIsOut) { if (Ins_1.Ins.catIsOut) {
that.cat.visible = false; that.cat.visible = false;
that.letter.visible = true; that.letter.visible = true;
that.initRecallCatTimer();
} }
}; };
MainScene.prototype.initRecallCatTimer = function () { MainScene.prototype.initRecallCatTimer = function () {
...@@ -47173,6 +47174,8 @@ var MainScene = (function (_super) { ...@@ -47173,6 +47174,8 @@ var MainScene = (function (_super) {
Ins_1.Ins.senceInfo = r.data; Ins_1.Ins.senceInfo = r.data;
if (r.data.sence < 4) { if (r.data.sence < 4) {
Ins_1.Ins.catIsOut = false; Ins_1.Ins.catIsOut = false;
clearTimeout(that.recallTimer);
console.log("删除召回倒计时", that.recallTimer);
that.letter.visible = false; that.letter.visible = false;
if (r.data.sence == 3) { if (r.data.sence == 3) {
that.cat.visible = true; that.cat.visible = true;
<view disable-scroll="true" class="page-game"> <view disable-scroll="true" class="page-game">
<canvas disable-scroll="true" id="canvas" type="webgl" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady"> <canvas disable-scroll="true" id="canvas" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas> </canvas>
</view> </view>
......
...@@ -46958,6 +46958,7 @@ var MainScene = (function (_super) { ...@@ -46958,6 +46958,7 @@ var MainScene = (function (_super) {
if (Ins_1.Ins.catIsOut) { if (Ins_1.Ins.catIsOut) {
that.cat.visible = false; that.cat.visible = false;
that.letter.visible = true; that.letter.visible = true;
that.initRecallCatTimer();
} }
}; };
MainScene.prototype.initRecallCatTimer = function () { MainScene.prototype.initRecallCatTimer = function () {
...@@ -47173,6 +47174,8 @@ var MainScene = (function (_super) { ...@@ -47173,6 +47174,8 @@ var MainScene = (function (_super) {
Ins_1.Ins.senceInfo = r.data; Ins_1.Ins.senceInfo = r.data;
if (r.data.sence < 4) { if (r.data.sence < 4) {
Ins_1.Ins.catIsOut = false; Ins_1.Ins.catIsOut = false;
clearTimeout(that.recallTimer);
console.log("删除召回倒计时", that.recallTimer);
that.letter.visible = false; that.letter.visible = false;
if (r.data.sence == 3) { if (r.data.sence == 3) {
that.cat.visible = true; that.cat.visible = true;
This diff is collapsed.
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 to comment