Commit f4eb4ae3 authored by 邱旭's avatar 邱旭

--

parent 9d174455
No preview for this file type
This diff is collapsed.
No preview for this file type
......@@ -45,6 +45,33 @@
<script src="scripts/svga.egret.min.js"></script>
<script src="output.js"></script>
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script>
/**
* 获取连接上的参数,以对象的形式返回
*/
function getRequest() {
const url = location.search; //获取url中"?"符后的字串
let theRequest = {};
if(url.indexOf("?") != -1) {
let str = url.substr(1);
let strs = str.split("&");
for(let i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
function getRequestByKey(key) {
const request = getRequest();
return request[key] || null;
}
let assistItemId = getRequestByKey("assistItemId")
window.location.href="http://activity.m.duiba.com.cn/projectx/p70c442c7/faec5c090.html" + "?assistItemId=" + assistItemId;
// https://activity.m.duiba.com.cn/hdtool/index?id=3711075&appKey=VkGjfX1GCUW4pbwWRwXnDsPBAxx&openBs=openbs
// https://activity.m.duiba.com.cn/hdtool/index?id=3711074&appKey=VkGjfX1GCUW4pbwWRwXnDsPBAxx&openBs=openbs
</script>
<script>
var development = true;
var gameId = 1;
......@@ -112,20 +139,63 @@
}
</script>
<!--微信分享方法-->
<script>
var shareData = {
title: '我正在参与EMOJI大作战,最高可得66元现金红包!', //标题
desc: '快来QQ输入法找我玩吧', //描述
link: shareUrl2, //链接
imgUrl: "https://yun.duiba.com.cn/db_games/qx/qqEmoji.jpg", //图片
};
wx.config({
debug: $wxdebug,
appId: '$wxappid',
timestamp: '$wxtimestamp',
nonceStr: '$wxnonceStr',
signature: '$wxsignature',
jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage']
});
function invokeWX(shareData) {
wx.onMenuShareTimeline({
title: shareData.title, //标题
desc: shareData.desc, //描述
link: shareData.link, //链接
imgUrl: shareData.imgUrl, //图片
success: function () {},
cancel: function () {}
});
wx.onMenuShareAppMessage({
title: shareData.title, //标题
desc: shareData.desc, //描述
link: shareData.link, //链接
imgUrl: shareData.imgUrl, //图片
success: function (e) {},
cancel: function () {}
});
}
wx.ready(function () {
invokeWX(shareData);
});
</script>
<!--QQ输入法方法-->
<script type="text/javascript">
function goClient(assistItemId = "") {
let url = window.encodeURIComponent("");
let share_url = "";
share_url += (assistItemId != "") ? `&assistItemId=${assistItemId}` : "";
let url = "http%253a%252f%252factivity.m.duiba.com.cn%252fcustomShare%252fshare%253fid%253d3488%2526dbredirect%253dhttp%25253A%25252F%25252Factivity.m.duiba.com.cn%25252Fprojectx%25252Fp70c442c7%25252Findex.html%25253fassistItemId%25253d";
url += ((assistItemId != "") ? + assistItemId : "");
let share_url = "http://activity.m.duiba.com.cn/projectx/p70c442c7/index.html";
//share_url += ((assistItemId != "") ? "?assistItemId=" + assistItemId : "");
let sUrl = window.encodeURIComponent(share_url);
let common = "我正在参与EMOJI大作战,最高可得66元现金红包!";
let title = "快来QQ输入法找我玩吧";
window.location.href = `com.tencent.qqpinyin.third://emoji?url=${url}&share_url=${sUrl}&common=${common}&title=${title}`;
window.location.href = "com.tencent.qqpinyin.third://emoji?url=" + url + "&share_url=" + sUrl + "&common=" + common + "&title=" + title;
}
function shareTo(assistItemId) {
var shareLink = "" + assistItemId ? `?assistItemId=${assistItemId}` : "";
var shareLink = "http://activity.m.duiba.com.cn/projectx/p70c442c7/faec5c090.html&appKey=VkGjfX1GCUW4pbwWRwXnDsPBAxx&openBs=openbs" + ((assistItemId) ? "&assistItemId=" + assistItemId : "");
var shareTitle = "我正在参与EMOJI大作战,最高可得66元现金红包!";
var shareDes = "快来QQ输入法找我玩吧";
QQInputAndroid.shareTo(shareLink, shareTitle, shareDes)
......
......@@ -5,7 +5,7 @@ import { IExposureData } from '../data/common/IExposureData';
export class Buried {
private static appId: number;
private static consumerId: number;
private static oaId: number;
private static oaId: any;
/**
* 初始化
......
No preview for this file type
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/common/closeBtn.png","../assets/index_scene/myPrize_btn.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"preload","version":5,"files":["../assets/common/closeBtn.png","../assets/index_scene/myPrize_btn.png","../assets/rule_panel/rule_bg.png","../assets/rule_panel/rule_panel_btn.png"]}
\ No newline at end of file
{"options":{"layoutMath":"2","sizeMode":"2n","useExtension":1,"layoutGap":1,"extend":0},"projectName":"rule_panel","version":5,"files":["../assets/rule_panel/rule_bg.png","../assets/rule_panel/rule_panel_btn.png"]}
\ No newline at end of file
......@@ -9,9 +9,9 @@
</e:skinName>
</e:Button>
<e:Image scaleX="1" scaleY="1" y="163" source="rule_bg_png" horizontalCenter="0"/>
<e:Scroller y="287.97" anchorOffsetX="0" anchorOffsetY="0" x="137" height="411" width="477">
<e:Scroller y="287.97" anchorOffsetX="0" anchorOffsetY="0" height="411" width="477" x="137">
<e:Group anchorOffsetX="0" anchorOffsetY="0" width="477" height="452" x="202">
<e:Label id="ruleLabel" text="" anchorOffsetX="0" anchorOffsetY="0" scaleX="1" scaleY="1" width="477" y="0" x="0" lineSpacing="20" textColor="0x000000"/>
<e:Label id="ruleLabel" text="" anchorOffsetX="0" anchorOffsetY="0" scaleX="1" scaleY="1" width="477" y="0" lineSpacing="20" textColor="0x000000" x="0"/>
</e:Group>
</e:Scroller>
<e:Button id="ok_btn" label="" y="779" scaleX="1" scaleY="1" anchorOffsetY="58.5" anchorOffsetX="186.8" horizontalCenter="1">
......
......@@ -75,6 +75,9 @@ export default class EffectMgr {
* @param wait - 一次心跳等待的时间
*/
public heartbeatEffect(obj: any, max: number, min: number, duration: number = 1000, wait: number = 500) {
if(obj['canOpen'] == false){
return;
}
egret.Tween.get(obj).to({scaleX: max, scaleY: max}, duration / 2, egret.Ease.sineIn).call(
() => {
egret.Tween.get(obj).to({scaleX: min, scaleY: min}, duration / 2, egret.Ease.sineOut).wait(wait).call(
......
......@@ -54,9 +54,9 @@ export default class HelpPrizePanel extends Panel {
}
private initUI(): void {
this.prizeImg.source = RES.getRes(CardData[this.data.mineSpId].img);
this.prizeImg.source = RES.getRes(CardData[this.data.inviterSpId].img);
this.invt_emoji_name.text = `帮好友抽中一张${CardData[this.data.inviterSpId].name}emoji`;
this.mine_emoji_name.text = `帮好友抽中一张${CardData[this.data.mineSpId].name}emoji`;
this.mine_emoji_name.text = `自己抽中一张${CardData[this.data.mineSpId].name}emoji`;
NetManager.ins.showLog(getlogItem(8));
}
......
......@@ -2,8 +2,10 @@ import Panel from "../../MVC/views/Panel";
import { HtmlTextParser } from "../../../libs/tc/util/HtmlTextParser";
export default class RulePanel extends Panel {
public closeBtn: eui.Button;
public ruleLabel: eui.Label;
public closeBtn:eui.Button;
public ruleLabel:eui.Label;
public ok_btn:eui.Button;
public get skinKey() { return 'RulePanel' }
public get groupName() { return 'rule_panel' }
......@@ -13,10 +15,12 @@ export default class RulePanel extends Panel {
}
initEvents() {
this.closeBtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
}
removeEvents() {
this.closeBtn.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
this.ok_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTouchTap, this);
}
protected onSkinComplete(): void {
......
......@@ -15,51 +15,51 @@ import { GTime } from "../../../libs/tc/util/GTime";
import AudioCtrl from "../../MVC/ctrls/AudioCtrl";
import PrizeListItem from "./PrizeListItem";
import { getlogItem } from "../../getlogItem";
import Label = eui.Label;
import tr = egret.sys.tr;
export default class IndexScene extends Scene {
public scroller:eui.Scroller;
public title_group:eui.Group;
public titleMask:eui.Rect;
public sweepLight:eui.Image;
public ruleBtn:eui.Button;
public prizeBtn:eui.Button;
public card1:eui.Image;
public card2:eui.Image;
public card3:eui.Image;
public select:eui.Image;
public getPrizeBtn:eui.Button;
public shareBtn:eui.Button;
public timesLabel:eui.Label;
public scrollerGroup:eui.Group;
public scrollerMask:eui.Rect;
public scrollerLable1:eui.Label;
public scrollerLable2:eui.Label;
public emoji0:eui.Image;
public emoji1:eui.Image;
public emoji2:eui.Image;
public emoji3:eui.Image;
public emoji4:eui.Image;
public emoji5:eui.Image;
public emojiBg0:eui.Image;
public emojiBg1:eui.Image;
public emojiBg2:eui.Image;
public emojiBg3:eui.Image;
public emojiBg4:eui.Image;
public emojiBg5:eui.Image;
public emojiLabel0:eui.Label;
public emojiLabel1:eui.Label;
public emojiLabel2:eui.Label;
public emojiLabel3:eui.Label;
public emojiLabel4:eui.Label;
public emojiLabel5:eui.Label;
public box:eui.Image;
public progressBar_fill:eui.Rect;
public progressbar_bg:eui.Image;
public progressbarLabel:eui.Label;
public list:eui.List;
public osGroup:eui.Group;
public osLabel:eui.Label;
public scroller: eui.Scroller;
public title_group: eui.Group;
public titleMask: eui.Rect;
public sweepLight: eui.Image;
public ruleBtn: eui.Button;
public prizeBtn: eui.Button;
public card1: eui.Image;
public card2: eui.Image;
public card3: eui.Image;
public select: eui.Image;
public getPrizeBtn: eui.Button;
public shareBtn: eui.Button;
public timesLabel: eui.Label;
public scrollerGroup: eui.Group;
public scrollerMask: eui.Rect;
public scrollerLable1: eui.Label;
public scrollerLable2: eui.Label;
public emoji0: eui.Image;
public emoji1: eui.Image;
public emoji2: eui.Image;
public emoji3: eui.Image;
public emoji4: eui.Image;
public emoji5: eui.Image;
public emojiBg0: eui.Image;
public emojiBg1: eui.Image;
public emojiBg2: eui.Image;
public emojiBg3: eui.Image;
public emojiBg4: eui.Image;
public emojiBg5: eui.Image;
public emojiLabel0: eui.Label;
public emojiLabel1: eui.Label;
public emojiLabel2: eui.Label;
public emojiLabel3: eui.Label;
public emojiLabel4: eui.Label;
public emojiLabel5: eui.Label;
public box: eui.Image;
public progressBar_fill: eui.Rect;
public progressbar_bg: eui.Image;
public progressbarLabel: eui.Label;
public list: eui.List;
public osGroup: eui.Group;
public osLabel: eui.Label;
// emoji表情
private emojisId = ["sp_1", "sp_2", "sp_3", "sp_4", "sp_5", "sp_6"];
......@@ -166,6 +166,7 @@ export default class IndexScene extends Scene {
if(data && data.leftTimes <= 0) {
PanelCtrl.instance.btnDelay(this.getPrizeBtn);
PanelCtrl.instance.show(ModuleTypes.SHARETIPS_PANEL);
localStorage.setItem("isZero", "true");
this.getPrizeBtn.visible = false;
this.shareBtn.visible = true;
NetManager.ins.showLog(getlogItem(4));
......@@ -242,7 +243,9 @@ export default class IndexScene extends Scene {
NetManager.ins.getCollectCards((success, res) => {
if(!success) {
if(res.code == "100001") {
this.showToast("请先登录");
this.osGroup.visible = true;
this.osLabel.text = "请先登录";
// this.showToast("请先登录");
}
return;
}
......@@ -250,8 +253,18 @@ export default class IndexScene extends Scene {
this.initEmojis(data.spMap);
this.setProgressBar(data.nowTypes, data.totalTypes);
this.timesLabel.text = `今日 次数:${data.leftTimes}次`;
if(data.leftTimes > 0) {
localStorage.setItem("isZero", "false");
this.getPrizeBtn.visible = true;
this.shareBtn.visible = false;
} else {
if(localStorage.getItem("isZero") == "true") {
this.getPrizeBtn.visible = false;
this.shareBtn.visible = true;
}
}
const assistItemId = Utils.getRequestByKey("assistItemId");
const assistItemId = Utils.getRequestByKey("assistItemId") || "";
if(data.endFlag != true && assistItemId) { // 活动没有结束且assistItemId存在
this.help(assistItemId);
} else {
......@@ -273,6 +286,17 @@ export default class IndexScene extends Scene {
this.initEmojis(data.spMap);
this.setProgressBar(data.nowTypes, data.totalTypes);
this.timesLabel.text = `今日 次数:${data.leftTimes}次`;
if(data.leftTimes > 0) {
localStorage.setItem("isZero", "false");
this.getPrizeBtn.visible = true;
this.shareBtn.visible = false;
} else {
if(localStorage.getItem("isZero") == "true") {
this.getPrizeBtn.visible = false;
this.shareBtn.visible = true;
}
}
if(data.endFlag == true) {
this.showToast('活动已结束');
}
......@@ -420,12 +444,14 @@ export default class IndexScene extends Scene {
if(nowTypes < 6) {
this.progressbarLabel.text = `${nowTypes}/6`;
this.box.source = this.box_disable;
this.box['canOpen'] = false;
} else {
this.progressbarLabel.text = "您已集齐全部卡片 点击礼物召唤大奖";
egret.Tween.get(this.box).to({scaleX: 0, scaleY: 0}, 250, egret.Ease.sineInOut).call(() => {
this.box.source = this.box_enable;
this.boxTouch = true;
egret.Tween.get(this.box).to({scaleX: 1, scaleY: 1}, 250, egret.Ease.sineInOut).call(() => {
this.box['canOpen'] = true;
EffectMgr.instance.heartbeatEffect(this.box, 1.15, 0.85, 300, 1000);
});
});
......@@ -443,14 +469,22 @@ export default class IndexScene extends Scene {
}
const data = DataManager.ins.getData(NetName.QUERY_PRIZE_LIST).data;
let _data = Utils.deepClone(data);
let link = "";
for(let i = 0; i < _data.length; i++) {
if(_data[i].prizeId == 'thanks') {
_data.splice(i--, 1);
continue;
}
if(_data[i].name.indexOf("红包") > -1) {
link = _data[i].icon;
_data.splice(i--, 1);
}
}
let hongbao_data = {
"icon": link,
"name": "现金红包",
};
_data.push(hongbao_data);
this.list.itemRenderer = PrizeListItem;
const ac = new eui.ArrayCollection(_data);
this.list.dataProvider = ac;
......@@ -475,7 +509,7 @@ export default class IndexScene extends Scene {
private checkOS() {
let os = navigator.userAgent.match(/ OS /) // 是否是 iOS
|| navigator.userAgent.match(/Android [4].[4-9](.[0-9])?/) // 是否是 Android 4.4 - 4.9.9
|| navigator.userAgent.match(/Android [5-9].[0-9](.[0-9])?/); // 是否是 Android 5.0 - 5.9.9
|| navigator.userAgent.match(/Android [5-9](.[0-9])?(.[0-9])?/); // 是否是 Android 5 - 5.9.9
if(os && os[0] && os[0].indexOf(' OS ') > -1) {
this.osLabel.text = "该活动仅支持安卓用户参与";
......@@ -491,7 +525,7 @@ export default class IndexScene extends Scene {
private check() {
let os = navigator.userAgent.match(/ OS /) // 是否是 iOS
|| navigator.userAgent.match(/Android [4].[4-9](.[0-9])?/) // 是否是 Android 4.4 - 4.9.9
|| navigator.userAgent.match(/Android [5-9].[0-9](.[0-9])?/); // 是否是 Android 5.0 - 5.9.9
|| navigator.userAgent.match(/Android [5-9](.[0-9])?(.[0-9])?/); // 是否是 Android 5 - 5.9.9
if(os && os[0] && os[0].indexOf(' OS ') > -1) {
return false;
......@@ -587,7 +621,7 @@ export default class IndexScene extends Scene {
this.emojisData[this.emojisId[i]]['disable'] = this[`emoji${i}_disable`];
}
if(this.check()){
if(this.check()) {
this.setPrizeList();
this.getCollectCards();
}
......
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