Commit 6bac692e authored by AU-Pro-mac's avatar AU-Pro-mac

add new code --10

parent c3eaf564
......@@ -1925,7 +1925,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
_a.sent();
ctrls_1.changeScene(XxlScene_1.XxlScene);
ctrls_1.changeScene(MainScene_2.OpenAni);
return [2];
}
});
......@@ -2546,6 +2546,7 @@ var Root = (function (_super) {
this.goodsContainer.startGoods();
Main_1.GDispatcher.removeEventListener('MatchCompelete', this.gameStart, this);
this.gameStartFlag = true;
this.touchArea.mouseEnable = true;
};
Root.prototype.gameOver = function () {
return __awaiter(this, void 0, void 0, function () {
......@@ -2555,6 +2556,7 @@ var Root = (function (_super) {
case 0:
this.time = 60;
this.gameStartFlag = false;
this.touchArea.mouseEnable = false;
if (!this.userInfo.win)
this.scoreBoard.scoreRight += 3;
this.goodsContainer.removeAllGoods();
......@@ -2589,10 +2591,10 @@ var Root = (function (_super) {
this.scoreBoard.updateScore(score);
};
Root.prototype.createTouchRect = function () {
this.touchArea = Tools_1.Tools.getRect(750, 574, 0xff22ff, 0);
this.touchArea = Tools_1.Tools.getRect(750, 874, 0xff22ff, 0);
this.touchArea.x = 0;
this.touchArea.y = 1050;
this.touchArea.mouseEnable = true;
this.touchArea.y = 750;
this.touchArea.mouseEnable = false;
this.addChild(this.touchArea);
this.touchArea.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDownArea, this);
this.touchArea.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.onMouseUpArea, this);
......@@ -2626,6 +2628,7 @@ var Root = (function (_super) {
this.guide.visible = false;
setTimeout(function () {
ctrls_1.showPanel(MatchingPanel_1.MatchingPanel, _this.userInfo);
_this.guide.removeEventListener(FYGE.MouseEvent.CLICK, _this.guideFunc, _this);
}, 200);
}
else {
......@@ -2681,6 +2684,9 @@ var Catecher = (function (_super) {
__extends(Catecher, _super);
function Catecher(root, dataInfo) {
var _this = _super.call(this) || this;
_this.timerNumer = 60;
_this.lt = 0;
_this.tt = 0;
_this.sum = function (m, n) {
var num = Math.floor(Math.random() * (m - n) + n);
return num;
......@@ -2732,8 +2738,7 @@ var Catecher = (function (_super) {
.to({ x: 424, alpha: 1 }, 100);
};
Catecher.prototype.destroy = function () {
clearInterval(this.timerFunc);
this.timerFunc = null;
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
};
Catecher.prototype.updateScore = function (score) {
var scoreNow = score + this.scoreLeft;
......@@ -2784,26 +2789,39 @@ var Catecher = (function (_super) {
this.userScore_right.updateScore(this.scoreRight);
};
Catecher.prototype.stopTime = function () {
clearInterval(this.timerFunc);
this.timerFunc = null;
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
};
Catecher.prototype.start = function (time) {
var _this = this;
this.scoreLeft = 0;
this.scoreRight = 0;
this.timerNumer = time;
this.updateTime(this.timerNumer);
this.timerFunc = setInterval(function () {
if (_this.timerNumer <= 0) {
_this._root.gameOver();
clearInterval(_this.timerFunc);
_this.timerFunc = null;
_this.updateTime(0);
this.addEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
};
Catecher.prototype.timerFunc = function () {
if (!this._root.gameStartFlag)
return;
if (this.timerNumer <= 0) {
this._root.gameOver();
this.updateTime(0);
this.lt = this.tt = 0;
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
return;
}
if (this.lt) {
var nt = new Date().getTime();
var dt = nt - this.lt;
this.tt += dt / 1000 >> 0;
var ntt = 60 - this.tt;
if (ntt != this.timerNumer) {
this.timerNumer = ntt;
this.updateTime(this.timerNumer);
this.lt = nt;
}
}
else {
_this.updateTime(--_this.timerNumer);
this.lt = new Date().getTime();
}
}, 1000);
};
Catecher.prototype.updateTime = function (time) {
this.timeText.text = time.toString() + 'S';
......@@ -2837,7 +2855,8 @@ var Catecher = (function (_super) {
c.width = 120;
c.height = 120;
var a = Tools_1.Tools.getCircle(60, 0x000000, 1, 60, 60);
var p = Tools_1.Tools.getSprite(avatar, 0, 0);
var p = FYGE.Sprite.fromUrl(avatar);
p.x = p.y = 0;
p.width = 120;
p.height = 120;
c['updateAvatar'] = function (avatar) { p.texture = RES_1.RES.getRes(avatar); };
......
This diff is collapsed.
......@@ -1927,7 +1927,7 @@ var Main = (function () {
return [4, this.loadImageTexturesCsd02(resCanvasList)];
case 2:
_a.sent();
ctrls_1.changeScene(XxlScene_1.XxlScene);
ctrls_1.changeScene(MainScene_2.OpenAni);
return [2];
}
});
......@@ -2548,6 +2548,7 @@ var Root = (function (_super) {
this.goodsContainer.startGoods();
Main_1.GDispatcher.removeEventListener('MatchCompelete', this.gameStart, this);
this.gameStartFlag = true;
this.touchArea.mouseEnable = true;
};
Root.prototype.gameOver = function () {
return __awaiter(this, void 0, void 0, function () {
......@@ -2557,6 +2558,7 @@ var Root = (function (_super) {
case 0:
this.time = 60;
this.gameStartFlag = false;
this.touchArea.mouseEnable = false;
if (!this.userInfo.win)
this.scoreBoard.scoreRight += 3;
this.goodsContainer.removeAllGoods();
......@@ -2591,10 +2593,10 @@ var Root = (function (_super) {
this.scoreBoard.updateScore(score);
};
Root.prototype.createTouchRect = function () {
this.touchArea = Tools_1.Tools.getRect(750, 574, 0xff22ff, 0);
this.touchArea = Tools_1.Tools.getRect(750, 874, 0xff22ff, 0);
this.touchArea.x = 0;
this.touchArea.y = 1050;
this.touchArea.mouseEnable = true;
this.touchArea.y = 750;
this.touchArea.mouseEnable = false;
this.addChild(this.touchArea);
this.touchArea.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDownArea, this);
this.touchArea.addEventListener(FYGE.MouseEvent.MOUSE_UP, this.onMouseUpArea, this);
......@@ -2628,6 +2630,7 @@ var Root = (function (_super) {
this.guide.visible = false;
setTimeout(function () {
ctrls_1.showPanel(MatchingPanel_1.MatchingPanel, _this.userInfo);
_this.guide.removeEventListener(FYGE.MouseEvent.CLICK, _this.guideFunc, _this);
}, 200);
}
else {
......@@ -2683,6 +2686,9 @@ var Catecher = (function (_super) {
__extends(Catecher, _super);
function Catecher(root, dataInfo) {
var _this = _super.call(this) || this;
_this.timerNumer = 60;
_this.lt = 0;
_this.tt = 0;
_this.sum = function (m, n) {
var num = Math.floor(Math.random() * (m - n) + n);
return num;
......@@ -2734,8 +2740,7 @@ var Catecher = (function (_super) {
.to({ x: 424, alpha: 1 }, 100);
};
Catecher.prototype.destroy = function () {
clearInterval(this.timerFunc);
this.timerFunc = null;
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
};
Catecher.prototype.updateScore = function (score) {
var scoreNow = score + this.scoreLeft;
......@@ -2786,26 +2791,39 @@ var Catecher = (function (_super) {
this.userScore_right.updateScore(this.scoreRight);
};
Catecher.prototype.stopTime = function () {
clearInterval(this.timerFunc);
this.timerFunc = null;
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
};
Catecher.prototype.start = function (time) {
var _this = this;
this.scoreLeft = 0;
this.scoreRight = 0;
this.timerNumer = time;
this.updateTime(this.timerNumer);
this.timerFunc = setInterval(function () {
if (_this.timerNumer <= 0) {
_this._root.gameOver();
clearInterval(_this.timerFunc);
_this.timerFunc = null;
_this.updateTime(0);
this.addEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
};
Catecher.prototype.timerFunc = function () {
if (!this._root.gameStartFlag)
return;
if (this.timerNumer <= 0) {
this._root.gameOver();
this.updateTime(0);
this.lt = this.tt = 0;
this.removeEventListener(FYGE.Event.ENTER_FRAME, this.timerFunc, this);
return;
}
if (this.lt) {
var nt = new Date().getTime();
var dt = nt - this.lt;
this.tt += dt / 1000 >> 0;
var ntt = 60 - this.tt;
if (ntt != this.timerNumer) {
this.timerNumer = ntt;
this.updateTime(this.timerNumer);
this.lt = nt;
}
}
else {
_this.updateTime(--_this.timerNumer);
this.lt = new Date().getTime();
}
}, 1000);
};
Catecher.prototype.updateTime = function (time) {
this.timeText.text = time.toString() + 'S';
......@@ -2839,7 +2857,8 @@ var Catecher = (function (_super) {
c.width = 120;
c.height = 120;
var a = Tools_1.Tools.getCircle(60, 0x000000, 1, 60, 60);
var p = Tools_1.Tools.getSprite(avatar, 0, 0);
var p = FYGE.Sprite.fromUrl(avatar);
p.x = p.y = 0;
p.width = 120;
p.height = 120;
c['updateAvatar'] = function (avatar) { p.texture = RES_1.RES.getRes(avatar); };
......
......@@ -6,8 +6,8 @@ var fs = require("fs");
// fs.readFileSync("./output.js")
// )
// var endPath = 'D:/duibaGame/测试项目0527/taobaominiTest/client/pages/index1/';
var endPath = "C:/Users/Duiba/Desktop/work/雅顿/new_taobao/taobao_mini/client/pages/pagecanvas/"
// var endPath = '/Applications/DUIBA-TAOBAO/YD/new_taobao/taobao_mini/client/pages/pagecanvas/';
// var endPath = "C:/Users/Duiba/Desktop/work/雅顿/new_taobao/taobao_mini/client/pages/pagecanvas"
var endPath = '/Applications/DUIBA-TAOBAO/YD/new_taobao/taobao_mini/client/pages/pagecanvas/';
var version = Math.round(new Date().getTime() / 1000);
......
......@@ -61,6 +61,7 @@ Component({
// if (this.data.missionsList.length !== prevData.missionsList.length) {
// this.setData({ missionsList: this.props.missionsList })
// }
if (this.props.refresh) this.getMissionList()
},
methods: {
......
......@@ -22,6 +22,7 @@
</scroll-view>
</view>
<!-- 倒计时 -->
<!-- 倒计时
<count-down-modal a:if="{{isShowCountdown && task.taskType == 'browseGoods'}}" percent="{{percent}}" usePercent="{{usePercent}}" styleType="{{'01'}}" />
-->
</view>
\ No newline at end of file
......@@ -5,8 +5,8 @@ export function clickStat (activityId, type) {
API.clickStat({activityId: activityId, type: type})
.then(res => {
const { success, message, data } = res
if (!success) { console.warn(res); commonToast(res && res.message) }
if (!success) { console.warn(res) }
else console.log(`%c打点成功--${type}`, 'color:#e06a82;font-size:12px;font-weight:bold;text-shadow:1px 1px rgba(0,0,0,0.2)')
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
.catch(res => { console.warn(res) }) || {}
}
\ No newline at end of file
......@@ -93,8 +93,8 @@ Page({
},
//任务完成
async onCompleteTask(taskType,itemId) {
console.log(taskType,itemId)
async onCompleteTask(taskType, itemId) {
console.log(taskType, itemId)
const { activityId } = app
switch(taskType) {
case 'collectGoods':
......@@ -111,7 +111,7 @@ Page({
let browsResult = await API.doBrowseGoodsTask({ activityId, itemId }).catch(res => {
res && commonToast(res)
}) || {}
console.log(browsResult)
console.log('%c--------完成浏览任务\n' + '-----yd.doBrowseGoodsTask\n', ConsoleStyle, browsResult.data)
if(browsResult.success) {
commonToast('任务完成')
}
......
......@@ -128,4 +128,4 @@
<newuser-modal a:if="{{newUserModalVisible}}" onModalClose="closeNewUserModal"></newuser-modal>
<rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal>
<prizes-modal a:if="{{prizesModalVisible}}" onModalClose="closePrizesModal"></prizes-modal>
<mission-modal a:if="{{missionModalVisible}}" onModalClose="closeMissionModal" onRefreshGameInfo="getGameInfo"></mission-modal>
<mission-modal a:if="{{missionModalVisible}}" refresh="{{missionRefresh}}" onModalClose="closeMissionModal" onRefreshGameInfo="getGameInfo"></mission-modal>
......@@ -14,11 +14,8 @@ Page({
},
// 视频地址列表 - 存储播放时常
videoSrcArr: [
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false },
{ url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false }
],
// 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4'
videoSrcArr: [],
// 视频记录 flag
timeStampCountFlag: false,
// 视频记录 ms - 增量
......@@ -172,7 +169,12 @@ Page({
data.videoUrlArr.forEach((item, index) => {
// 获取视频 视频封面 视频小封面
this.videoSrcArr[index] = {
url: item.videoUrl, timeStamp: 0, totalTime: 0, completed: false
// url: item.videoUrl, timeStamp: 0, totalTime: 0, completed: false
// test - code
url: 'https://cloud.video.taobao.com/play/u/20446068/p/1/e/6/t/1/239271757987.mp4', timeStamp: 0, totalTime: 0, completed: false
// test - code
}
this.videoImgSrcSmallArr[index] = item.mainImage
})
......@@ -298,7 +300,10 @@ Page({
onReady() { this.videoCtx = my.createVideoContext('videoCtx') },
// 页面显示
onShow() { if (this.userLogin) this.getGameInfo() },
onShow() {
if (this.userLogin) this.getGameInfo()
this.setData({ missionRefresh: true })
},
// 获取 游戏门票 抽奖次数 今日是否首次登陆
getGameInfo () {
......
......@@ -195,6 +195,9 @@ Page({
// }, 5000);
const { success, data, message } = res;
console.log('%c--------领取实物奖品\n' + '-----yd.receiveObjectPrize\n', ConsoleStyle, data)
if (success && data) {
commonToast('领取成功')
} else {
......
......@@ -101,10 +101,12 @@ Page({
return
}
// const { success, data } = await API.lottery({ activityId: this.activityId }).catch(res => {
const { success, data } = await API.drawLotteryPrize({ activityId: this.activityId, prizeDataType: 3 }).catch(res => {
commonToast(res && res.message)
return
}) || {}
console.log('%c--------领取实物奖品\n' + '-----yd.receiveObjectPrize\n', ConsoleStyle, data)
// test code -
// let success = true
......
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