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