Commit 7ee3ae78 authored by Edwise's avatar Edwise 🍷

1234

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