Commit 5df4ddde authored by Edwise's avatar Edwise 🍷

v2迭代

parent 7d3a7955
No preview for this file type
......@@ -16,6 +16,7 @@
"experienceMax":1000,
"senceGuide":true,
"updateTime":1607507495319,
"lastEnergyTime":1607507395319
"lastEnergyTime":1607507395319,
"serverTime":1607507495319
}
}
......@@ -2312,7 +2312,18 @@ var Ins = (function () {
Ins.bezier = function (t, p0, p1, p2) {
return Math.pow(1 - t, 2) * p0 + 2 * (1 - t) * t * p1 + Math.pow(t, 2) * p2;
};
Ins.recoverEnergy = 10 * 60 * 1000;
Ins.intervalTime = function (time) {
var date3 = time;
var days = Math.floor(date3 / (24 * 3600 * 1000));
var leave1 = date3 % (24 * 3600 * 1000);
var hours = Math.floor(leave1 / (3600 * 1000));
var leave2 = leave1 % (3600 * 1000);
var minutes = Math.floor(leave2 / (60 * 1000));
var leave3 = leave2 % (60 * 1000);
var seconds = Math.round(leave3 / 1000);
return minutes + "分" + seconds + "秒";
};
Ins.recoverEnergy = 1 * 60 * 1000;
Ins.salmonArr = [];
return Ins;
}());
......@@ -3145,7 +3156,7 @@ var Salmon = (function (_super) {
}
else {
that.mouseEnable = true;
Ins_1.Ins.showToast();
Ins_1.Ins.showToast(r && r.message);
Ins_1.Ins.hideLoading();
}
});
......@@ -3159,7 +3170,10 @@ var Salmon = (function (_super) {
}
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.SALMON_ANIM, { x: this.x, y: this.y, index: this._index });
};
Salmon.prototype.setCnt = function (value) {
Salmon.prototype.setCnt = function (value, id) {
if (id) {
this._id = id;
}
this.salmonCnt = value;
this.updateCntLabel();
};
......@@ -47605,8 +47619,8 @@ var MainScene = (function (_super) {
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins_1.Ins.userInfo.lastEnergyTime).getMinutes());
var time = Ins_1.Ins.userInfo.updateTime - Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Math.floor(time % 3600 / 60));
var time = Ins_1.Ins.userInfo.serverTime - Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Ins_1.Ins.intervalTime(time));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
}
......@@ -47708,6 +47722,21 @@ var MainScene = (function (_super) {
break;
}
};
MainScene.prototype.recalSetGroupV = function () {
var that = this;
if ((Ins_1.Ins.curScene) == (Ins_1.Ins.senceInfo.sence)) {
that.cat.visible = true;
that.salmonGroup.visible = true;
that.coinAnimGroup.visible = true;
that.cat.stopCatAct();
}
else {
that.cat.visible = false;
that.salmonGroup.visible = false;
that.coinAnimGroup.visible = false;
that.cat.stopCatAct();
}
};
MainScene.prototype.changeMainScene = function (type) {
console.log("切换到" + type);
var that = this;
......@@ -47843,7 +47872,7 @@ var MainScene = (function (_super) {
setTimeout(function () {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
if (Ins_1.Ins.salmonArr)
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy);
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy, list[i]._id);
}
}, 100);
}
......@@ -47887,7 +47916,9 @@ var MainScene = (function (_super) {
that.cat.visible = true;
that.cat.stopCatAct();
}
that.setSceneTips(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene);
that.mainUi.changeBtnByUiType(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene);
that.recalSetGroupV();
}
}
else {
This diff is collapsed.
......@@ -2314,7 +2314,18 @@ var Ins = (function () {
Ins.bezier = function (t, p0, p1, p2) {
return Math.pow(1 - t, 2) * p0 + 2 * (1 - t) * t * p1 + Math.pow(t, 2) * p2;
};
Ins.recoverEnergy = 10 * 60 * 1000;
Ins.intervalTime = function (time) {
var date3 = time;
var days = Math.floor(date3 / (24 * 3600 * 1000));
var leave1 = date3 % (24 * 3600 * 1000);
var hours = Math.floor(leave1 / (3600 * 1000));
var leave2 = leave1 % (3600 * 1000);
var minutes = Math.floor(leave2 / (60 * 1000));
var leave3 = leave2 % (60 * 1000);
var seconds = Math.round(leave3 / 1000);
return minutes + "分" + seconds + "秒";
};
Ins.recoverEnergy = 1 * 60 * 1000;
Ins.salmonArr = [];
return Ins;
}());
......@@ -3147,7 +3158,7 @@ var Salmon = (function (_super) {
}
else {
that.mouseEnable = true;
Ins_1.Ins.showToast();
Ins_1.Ins.showToast(r && r.message);
Ins_1.Ins.hideLoading();
}
});
......@@ -3161,7 +3172,10 @@ var Salmon = (function (_super) {
}
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.SALMON_ANIM, { x: this.x, y: this.y, index: this._index });
};
Salmon.prototype.setCnt = function (value) {
Salmon.prototype.setCnt = function (value, id) {
if (id) {
this._id = id;
}
this.salmonCnt = value;
this.updateCntLabel();
};
......@@ -47607,8 +47621,8 @@ var MainScene = (function (_super) {
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins_1.Ins.userInfo.lastEnergyTime).getMinutes());
var time = Ins_1.Ins.userInfo.updateTime - Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Math.floor(time % 3600 / 60));
var time = Ins_1.Ins.userInfo.serverTime - Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Ins_1.Ins.intervalTime(time));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
}
......@@ -47710,6 +47724,21 @@ var MainScene = (function (_super) {
break;
}
};
MainScene.prototype.recalSetGroupV = function () {
var that = this;
if ((Ins_1.Ins.curScene) == (Ins_1.Ins.senceInfo.sence)) {
that.cat.visible = true;
that.salmonGroup.visible = true;
that.coinAnimGroup.visible = true;
that.cat.stopCatAct();
}
else {
that.cat.visible = false;
that.salmonGroup.visible = false;
that.coinAnimGroup.visible = false;
that.cat.stopCatAct();
}
};
MainScene.prototype.changeMainScene = function (type) {
console.log("切换到" + type);
var that = this;
......@@ -47845,7 +47874,7 @@ var MainScene = (function (_super) {
setTimeout(function () {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
if (Ins_1.Ins.salmonArr)
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy);
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy, list[i]._id);
}
}, 100);
}
......@@ -47889,7 +47918,9 @@ var MainScene = (function (_super) {
that.cat.visible = true;
that.cat.stopCatAct();
}
that.setSceneTips(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene);
that.mainUi.changeBtnByUiType(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene);
that.recalSetGroupV();
}
}
else {
......@@ -20,7 +20,7 @@ export class Ins {
public static curScene:SCENETYPE;
/**多长时间恢复精力(ms) */
public static recoverEnergy:number = 10*60*1000;
public static recoverEnergy:number = 1*60*1000;
/**当前游戏中的三文鱼 */
public static salmonArr:Salmon[] = [];
......@@ -42,7 +42,8 @@ export class Ins {
"experienceMax":number,
"senceGuide":boolean,
"lastEnergyTime":number,
"updateTime":number
"updateTime":number,
"serverTime":number
}
public static senceInfo: {
......
......@@ -73,13 +73,6 @@ export class Main {
//初始化层级
layers.init(this.stage);
console.log("初始化层级完成")
//初始化资源配置
// RES.loadConfig(ResJson);
// console.log("初始化资源配置完成")
//皮肤配置加载
// RES.loadSkinConfig(SkinJson);
//加载通用资源
// await RES.loadGroup("common");
Ins.stageW = this.stage.viewRect.width;
Ins.stageH = this.stage.viewRect.height;
Ins.stage = this.stage;
......
......@@ -86,7 +86,7 @@ export class Salmon extends Module{
FYGE.GDispatcher.dispatchEvent(MSG.UPDATE_ENERGY,{call:()=>{that.getSalmonAnim()}});
}else{
that.mouseEnable = true;
Ins.showToast();
Ins.showToast(r&&r.message);
Ins.hideLoading();
}
})
......@@ -103,7 +103,10 @@ export class Salmon extends Module{
FYGE.GDispatcher.dispatchEvent(MSG.SALMON_ANIM,{x:this.x,y:this.y,index:this._index});
}
setCnt(value){
setCnt(value,id?){
if(id){
this._id = id;
}
this.salmonCnt = value;
this.updateCntLabel();
}
......
......@@ -361,7 +361,7 @@ export class MainScene extends Scene {
var that = this;
if (that.recoverEnergyHandler) clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins.userInfo.lastEnergyTime).getMinutes())
let time = Ins.userInfo.updateTime - Ins.userInfo.lastEnergyTime;
let time = Ins.userInfo.serverTime - Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Ins.intervalTime(time))
if (time <= Ins.recoverEnergy) {
that.recoverEnergyTime = Ins.recoverEnergy - time;
......@@ -481,6 +481,22 @@ export class MainScene extends Scene {
}
}
/**当召回猫咪的时候判断当前的三文鱼精力组以及鱼鱼的动画组是否隐藏 */
recalSetGroupV() {
var that = this;
if ((Ins.curScene) == (Ins.senceInfo.sence)) {
that.cat.visible = true;
that.salmonGroup.visible = true;
that.coinAnimGroup.visible = true;
that.cat.stopCatAct();
} else {
that.cat.visible = false;
that.salmonGroup.visible = false;
that.coinAnimGroup.visible = false;
that.cat.stopCatAct();
}
}
/**切换场景 */
changeMainScene(type: SCENETYPE) {
console.log("切换到" + type)
......@@ -620,23 +636,23 @@ export class MainScene extends Scene {
setIndex++;
}
for(let i=1;i<this.salmonArr.length;i++){
for(let j=0;j<this.salmonArr.length-i;j++){
if(this.salmonArr[i].index>this.salmonArr[i].index){
for (let i = 1; i < this.salmonArr.length; i++) {
for (let j = 0; j < this.salmonArr.length - i; j++) {
if (this.salmonArr[i].index > this.salmonArr[i].index) {
let temp = this.salmonArr[j];
this.salmonArr[j] = this.salmonArr[j+1];
this.salmonArr[j+1] = temp;
this.salmonArr[j] = this.salmonArr[j + 1];
this.salmonArr[j + 1] = temp;
}
}
}
setTimeout(() => {
for (let i = 0; i < Ins.salmonArr.length; i++) {
if(Ins.salmonArr)
// if (Ins.salmonArr[i] && list[Ins.salmonArr[i].index])
Ins.salmonArr[i].setCnt(list[i].energy);
if (Ins.salmonArr)
// if (Ins.salmonArr[i] && list[Ins.salmonArr[i].index])
Ins.salmonArr[i].setCnt(list[i].energy, list[i]._id);
// index = i;
}
},100)
}, 100)
}
}
......@@ -685,7 +701,9 @@ export class MainScene extends Scene {
that.cat.visible = true;
that.cat.stopCatAct();
}
that.setSceneTips(Ins.curScene > 3 ? 3 : Ins.curScene);
that.mainUi.changeBtnByUiType(Ins.curScene > 3 ? 3 : Ins.curScene);
that.recalSetGroupV();
}
} else {
Ins.showToast(r.message);
......
......@@ -30,7 +30,9 @@ App({
// this.activityId = activityId || '5f81841def5071b132fd5e21'; //赵然
// this.activityId = activityId || '5f8022919da671f3b6d5fb14'; //小婷1
// this.activityId = activityId || '5f8d47218e6a0888fc426fad'; //小婷2zhengshi
this.activityId = activityId || '5f87e8a29897b4e0ce0ada02'; //ceshi
// this.activityId = activityId || '5f87e8a29897b4e0ce0ada02'; //ceshi
// this.activityId = activityId || '5fd42308c3ad34a8ccdeb141'; //迭代v2赵然测试1
this.activityId = activityId || '5fd48529964f9752747927f4'; //迭代v2赵然测试2
}
......
<view class="shop">
<view class="shop-page" style="{{{'background':`url(${resList['e2616129-e292-4333-b107-98c102328165'].url}) no-repeat center top/cover`}}}">
<label class="shop_gold">{{happyCoin}}</label>
<!-- <view class="shop_gold_div"> -->
<label class="shop_gold">{{happyCoin}}</label>
<!-- </view> -->
<image a:if={{false}} class="shop_backbtn" src={{resList['bdab9777-8a4d-4659-ba23-66aaddb7fa5b'].url}} />
<view class="shop-wrap">
<view class="shop-list">
......
......@@ -182,7 +182,9 @@ Page({
id
}
} = e.target.dataset;
const { data, success, message } = await API.checkReceive({ id: id, code: code })
const { data, success, message } = await API.checkReceive({ id: id, code: code }).catch(res => {
commonToast(res && res.message);
}) || {};
if (success) {
this.cloudTBIssue({
strategyCode,
......@@ -200,10 +202,7 @@ Page({
.catch(err => {
API.receivLaFeiPrize({ result: err })
})
} else {
commonToast(message);
}
// const { activityId } = app;
// console.log(item, '领取权益')
// const { success, data, message } = await API.receiveEnamePrize({ activityId, _id: item._id }).catch(res => {
......
......@@ -2314,7 +2314,18 @@ var Ins = (function () {
Ins.bezier = function (t, p0, p1, p2) {
return Math.pow(1 - t, 2) * p0 + 2 * (1 - t) * t * p1 + Math.pow(t, 2) * p2;
};
Ins.recoverEnergy = 10 * 60 * 1000;
Ins.intervalTime = function (time) {
var date3 = time;
var days = Math.floor(date3 / (24 * 3600 * 1000));
var leave1 = date3 % (24 * 3600 * 1000);
var hours = Math.floor(leave1 / (3600 * 1000));
var leave2 = leave1 % (3600 * 1000);
var minutes = Math.floor(leave2 / (60 * 1000));
var leave3 = leave2 % (60 * 1000);
var seconds = Math.round(leave3 / 1000);
return minutes + "分" + seconds + "秒";
};
Ins.recoverEnergy = 1 * 60 * 1000;
Ins.salmonArr = [];
return Ins;
}());
......@@ -3147,7 +3158,7 @@ var Salmon = (function (_super) {
}
else {
that.mouseEnable = true;
Ins_1.Ins.showToast();
Ins_1.Ins.showToast(r && r.message);
Ins_1.Ins.hideLoading();
}
});
......@@ -3161,7 +3172,10 @@ var Salmon = (function (_super) {
}
FYGE.GDispatcher.dispatchEvent(Enum_1.MSG.SALMON_ANIM, { x: this.x, y: this.y, index: this._index });
};
Salmon.prototype.setCnt = function (value) {
Salmon.prototype.setCnt = function (value, id) {
if (id) {
this._id = id;
}
this.salmonCnt = value;
this.updateCntLabel();
};
......@@ -47607,8 +47621,8 @@ var MainScene = (function (_super) {
if (that.recoverEnergyHandler)
clearInterval(that.recoverEnergyHandler);
console.log("上一次恢复精力的时间", new Date(Ins_1.Ins.userInfo.lastEnergyTime).getMinutes());
var time = Ins_1.Ins.userInfo.updateTime - Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Math.floor(time % 3600 / 60));
var time = Ins_1.Ins.userInfo.serverTime - Ins_1.Ins.userInfo.lastEnergyTime;
console.log("相差的时间", Ins_1.Ins.intervalTime(time));
if (time <= Ins_1.Ins.recoverEnergy) {
that.recoverEnergyTime = Ins_1.Ins.recoverEnergy - time;
}
......@@ -47710,6 +47724,21 @@ var MainScene = (function (_super) {
break;
}
};
MainScene.prototype.recalSetGroupV = function () {
var that = this;
if ((Ins_1.Ins.curScene) == (Ins_1.Ins.senceInfo.sence)) {
that.cat.visible = true;
that.salmonGroup.visible = true;
that.coinAnimGroup.visible = true;
that.cat.stopCatAct();
}
else {
that.cat.visible = false;
that.salmonGroup.visible = false;
that.coinAnimGroup.visible = false;
that.cat.stopCatAct();
}
};
MainScene.prototype.changeMainScene = function (type) {
console.log("切换到" + type);
var that = this;
......@@ -47845,7 +47874,7 @@ var MainScene = (function (_super) {
setTimeout(function () {
for (var i = 0; i < Ins_1.Ins.salmonArr.length; i++) {
if (Ins_1.Ins.salmonArr)
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy);
Ins_1.Ins.salmonArr[i].setCnt(list[i].energy, list[i]._id);
}
}, 100);
}
......@@ -47889,7 +47918,9 @@ var MainScene = (function (_super) {
that.cat.visible = true;
that.cat.stopCatAct();
}
that.setSceneTips(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene);
that.mainUi.changeBtnByUiType(Ins_1.Ins.curScene > 3 ? 3 : Ins_1.Ins.curScene);
that.recalSetGroupV();
}
}
else {
......@@ -133,7 +133,19 @@
text-overflow: ellipsis;
white-space: nowrap;
}
.shop .shop_gold_div {
opacity: 1;
height: 54rpx;
left: 370rpx;
top: 320rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
vertical-align: middle;
display: flex;
align-items: center;
justify-content: space-around;
flex-direction: column;
}
.shop .shop_gold {
opacity: 1;
height: 54rpx;
......
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