Commit 456b278f authored by Edwise's avatar Edwise 🍷

1234

parent 357a12a9
......@@ -2409,6 +2409,7 @@ var TbNetName;
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["getSence"] = "tmallCat.getSence";
TbNetName["updateSenceGuide"] = "tmallCat.updateSenceGuide";
TbNetName["recallInfo"] = "tmallCat.recallInfo";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["authorize"] = "mine.authorize";
......@@ -2870,21 +2871,27 @@ var Guide = (function (_super) {
that.initEvents();
};
Guide.prototype.changeGuide = function () {
this.index++;
if (this.index >= this['guideUUIDArr_' + this.guideType].length) {
this.callBack && this.callBack();
var that = this;
that.index++;
if (that.index >= that['guideUUIDArr_' + that.guideType].length) {
that.guideTouch.mouseEnable = false;
setTimeout(function () {
if (that && that.guideTouch)
that.guideTouch.mouseEnable = true;
}, 1000);
that.callBack && that.callBack();
return;
}
this.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[this['guideUUIDArr_' + this.guideType][this.index]].url);
if (this.guideType == 3 || this.guideType == 4) {
if (this.index == 4 || this.index == 5) {
this.catImg1.visible = false;
that.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[that['guideUUIDArr_' + that.guideType][that.index]].url);
if (that.guideType == 3 || that.guideType == 4) {
if (that.index == 4 || that.index == 5) {
that.catImg1.visible = false;
}
else {
this.catImg1.visible = true;
that.catImg1.visible = true;
}
}
console.log(this.guide.x, this.guide.y);
console.log(that.guide.x, that.guide.y);
};
Guide.prototype.initEvents = function () {
this.guideTouch.addEventListener(FYGE.MouseEvent.CLICK, this.changeGuide, this);
......@@ -46963,7 +46970,17 @@ var MainScene = (function (_super) {
MainScene.prototype.openLetter = function () {
console.log("打开信封弹窗");
if (this.letter && this.letter.visible) {
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
}
};
MainScene.prototype.removeLetter = function () {
......@@ -47315,6 +47332,7 @@ exports.MainSceneBtnUi = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ../TaoBaoNet */ "./src/TaoBaoNet.ts");
var MainSceneBtnUi = (function (_super) {
__extends(MainSceneBtnUi, _super);
function MainSceneBtnUi(data) {
......@@ -47533,7 +47551,17 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('recallcatModal', { catType: Ins_1.Ins.userInfo.catType, catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
};
MainSceneBtnUi.prototype.getEnergy = function () {
console.log("补充精力");
This diff is collapsed.
......@@ -2411,6 +2411,7 @@ var TbNetName;
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["getSence"] = "tmallCat.getSence";
TbNetName["updateSenceGuide"] = "tmallCat.updateSenceGuide";
TbNetName["recallInfo"] = "tmallCat.recallInfo";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["authorize"] = "mine.authorize";
......@@ -2872,21 +2873,27 @@ var Guide = (function (_super) {
that.initEvents();
};
Guide.prototype.changeGuide = function () {
this.index++;
if (this.index >= this['guideUUIDArr_' + this.guideType].length) {
this.callBack && this.callBack();
var that = this;
that.index++;
if (that.index >= that['guideUUIDArr_' + that.guideType].length) {
that.guideTouch.mouseEnable = false;
setTimeout(function () {
if (that && that.guideTouch)
that.guideTouch.mouseEnable = true;
}, 1000);
that.callBack && that.callBack();
return;
}
this.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[this['guideUUIDArr_' + this.guideType][this.index]].url);
if (this.guideType == 3 || this.guideType == 4) {
if (this.index == 4 || this.index == 5) {
this.catImg1.visible = false;
that.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[that['guideUUIDArr_' + that.guideType][that.index]].url);
if (that.guideType == 3 || that.guideType == 4) {
if (that.index == 4 || that.index == 5) {
that.catImg1.visible = false;
}
else {
this.catImg1.visible = true;
that.catImg1.visible = true;
}
}
console.log(this.guide.x, this.guide.y);
console.log(that.guide.x, that.guide.y);
};
Guide.prototype.initEvents = function () {
this.guideTouch.addEventListener(FYGE.MouseEvent.CLICK, this.changeGuide, this);
......@@ -46965,7 +46972,17 @@ var MainScene = (function (_super) {
MainScene.prototype.openLetter = function () {
console.log("打开信封弹窗");
if (this.letter && this.letter.visible) {
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
}
};
MainScene.prototype.removeLetter = function () {
......@@ -47317,6 +47334,7 @@ exports.MainSceneBtnUi = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ../TaoBaoNet */ "./src/TaoBaoNet.ts");
var MainSceneBtnUi = (function (_super) {
__extends(MainSceneBtnUi, _super);
function MainSceneBtnUi(data) {
......@@ -47535,7 +47553,17 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('recallcatModal', { catType: Ins_1.Ins.userInfo.catType, catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
};
MainSceneBtnUi.prototype.getEnergy = function () {
console.log("补充精力");
......@@ -37,6 +37,11 @@ export enum TbNetName {
*/
updateSenceGuide = "tmallCat.updateSenceGuide",
/**
* 召回信息
*/
recallInfo = "tmallCat.recallInfo",
/**
* 埋点统计 到时改名字
* activityId params elemType
......
......@@ -39,15 +39,15 @@ export class Guide extends Module {
callBack;
catImg1:FYGE.Lottie;
catImg1: FYGE.Lottie;
initUi() {
var that = this;
that.index = 0;
that.catPosArr = [80, 40, 60, 70];
var arr = [lanmao02shuohua,jumaoshuohua,sanhua02shuohua2,xianluoshuohua]
var arr = [lanmao02shuohua, jumaoshuohua, sanhua02shuohua2, xianluoshuohua]
/**猫咪图片 */
that.catImgUUIDArr = ['3e6311fd-15ab-4656-bb84-1c49f4ad4ed9', 'bbb10ff2-f4fb-43a8-83d8-abbb04949f2d', '9fc6517e-debe-4457-88ef-9c733d5bc072', 'ecb49f23-2e65-4507-8be6-1eee021a3b35']
......@@ -66,7 +66,7 @@ export class Guide extends Module {
// that.addChild(that.catImg);
that.catImg1 = new FYGE.Lottie(arr[Ins.userInfo.catType - 1])
that.addChild(that.catImg1);
if(Ins.userInfo.catType == 2){
if (Ins.userInfo.catType == 2) {
that.catImg1.y = 30;
}
// var x = (Ins.stageW - that.catImg.width) * 0.5;
......@@ -82,21 +82,27 @@ export class Guide extends Module {
}
changeGuide() {
this.index++;
if (this.index >= this['guideUUIDArr_' + this.guideType].length) {
var that = this;
that.index++;
if (that.index >= that['guideUUIDArr_' + that.guideType].length) {
that.guideTouch.mouseEnable = false;
setTimeout(() => {
if (that && that.guideTouch)
that.guideTouch.mouseEnable = true;
}, 1000);
// GDispatcher.dispatchEvent(MSG.GUIDE_BEDROOMEND);
this.callBack && this.callBack();
that.callBack && that.callBack();
return;
}
this.guide.texture = RES.getRes(resCanvasList[this['guideUUIDArr_' + this.guideType][this.index]].url)
if (this.guideType == 3 || this.guideType == 4) {
if (this.index == 4 || this.index == 5) {
this.catImg1.visible = false;
that.guide.texture = RES.getRes(resCanvasList[that['guideUUIDArr_' + that.guideType][that.index]].url)
if (that.guideType == 3 || that.guideType == 4) {
if (that.index == 4 || that.index == 5) {
that.catImg1.visible = false;
} else {
this.catImg1.visible = true;
that.catImg1.visible = true;
}
}
console.log(this.guide.x, this.guide.y)
console.log(that.guide.x, that.guide.y)
}
initEvents() {
......
......@@ -40,6 +40,9 @@ export class MainScene extends Scene {
private maxEnergy: number = 1500; //最大精力值
private recoverEnergyHandler: any; //恢复精力的定时器,用于保存下来方便清空
/**召回倒计时 */
private recallTimer;
/**猫咪等级 */
private level: number = 0;
......@@ -108,9 +111,23 @@ export class MainScene extends Scene {
that.cat.visible = false;
//当猫出走的时候,隐藏猫咪,创建信封
that.letter.visible = true;
// that.initRecallCatTimer()
}
}
/**当猫出走的时候,初始化前端的召回倒计时 */
initRecallCatTimer(){
var that = this;
sendTbNet(TbNetName.recallInfo,{},(s,r)=>{
if(s){
that.recallTimer = setTimeout(()=>{
that.recallCat();
},r.data.backTime-r.data.serverTime)
}
})
}
/**初始化引导 */
initGuide(sence) {
var that = this;
......@@ -154,7 +171,17 @@ export class MainScene extends Scene {
openLetter() {
console.log("打开信封弹窗")
if (this.letter && this.letter.visible) {
Ins.showModule('messageModal', { catName: Ins.userInfo.catName })
Ins.showLoading();
sendTbNet(TbNetName.recallInfo,{},(s,r)=>{
if(s){
Ins.hideLoading();
Ins.showModule('messageModal', { catName: Ins.userInfo.catName ,recallInfo:r.data})
}else{
Ins.hideLoading();
Ins.showToast(r.message);
}
})
}
}
......@@ -327,6 +354,7 @@ export class MainScene extends Scene {
Ins.senceInfo = r.data;
if (r.data.sence < 4) {
Ins.catIsOut = false;
// clearTimeout(that.recallTimer)
that.letter.visible = false;
if (r.data.sence == 3) {
that.cat.visible = true;
......
......@@ -7,6 +7,7 @@ import PanelCtrl from "../../module/ctrls/panelCtrl";
import { changeScene, showPanel } from "../../module/ctrls";
import { RulePanel } from "../panels/rulePanel";
import { MyPrizeScene } from "../scenes/MyPrizeScene";
import { sendTbNet, TbNetName } from "../TaoBaoNet";
export class MainSceneBtnUi extends Module {
/**主场景ui
......@@ -298,7 +299,17 @@ export class MainSceneBtnUi extends Module {
/**召回猫咪事件 */
catRecallHandler() {
console.log("召回猫咪");
Ins.showModule("recallcatModal", { catType: Ins.userInfo.catType })
Ins.showLoading();
sendTbNet(TbNetName.recallInfo, {}, (s, r) => {
if (s) {
Ins.hideLoading();
Ins.showModule('recallcatModal', { catType: Ins.userInfo.catType, catName: Ins.userInfo.catName, recallInfo: r.data })
} else {
Ins.hideLoading();
Ins.showToast(r.message);
}
})
// Ins.showModule("recallcatModal", { catType: Ins.userInfo.catType })
}
/**补充精力 */
......
......@@ -79,10 +79,10 @@
background-color: rgba(0, 0, 0, 0);
}
.catname .catnameinput .catnameinputrandom {
width: 500rpx;
width: 150rpx;
height: 26rpx;
opacity: 1;
left: 0rpx;
left: 175rpx;
top: 121rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
......
......@@ -16,6 +16,8 @@ Component({
/**获取字符串字符长度 */
getlen(str) {
var strlen = 0;
console.log("名称长度",str.length)
console.log("charChodeAt",str.charCodeAt)
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) > 255) //如果是汉字,则字符串长度加2
strlen += 2;
......@@ -83,6 +85,7 @@ Component({
this.onSelectCatOk();
} else {
console.log("ergerg")
my.hideLoading();
my.showToast({content:adoptCat.message||'网络异常,请稍后重试~'})
}
}
......
......@@ -24,7 +24,7 @@
margin-top: -325rpx;
/* top: 418rpx; */
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 50% 50% 0rpx;
}
.message .message_bg {
width: 676rpx;
......@@ -34,15 +34,30 @@
transform-origin: 0rpx 0rpx 0rpx;
}
.message .message_txt {
width: 142rpx;
width: 676rpx;
height: 25rpx;
opacity: 1;
left: 268rpx;
left: 0rpx;
top: 355rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 26rpx;
color: #685b4e;
text-align: center;
}
.message .message_backTime {
width: 578rpx;
height: 58rpx;
opacity: 1;
display: block;
left: 60rpx;
top: 211rpx;
position: absolute;
font-size: 28rpx;
color: rgba(104, 91, 78, 1);
transform-origin: 0rpx 0rpx 0rpx;
text-align: center;
font-weight: bold;
}
.message .message_btn {
width: 45rpx;
......@@ -51,7 +66,7 @@
left: 577rpx;
top: 24rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 50% 50% 0rpx;
}
.message .message_closebtn {
width: 352rpx;
......@@ -60,5 +75,5 @@
left: 161rpx;
top: 510rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 50% 50% 0rpx;
}
<view class="message-modal">
<view class="message__shade modal-animate-fade-in" />
<view class="message ">
<image class="message_bg " src={{resList['ed31e83e-535d-45bf-ba5b-20827a4cd104'].url}} />
<view class="message modal-animate-zoom-in">
<image class="message_bg " src={{resList['fc1fd3ee-e606-46de-9bb6-ea5fb41567df'].url}} />
<label class="message_txt ">{{mydata.catName+" 留"}}</label>
<image class="message_btn " onTap="onModalClose" src={{resList['3ad6a924-dda8-49f4-b8fc-0e796347e802'].url}} />
<image class="message_closebtn " onTap="onModalClose" src={{resList['5488b126-f520-496f-ace6-010a89eb108f'].url}} />
<label class="message_backTime ">{{backTime}}</label>
<image class="message_btn" onTap="onModalClose" src={{resList['3ad6a924-dda8-49f4-b8fc-0e796347e802'].url}} />
<image class="message_closebtn btn" onTap="onModalClose" src={{resList['5488b126-f520-496f-ace6-010a89eb108f'].url}} />
</view>
</view>
\ No newline at end of file
......@@ -2,31 +2,50 @@
import API from '../../api';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
Component({
props: {
mydata:null
mydata: null
},
data: {
resList: resList,
backTime:''
backTime: ''
},
methods: {
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
console.log('onModalClose')
}
},
async didMount(){
const recall = await API.recallInfo();
if(recall&&recall.success){
},
/**根据时间戳获取日期-月-日 */
getDateDayMonthByTime(time) {
let date = new Date(time);
let hours = date.getHours();
let minutes = date.getMinutes();
minutes = minutes <= 0 ? '' : minutes + '分'
date = hours + "点" + minutes;
return date;
},
async getBackTime() {
// my.showLoading();
// const recall = await API.recallInfo().catch(r=>{
// commonToast(r&&r.message)
// my.hideLoading();
// })||{};
// if (recall && recall.success) {
// my.hideLoading();
this.setData({
backTime:recall.data.backTime
backTime: this.getDateDayMonthByTime(this.props.mydata.recallInfo.backTime)
})
}else{
my.showToast(recall?recall.message:null);
// }
}
},
didMount() {
this.getBackTime();
}
});
\ No newline at end of file
......@@ -52,7 +52,7 @@
height: 105rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 50% 50% 0rpx;
}
.recallcat .recallbtngroup .recallbtngo {
width: 281rpx;
......@@ -60,7 +60,7 @@
opacity: 1;
left: 327rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
transform-origin: 50% 50% 0rpx;
}
.recallcat .recallbtnclose {
width: 44rpx;
......
......@@ -3,8 +3,8 @@
<label class="recallcatbacklabel">{{timeText}}</label>
<label class="recallcathappycoin">{{happyCoinCnt}}</label>
<view class="recallbtngroup">
<image class="recallbtncancel" onTap="onModalClose" src={{resList['6957d9f3-9aa4-4ed6-9b83-57cc68f16512'].url}} />
<image class="recallbtngo" onTap="onRecallCat" src={{resList['6d8cdd11-fbc5-4e84-b5ef-1f74c9070738'].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}} />
</view>
<image class="recallbtnclose" onTap="onModalClose" src={{resList['29e80fbb-98ed-40fb-a11b-e14b45fee158'].url}} />
</view>
......@@ -2,12 +2,18 @@
import API from '../../api';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
Component({
props: {},
props: {
mydata:null
},
data: {
resList: resList,
timeText: '',
happyCoinCnt: ''
happyCoinCnt: '',
btnEnable:true
},
methods: {
onModalClose() {
......@@ -27,6 +33,7 @@ Component({
let hours = date.getHours();
let minutes = date.getMinutes();;
let seconds = date.getSeconds();
if (hours <= 0) {
if (minutes <= 0) {
// if (seconds <= 0) {
......@@ -47,36 +54,66 @@ Component({
return date;
},
/**计算两个时间戳相差的时间,小时,分,秒 */
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) {
// if (seconds <= 0) {
date = 0 + '小时' + 0 + '分';
// } else {
// date = seconds + "秒"
// }
} else {
date = hours + '小时' + minutes + '分';
}
} else {
date = hours + '小时' + minutes + '分';
}
return date;
},
/**召回猫,打开召回猫的奖励弹窗 */
async onRecallCat() {
const recallCat = await API.recallCat();
if(!this.data.btnEnable) return;
console.log("召回猫")
my.__clickDelay__(this);
my.showLoading();
const recallCat = await API.recallCat().catch(r=>{
my.hideLoading();
commonToast(r&&r.message);
})||{};
if (recallCat && recallCat.success) {
my.hideLoading();
this.onModalClose();
const {
onRecallCat
} = this.props;
onRecallCat && onRecallCat(recallCat.data);
my.__updateUserInfo__();
} else {
my.showToast({content:recallCat ? recallCat.message : null})
}
}
}
},
async didMount() {
const recall = await API.recallInfo();
console.log(recall);
if (recall && recall.success) {
var text = "猫咪预计" + this.getDateDayMonthByTime(recall.data.backTime - recall.data.serverTime) + "后回寝";
// const recall = await API.recallInfo().catch(r=>{
// commonToast(r&&r.message)
// })||{};
// console.log(recall);
// if (recall && recall.success) {
var text = "猫咪预计" + this.compareTime(this.props.mydata.recallInfo.serverTime , this.props.mydata.recallInfo.backTime) + "后回寝";
this.setData({
timeText: text,
happyCoinCnt: recall.data.value + ''
happyCoinCnt: this.props.mydata.recallInfo.value + ''
})
} else {
my.showToast(recall ? recall.message : null)
}
// }
}
});
\ No newline at end of file
......@@ -2411,6 +2411,7 @@ var TbNetName;
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["getSence"] = "tmallCat.getSence";
TbNetName["updateSenceGuide"] = "tmallCat.updateSenceGuide";
TbNetName["recallInfo"] = "tmallCat.recallInfo";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["authorize"] = "mine.authorize";
......@@ -2872,21 +2873,27 @@ var Guide = (function (_super) {
that.initEvents();
};
Guide.prototype.changeGuide = function () {
this.index++;
if (this.index >= this['guideUUIDArr_' + this.guideType].length) {
this.callBack && this.callBack();
var that = this;
that.index++;
if (that.index >= that['guideUUIDArr_' + that.guideType].length) {
that.guideTouch.mouseEnable = false;
setTimeout(function () {
if (that && that.guideTouch)
that.guideTouch.mouseEnable = true;
}, 1000);
that.callBack && that.callBack();
return;
}
this.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[this['guideUUIDArr_' + this.guideType][this.index]].url);
if (this.guideType == 3 || this.guideType == 4) {
if (this.index == 4 || this.index == 5) {
this.catImg1.visible = false;
that.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[that['guideUUIDArr_' + that.guideType][that.index]].url);
if (that.guideType == 3 || that.guideType == 4) {
if (that.index == 4 || that.index == 5) {
that.catImg1.visible = false;
}
else {
this.catImg1.visible = true;
that.catImg1.visible = true;
}
}
console.log(this.guide.x, this.guide.y);
console.log(that.guide.x, that.guide.y);
};
Guide.prototype.initEvents = function () {
this.guideTouch.addEventListener(FYGE.MouseEvent.CLICK, this.changeGuide, this);
......@@ -46965,7 +46972,17 @@ var MainScene = (function (_super) {
MainScene.prototype.openLetter = function () {
console.log("打开信封弹窗");
if (this.letter && this.letter.visible) {
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
}
};
MainScene.prototype.removeLetter = function () {
......@@ -47317,6 +47334,7 @@ exports.MainSceneBtnUi = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ../TaoBaoNet */ "./src/TaoBaoNet.ts");
var MainSceneBtnUi = (function (_super) {
__extends(MainSceneBtnUi, _super);
function MainSceneBtnUi(data) {
......@@ -47535,7 +47553,17 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('recallcatModal', { catType: Ins_1.Ins.userInfo.catType, catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
};
MainSceneBtnUi.prototype.getEnergy = function () {
console.log("补充精力");
<view disable-scroll="true" class="page-game">
<canvas disable-scroll="true" id="canvas" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
<canvas disable-scroll="true" id="canvas" type="webgl" class="canvas" onTouchStart="onMouseEvent" onTouchMove="onMouseEvent" onTouchEnd="onMouseEvent" onReady="onCanvasReady">
</canvas>
</view>
......@@ -9,7 +9,7 @@
<message-modal a:if="{{messageModalVisible}}" mydata="{{messageModalData}}" onModalClose="closeMessageModal"></message-modal>
<view class="popcontainer" a:if="{{selectcatModalVisible}}"><selectcat-modal onModalClose="closeSelectcatModal" onSelectCat="selectCat"></selectcat-modal></view>
<view class="popcontainer" a:if="{{catnameModalVisible}}" ><catname-modal selectType="{{catType}}" onModalClose="closeCatnameModal" onSelectCatOk="selectCatOk" /></view>
<view class="popcontainer" a:if="{{recallcatModalVisible}}"><recallcat-modal onRecallCat="recallCat" onModalClose="closeRecallcatModal"></recallcat-modal></view>
<view class="popcontainer" a:if="{{recallcatModalVisible}}"><recallcat-modal mydata="{{recallcatModalData}}" onRecallCat="recallCat" onModalClose="closeRecallcatModal"></recallcat-modal></view>
<view class="popcontainer" a:if="{{getcatModalVisible}}"><getcat-modal selectType="{{catType}}" catName="{{catName}}" onPostSelectCat="postSelectCat" onModalClose="closeGetcatModal"></getcat-modal></view>
<view class="popcontainer" a:if="{{catbackbedModalVisible}}"><catbackbed-modal mydata="{{recallcatModalData}}" recallCatInfo="{{recallCatInfo}}" onUpdateUserInfo="updateUserInfo" onModalClose="closeCatbackModal"></catbackbed-modal></view>
<task-modal a:if="{{taskModalVisible}}" onModalClose="closeTaskModal"></task-modal>
......
......@@ -35,7 +35,7 @@ Page({
data: {
catType: 1,
catName: '',
activityBaseInfo:null,
activityBaseInfo: null,
recallCatInfo: {},
taskModalVisible: 0,
messageModalVisible: false,
......@@ -43,7 +43,7 @@ Page({
ruleModalVisible: false,
levelupModalVisible: 0,
levelupModalData: null,
selectcatModalVisible: false,
selectcatModalVisible: true,
catnameModalVisible: false,
recallcatModalVisible: false,
recallcatModalData: {},
......@@ -53,9 +53,15 @@ Page({
catruleModalVisible: 0
},
async doHelp() {
if(!app.inviteId) return;
if (!app.inviteId) return;
commonToast('正在发起助力~')
const { success, data, message } = await API.doHelp({ inviteId: app.inviteId }).catch(res => {
const {
success,
data,
message
} = await API.doHelp({
inviteId: app.inviteId
}).catch(res => {
commonToast(res && res.message);
}) || {};
......@@ -128,7 +134,18 @@ Page({
console.log("通知canvas刷新用户信息")
this.main && this.main.dispatchGlobalEvent("UPDATE_USERINFO")
}
my.__clickDelay__ = (obj) => {
obj.setData({
btnEnable:false
})
setTimeout(()=>{
if(obj){
obj.setData({
btnEnable:true
})
}
},2000)
}
// setTimeout(() => {
// my.__pageTo__('myprize')
// }, 100);
......@@ -166,12 +183,14 @@ Page({
this.doHelp();
}
},
fail: () => { console.log('createCanvas fail'); }
fail: () => {
console.log('createCanvas fail');
}
});
},
onCanvasReady(query) {
console.log('onCanvasReady',query)
console.log('onCanvasReady', query)
//授权和登录先搞
checkSystem().then(r => {
if (r) {
......@@ -312,47 +331,52 @@ Page({
app.nickName = nickName;
app.avatar = avatar;
this.login();
}
},
/**
* 登录接口
*/
async login() {
const {
nickName,
avatar
} = app;
const {
success, data,
} = await API.login({
userNick: nickName,
avatar
}).catch(res => {
commonToast(res && res.message);
}) || {};
const {
nickName,
avatar
} = app;
const {
success,
data,
} = await API.login({
userNick: nickName,
avatar
}).catch(res => {
commonToast(res && res.message);
}) || {};
if (success) {
app.openId = data.openId;
this.getActivityBaseInfoById();
}
if (success) {
app.openId=data.openId;
this.getActivityBaseInfoById();
}
},
/**
* 获取活动信息
*/
async getActivityBaseInfoById(){
async getActivityBaseInfoById() {
my.showLoading();
const {success,data} = await API.getActivityBaseInfoById().catch(r=>{
commonToast(r&&r.message)
})||{};
const {
success,
data
} = await API.getActivityBaseInfoById().catch(r => {
my.hideLoading();
commonToast(r && r.message)
}) || {};
if(success){
if (success) {
my.hideLoading();
this.setData({
activityBaseInfo:data
activityBaseInfo: data
})
this.initCanvas();
// this.initCanvas();
}
},
/**刷新用户信息 */
......@@ -382,6 +406,7 @@ Page({
},
/**召回猫 */
recallCat(r) {
this.main.dispatchGlobalEvent("RECALL_CAT");
this.setData({
recallCatInfo: r,
catbackbedModalVisible: true
......@@ -440,12 +465,15 @@ Page({
},
onShareAppMessage() {
// 返回自定义分享信息
let { path, ...rest } = SHARE_CONFIG;
console.log('app.openId',app.openId);
let {
path,
...rest
} = SHARE_CONFIG;
console.log('app.openId', app.openId);
if (app.openId) {
path = '/pages/pagecanvas/pagecanvas' + '?openId=' + app.openId;
}
console.log('path',path)
console.log('path', path)
return {
...rest,
......
......@@ -2411,6 +2411,7 @@ var TbNetName;
TbNetName["getUserEnergy"] = "tmallCat.getUserEnergy";
TbNetName["getSence"] = "tmallCat.getSence";
TbNetName["updateSenceGuide"] = "tmallCat.updateSenceGuide";
TbNetName["recallInfo"] = "tmallCat.recallInfo";
TbNetName["trackingReport"] = "squirrelsAdoptRest2c.trackingReport";
TbNetName["getActivityBaseInfoById"] = "bubbleSurviva.getActivityBaseInfoById";
TbNetName["authorize"] = "mine.authorize";
......@@ -2872,21 +2873,27 @@ var Guide = (function (_super) {
that.initEvents();
};
Guide.prototype.changeGuide = function () {
this.index++;
if (this.index >= this['guideUUIDArr_' + this.guideType].length) {
this.callBack && this.callBack();
var that = this;
that.index++;
if (that.index >= that['guideUUIDArr_' + that.guideType].length) {
that.guideTouch.mouseEnable = false;
setTimeout(function () {
if (that && that.guideTouch)
that.guideTouch.mouseEnable = true;
}, 1000);
that.callBack && that.callBack();
return;
}
this.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[this['guideUUIDArr_' + this.guideType][this.index]].url);
if (this.guideType == 3 || this.guideType == 4) {
if (this.index == 4 || this.index == 5) {
this.catImg1.visible = false;
that.guide.texture = RES_1.RES.getRes(resCanvasList_1.default[that['guideUUIDArr_' + that.guideType][that.index]].url);
if (that.guideType == 3 || that.guideType == 4) {
if (that.index == 4 || that.index == 5) {
that.catImg1.visible = false;
}
else {
this.catImg1.visible = true;
that.catImg1.visible = true;
}
}
console.log(this.guide.x, this.guide.y);
console.log(that.guide.x, that.guide.y);
};
Guide.prototype.initEvents = function () {
this.guideTouch.addEventListener(FYGE.MouseEvent.CLICK, this.changeGuide, this);
......@@ -46965,7 +46972,17 @@ var MainScene = (function (_super) {
MainScene.prototype.openLetter = function () {
console.log("打开信封弹窗");
if (this.letter && this.letter.visible) {
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('messageModal', { catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
}
};
MainScene.prototype.removeLetter = function () {
......@@ -47317,6 +47334,7 @@ exports.MainSceneBtnUi = void 0;
var Module_1 = __webpack_require__(/*! ../../module/views/Module */ "./module/views/Module.ts");
var Enum_1 = __webpack_require__(/*! ../Enum */ "./src/Enum.ts");
var Ins_1 = __webpack_require__(/*! ../Ins */ "./src/Ins.ts");
var TaoBaoNet_1 = __webpack_require__(/*! ../TaoBaoNet */ "./src/TaoBaoNet.ts");
var MainSceneBtnUi = (function (_super) {
__extends(MainSceneBtnUi, _super);
function MainSceneBtnUi(data) {
......@@ -47535,7 +47553,17 @@ var MainSceneBtnUi = (function (_super) {
};
MainSceneBtnUi.prototype.catRecallHandler = function () {
console.log("召回猫咪");
Ins_1.Ins.showModule("recallcatModal", { catType: Ins_1.Ins.userInfo.catType });
Ins_1.Ins.showLoading();
TaoBaoNet_1.sendTbNet(TaoBaoNet_1.TbNetName.recallInfo, {}, function (s, r) {
if (s) {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showModule('recallcatModal', { catType: Ins_1.Ins.userInfo.catType, catName: Ins_1.Ins.userInfo.catName, recallInfo: r.data });
}
else {
Ins_1.Ins.hideLoading();
Ins_1.Ins.showToast(r.message);
}
});
};
MainSceneBtnUi.prototype.getEnergy = function () {
console.log("补充精力");
......@@ -495,6 +495,12 @@ const resList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/unluckyBtn.e57fc34e49370d30a6942fb835395377a9cf4721.png',
uuid: 'c8c50400-1d65-4971-8be5-e4fb2eecfcd5'
},
'fc1fd3ee-e606-46de-9bb6-ea5fb41567df': {
name: 'catMessageBg',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/catMessageBg.e74d2bf93254933a994d05aa9ce29f9e3914c149.png',
uuid: 'fc1fd3ee-e606-46de-9bb6-ea5fb41567df'
}
};
export default resList;
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