Commit ddcd79ab authored by wildfirecode's avatar wildfirecode

1

parent f370d2f9
No preview for this file type
......@@ -159,6 +159,27 @@
],
"name": "getOrderStatus"
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"uri": "/customActivity/sjf/activity/getActivityFreeLimt",
"name": "limitTimes",
"onError": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "onErrorLimitFree"
}
],
"onResponse": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "updateCountFromNet"
}
]
}
}
],
"uuid": "41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
......@@ -733,7 +754,7 @@
"properties": {
"position": {
"x": 0,
"y": 197.83333333333326,
"y": 185.83333333333326,
"_type_": "scilla/support/Vector2D"
}
}
......@@ -777,7 +798,7 @@
"properties": {
"position": {
"x": 0,
"y": 287
"y": 259
}
}
},
......
......@@ -44,20 +44,34 @@ export default class PrizeDialogContent extends DialogContent {
}
onClick_usebtn() {
if (this._isDuibaPrize) {
window["downloadAppConfig"] =
{
openUrl: this._lottery.openUrl,
iosDownloadUrl: this._lottery.iosDownloadUrl,
androidDownloadUrl: this._lottery.androidDownloadUrl,
confirm: this._lottery.confirm ? this._lottery.confirm : false
};
window["downloadApp"]();
return;
}
window.location.href = this._link
}
onAwake() {
super.onAwake();
this._y = getY(this.useBtn)
this._y = 306;
}
private _isDuibaPrize;
private _lottery;
async setup({ isDuibaPrize, data }) {
let imgUrl: string;
// this.useBtn.enabled = this.name.enabled = isDuibaPrize;
this.tips.enabled = !isDuibaPrize;
this._isDuibaPrize = isDuibaPrize;
this._lottery = data.luckBagDetail;
if (isDuibaPrize) {//大牌券
this._link = data.luckBagDetail.link;
// this._link = data.luckBagDetail.link;
imgUrl = data.luckBagDetail.imgurl;
setY(this.useBtn, this._y);
......
......@@ -34,35 +34,44 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
this._drop.callback = this.dropEndCallback;
this.entity.addChild(this._drop.entity);
}
this.updateCountTxt();
// this.updateCountTxt();
this.broadcast('callApi', 1, 'limitTimes', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
}
dropEndCallback = () => {
this.onShakeOver();
}
// initGameStage() {
// this.updateCountTxt();
// }
updateCountFromNet(limit: number) {
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountFromNet', `剩余次数:${limit}`)
}
onErrorLimitFree(data) {
console.log('onErrorLimitFree', data);
if (data == '400005')
setText(this.countTxt, `剩余次数:${window['CFG'].freeLimit}`);
else
setText(this.countTxt, `剩余次数:0`);
}
updateCountTxt() {
updateCountTxtFromDojoin() {
let limit = 0;
if (this.doJoin) {
limit = this.doJoin.freeLimit;
} else {
limit = window['CFG'].freeLimit;
}
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountTxtFromDojoin', `剩余次数:${limit}`)
}
onClick_startbtn() {
// if (error === '400005') {
// this.bubbling('showToast', '活动还未开始\n敬请期待~');
// } else if (error === '400006') {
// this.bubbling('showToast', '活动已结束\n下次早点来哦~');
// }
const { startTime, endTime } = window['CFG'];
const now = Date.now();
if (now < startTime) {
......@@ -74,21 +83,41 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
return;
}
this.startbtn.getComponent(Button).enabled = false;
this._shakeTimes = this.SHAK_TIMERS;
this._counter = 0;
setRotation(this.treeWrapper, this.STREN);
this.dojoinFunc();
}
onShakeOver() {
// if (window['getDuibaToken']) {
// window['getDuibaToken']((tokenObj: any) => {
// this.dojoinFunc(tokenObj.token);
// }, (key: string, messageObj: any) => {
// // this.onError(net);
// });
// } else {
this.dojoinFunc();
// }
this.startbtn.getComponent(Button).enabled = true;
this.updateCountTxtFromDojoin();
// console.log('onGotDojoin', this.doJoin);
const data = this.doJoin;
if (data.prizeType == 0) {//幸运奖
this.startbtn.getComponent(Button).enabled = true;
if (data && data.lottery) {
this.bubbling('showDialog', 'Prize', {
isDuibaPrize: true, data: {
exposure: data.exposure,
luckBagDetail: data.lottery
}
});
} else {
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
}
} else {//线下奖品 1,一等奖;2,二等奖;3,三等奖;4,四等奖 5谢谢 6
this.startbtn.getComponent(Button).enabled = true;
if (data.prizeType == 5) {//5谢谢
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
} else if (data.prizeType != 6) {//线下奖品 1,一等奖;2,二等奖;3,三等奖;4,四等奖
this.bubbling('showDialog', 'Prize', { isDuibaPrize: false, data: data });
} else {
this.bubbling('showDialog', 'Alert', '系统异常,prizeType=6');
}
}
}
dojoinFunc(token?) {
......@@ -120,33 +149,11 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
onGotDojoin(data) {
this.updateCountTxt();
// console.log('onGotDojoin', this.doJoin);
if (data.prizeType == 0) {//幸运奖
this.startbtn.getComponent(Button).enabled = true;
if (data && data.lottery) {
this.bubbling('showDialog', 'Prize', {
isDuibaPrize: true, data: {
exposure: data.exposure,
luckBagDetail: data.lottery
}
});
} else {
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
}
this._shakeTimes = this.SHAK_TIMERS;
this._counter = 0;
setRotation(this.treeWrapper, this.STREN);
} else {//线下奖品 1,一等奖;2,二等奖;3,三等奖;4,四等奖 5谢谢 6
this.startbtn.getComponent(Button).enabled = true;
if (data.prizeType == 5) {//5谢谢
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
} else if (data.prizeType != 6) {//线下奖品 1,一等奖;2,二等奖;3,三等奖;4,四等奖
this.bubbling('showDialog', 'Prize', { isDuibaPrize: false, data: data });
} else {
this.bubbling('showDialog', 'Alert', '系统异常,prizeType=6');
}
}
this.startbtn.getComponent(Button).enabled = false;
}
onGotDojoinError(error) {
......
<!DOCTYPE html>
<html>
<head>
<title>水井坊</title>
</head>
<script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>
<script>
// init vConsole
var vConsole = new VConsole();
console.log('Hello world');
</script>
<body duiba-page-id="4">
<script src="https://cdn.bootcss.com/fetch-jsonp/1.1.3/fetch-jsonp.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<div id="loading"> <img src="//yun.duiba.com.cn/db_games/loading.gif" /> </div>
<div id="gameContainer" style="width: 100%;height: 100%;overflow: hidden;"></div>
<script src="//yun.duiba.com.cn/db_games/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/security.js"></script>
<script src="//yun.duiba.com.cn/db_games/activity/wwjsjf-20190619/downloadApp.js"></script>
<script src="//yun.duiba.com.cn/db_games/1561797897/bundle.js"></script>
<script src="https://cdn.bootcss.com/fetch-jsonp/1.1.3/fetch-jsonp.min.js"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="true" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<div id="loading"> <img src="//yun.duiba.com.cn/db_games/loading.gif" /> </div>
<div id="gameContainer" style="width: 100%;height: 100%;overflow: hidden;"></div>
<script src="//yun.duiba.com.cn/db_games/zepto.min.js"></script>
<script src="//yun.duiba.com.cn/db_games/security.js"></script>
<script src="//yun.duiba.com.cn/db_games/1561708722/bundle.js"></script>
<script>
setTimeout(function () {
var loadingEl = document.getElementById('loading');
<script>
setTimeout(function () {
var loadingEl = document.getElementById('loading');
function onProcess(p) {
if (p >= 1) {
loadingEl.style.display = 'none';
}
function onProcess(p) {
if (p >= 1) {
loadingEl.style.display = 'none';
}
var options = {
resPath: "//yun.duiba.com.cn/db_games/1561708722/"
};
window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
window['ruleContent'] = 'starttttttt<br>第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行<br>第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行endddddd';
</script>
<style>
html,
body,
p {
padding: 0;
margin: 0;
border: 0;
}
html,
body {
height: 100%;
background-color: #282C34;
}
var options = {
resPath: "//yun.duiba.com.cn/db_games/1561784668/"
};
window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
#loading {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
window.ruleContent = '';
window.ruleContent += '1.点击接礼物,礼物树开始掉落奖品<br>';
window.ruleContent += '2.奖品为随机掉落,接到实物奖品的获奖用户请于获奖当日在宴会现场工作人员处领取奖品,否则视为放弃领奖<br>';
window.ruleContent += '3.若未在游戏开放时间内或剩余参与次数为0时开始游戏,将无法参与游戏<br>';
window.ruleContent += '4.点击【我的奖品】可查看获奖情况<br>';
window.ruleContent += '5.在本次活动期间,如用户存在任何违反法律、法规、水井坊活动规则的行为,包括但不限于作弊得奖等行为,水井坊有权取消用户的中奖资格,有权撤销违规交易<br>';
window.ruleContent += '6.在法律规定的范围内,水井坊对本次活动拥有最终解释权';
#floatLayer::-webkit-scrollbar {
display: none
}
</style>
</script>
<style>
html,
body,
p {
padding: 0;
margin: 0;
border: 0;
}
html,
body {
height: 100%;
background-color: #282C34;
}
<script type="text/javascript">
var CFG = {
'startTime': 'Wed Jun 26 17:30:00 CST 2019',
'endTime': 'Wed Jun 26 21:00:00 CST 2019',
'weddingId': 1,
'freeLimit': 4,
'weixinUid': 'weiXinUid',
'activityId': '2',
'nickname': 'nickName',
'activity': {
"activityType": 3, "brickId": 4, "drawStatus": 0, "id": 2, "joinLimit": 5,
"prizeList":
[
{ "activityId": 2, "backWinProbability": "50", "frontWinProbability": "10", "id": 3, "midWinProbability": "30", "prizeCount": 5, "prizeImage": "", "prizeName": "惊喜娃娃机奖品1", "prizeType": 1, "weddingId": 1 },
{ "activityId": 2, "backWinProbability": "50", "frontWinProbability": "10", "id": 4, "midWinProbability": "30", "prizeCount": 5, "prizeImage": "", "prizeName": "惊喜娃娃机奖品2", "prizeType": 2, "weddingId": 1 }], "takePrizeLimit": 4, "weddingId": 1
}
};
CFG._rule = 'starttttttt<br>第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行<br>第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行endddddd';
</script>
</body>
#loading {
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
#floatLayer::-webkit-scrollbar {
display: none
}
</style>
</html>
\ No newline at end of file
......@@ -58,8 +58,8 @@
<script src="debug/bundle.js"></script>
<script>
var CFG = {
'startTime': 1561703100000,
'endTime': 1561714980000,
'startTime': 0.1561703100000,
'endTime': 91561714980000,
'weddingId': 1111,
'freeLimit': 10,
'weixinUid': 00000,
......@@ -67,8 +67,14 @@
'activity': { id: 1 }
};
CFG._rule = 'starttttttt<br>第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行<br>第1行<br>第2行<br>第3行<br>第4行<br>第5行<br>第6行<br>第7行endddddd';
window.ruleContent = '<ol>';
window.ruleContent += '<li>点击接礼物,礼物树开始掉落奖品;</li>';
window.ruleContent += '<li>奖品为随机掉落,接到实物奖品的获奖用户请于获奖当日在宴会现场工作人员处领取奖品,否则视为放弃领奖;</li>';
window.ruleContent += '<li>若未在游戏开放时间内或剩余参与次数为0时开始游戏,将无法参与游戏;</li>';
window.ruleContent += '<li>点击【我的奖品】可查看获奖情况;</li>';
window.ruleContent += '<li>在本次活动期间,如用户存在任何违反法律、法规、水井坊活动规则的行为,包括但不限于作弊得奖等行为,水井坊有权取消用户的中奖资格,有权撤销违规交易;</li>';
window.ruleContent += '<li>在法律规定的范围内,水井坊对本次活动拥有最终解释权。</li>';
window.ruleContent += '</ol>';
function requirelogin() {
console.log('requirelogin');
}
......
......@@ -16,8 +16,8 @@
"entryScene": "main"
},
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl": "",
"webServiceUrl1": "http://localhost:4001"
"webServiceUrl1": "",
"webServiceUrl": "http://localhost:4001"
},
"dataCenterConfig": {
"dataCenterRoot": [
......
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1561704434453,
"code": "400002",
"data": {
"orderId": 497,
"prizeId": 70,
"title": "测试数据优化广告1",
"prizeType": 0,
"orderStatus": 2,
"imgurl": "//yun.dui88.com/babi/img/adbc3446-da1wjlykae.png",
"imgurl": "//yun.dui88.com/upload/uP99F1462438316972.png",
"luck": null,
"orderId": 22,
"freeLimit":0,
"prizeType": 4,
"link": null,
"freeLimit": 99,
"exposure": {
"consumerId": 1561704433922,
"appId": 1,
"orderId": "497",
"activityId": 21,
"advertId": 4337,
"materialId": 20515,
"activityUseType": "0",
"dpm": "1.4.1.0",
"dcm": "104.4337.0.0",
"os": "iPhone",
"ip": "124.160.32.2",
"isEmbed": true,
"domain": "//activity.tuiatest.cn",
"slotId": 2053
},
"lottery": {
"title": "测试数据优化广告1",
"tip": "一句话描述",
"androidDownloadUrl": "//activity.tuiatest.cn/activity/redirect?orderId=497&activityId=21&appId=1&consumerId=1561704433922&materialId=20515&os=iPhone&advertId=4337&ip=124.160.32.2&activityUseType=0&dpm=1.4.1.0&dcm=104.4337.0.0&device_type=directad&url=http%3A%2F%2Fwww.baidu.com",
"iosDownloadUrl": "//activity.tuiatest.cn/activity/redirect?orderId=497&activityId=21&appId=1&consumerId=1561704433922&materialId=20515&os=iPhone&advertId=4337&ip=124.160.32.2&activityUseType=0&dpm=1.4.1.0&dcm=104.4337.0.0&device_type=directad&url=http%3A%2F%2Fwww.baidu.com",
"couponCode": null,
"couponKey": null,
"link": null,
"useBtnText": "数据优化",
"imgurl": "//yun.dui88.com/babi/img/f7a300fb-9yfljp606y.png",
"showUse": true,
"isDownloadUrl": null,
"validate": "2019-06-30",
"linkTo": null
}
}
"orderStatus": 2,
"title": "惊喜娃娃机奖品1",
"prizeId": 3
},
"success": true,
"desc": null,
"timestamp": 1561540156975
}
\ No newline at end of file
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1561704434453,
"data": {
"imgurl": "//yun.dui88.com/upload/uP99F1462438316972.png",
"luck": null,
"orderId": 22,
"freeLimit":1,
"prizeType": 4,
"link": null,
"orderId": 497,
"prizeId": 70,
"title": "测试数据优化广告1",
"prizeType": 0,
"orderStatus": 2,
"title": "惊喜娃娃机奖品1",
"prizeId": 3
},
"success": true,
"desc": null,
"timestamp": 1561540156975
"imgurl": "//yun.dui88.com/babi/img/adbc3446-da1wjlykae.png",
"link": null,
"freeLimit": 1234,
"exposure": {
"consumerId": 1561704433922,
"appId": 1,
"orderId": "497",
"activityId": 21,
"advertId": 4337,
"materialId": 20515,
"activityUseType": "0",
"dpm": "1.4.1.0",
"dcm": "104.4337.0.0",
"os": "iPhone",
"ip": "124.160.32.2",
"isEmbed": true,
"domain": "//activity.tuiatest.cn",
"slotId": 2053
},
"lottery": {
"title": "测试数据优化广告1",
"tip": "一句话描述",
"androidDownloadUrl": "//activity.tuiatest.cn/activity/redirect?orderId=497&activityId=21&appId=1&consumerId=1561704433922&materialId=20515&os=iPhone&advertId=4337&ip=124.160.32.2&activityUseType=0&dpm=1.4.1.0&dcm=104.4337.0.0&device_type=directad&url=http%3A%2F%2Fwww.baidu.com",
"iosDownloadUrl": "//activity.tuiatest.cn/activity/redirect?orderId=497&activityId=21&appId=1&consumerId=1561704433922&materialId=20515&os=iPhone&advertId=4337&ip=124.160.32.2&activityUseType=0&dpm=1.4.1.0&dcm=104.4337.0.0&device_type=directad&url=http%3A%2F%2Fwww.baidu.com",
"couponCode": null,
"couponKey": null,
"link": null,
"useBtnText": "数据优化",
"imgurl": "//yun.dui88.com/babi/img/f7a300fb-9yfljp606y.png",
"showUse": true,
"isDownloadUrl": null,
"validate": "2019-06-30",
"linkTo": null
}
}
}
\ No newline at end of file
{
"success": true,
"code": "t",
"desc": null,
"timestamp": 1561625108247,
"data": 999
}
\ No newline at end of file
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