Commit ddcd79ab authored by wildfirecode's avatar wildfirecode

1

parent f370d2f9
No preview for this file type
...@@ -159,6 +159,27 @@ ...@@ -159,6 +159,27 @@
], ],
"name": "getOrderStatus" "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", "uuid": "41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
...@@ -733,7 +754,7 @@ ...@@ -733,7 +754,7 @@
"properties": { "properties": {
"position": { "position": {
"x": 0, "x": 0,
"y": 197.83333333333326, "y": 185.83333333333326,
"_type_": "scilla/support/Vector2D" "_type_": "scilla/support/Vector2D"
} }
} }
...@@ -777,7 +798,7 @@ ...@@ -777,7 +798,7 @@
"properties": { "properties": {
"position": { "position": {
"x": 0, "x": 0,
"y": 287 "y": 259
} }
} }
}, },
......
...@@ -44,20 +44,34 @@ export default class PrizeDialogContent extends DialogContent { ...@@ -44,20 +44,34 @@ export default class PrizeDialogContent extends DialogContent {
} }
onClick_usebtn() { 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 window.location.href = this._link
} }
onAwake() { onAwake() {
super.onAwake(); super.onAwake();
this._y = getY(this.useBtn) this._y = 306;
} }
private _isDuibaPrize;
private _lottery;
async setup({ isDuibaPrize, data }) { async setup({ isDuibaPrize, data }) {
let imgUrl: string; let imgUrl: string;
// this.useBtn.enabled = this.name.enabled = isDuibaPrize; // this.useBtn.enabled = this.name.enabled = isDuibaPrize;
this.tips.enabled = !isDuibaPrize; this.tips.enabled = !isDuibaPrize;
this._isDuibaPrize = isDuibaPrize;
this._lottery = data.luckBagDetail;
if (isDuibaPrize) {//大牌券 if (isDuibaPrize) {//大牌券
this._link = data.luckBagDetail.link; // this._link = data.luckBagDetail.link;
imgUrl = data.luckBagDetail.imgurl; imgUrl = data.luckBagDetail.imgurl;
setY(this.useBtn, this._y); setY(this.useBtn, this._y);
......
...@@ -34,35 +34,44 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -34,35 +34,44 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
this._drop.callback = this.dropEndCallback; this._drop.callback = this.dropEndCallback;
this.entity.addChild(this._drop.entity); this.entity.addChild(this._drop.entity);
} }
this.updateCountTxt(); // this.updateCountTxt();
this.broadcast('callApi', 1, 'limitTimes', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
} }
dropEndCallback = () => { dropEndCallback = () => {
this.onShakeOver(); this.onShakeOver();
} }
// initGameStage() { updateCountFromNet(limit: number) {
// this.updateCountTxt(); 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; let limit = 0;
if (this.doJoin) { if (this.doJoin) {
limit = this.doJoin.freeLimit; limit = this.doJoin.freeLimit;
} else {
limit = window['CFG'].freeLimit;
} }
if (limit < 0) if (limit < 0)
limit = 0; limit = 0;
setText(this.countTxt, `剩余次数:${limit}`); setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountTxtFromDojoin', `剩余次数:${limit}`)
} }
onClick_startbtn() { onClick_startbtn() {
// if (error === '400005') {
// this.bubbling('showToast', '活动还未开始\n敬请期待~');
// } else if (error === '400006') {
// this.bubbling('showToast', '活动已结束\n下次早点来哦~');
// }
const { startTime, endTime } = window['CFG']; const { startTime, endTime } = window['CFG'];
const now = Date.now(); const now = Date.now();
if (now < startTime) { if (now < startTime) {
...@@ -74,21 +83,41 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -74,21 +83,41 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
return; return;
} }
this.startbtn.getComponent(Button).enabled = false; this.startbtn.getComponent(Button).enabled = false;
this._shakeTimes = this.SHAK_TIMERS;
this._counter = 0; this.dojoinFunc();
setRotation(this.treeWrapper, this.STREN);
} }
onShakeOver() { onShakeOver() {
// if (window['getDuibaToken']) { this.startbtn.getComponent(Button).enabled = true;
// window['getDuibaToken']((tokenObj: any) => { this.updateCountTxtFromDojoin();
// this.dojoinFunc(tokenObj.token); // console.log('onGotDojoin', this.doJoin);
// }, (key: string, messageObj: any) => { const data = this.doJoin;
// // this.onError(net); if (data.prizeType == 0) {//幸运奖
// }); this.startbtn.getComponent(Button).enabled = true;
// } else { if (data && data.lottery) {
this.dojoinFunc(); 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?) { dojoinFunc(token?) {
...@@ -120,33 +149,11 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie ...@@ -120,33 +149,11 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
} }
onGotDojoin(data) { onGotDojoin(data) {
this.updateCountTxt(); this._shakeTimes = this.SHAK_TIMERS;
// console.log('onGotDojoin', this.doJoin); this._counter = 0;
if (data.prizeType == 0) {//幸运奖 setRotation(this.treeWrapper, this.STREN);
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 = false;
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');
}
}
} }
onGotDojoinError(error) { onGotDojoinError(error) {
......
<!DOCTYPE html>
<html>
<head> <script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>
<script>
<title>水井坊</title> // init vConsole
var vConsole = new VConsole();
</head> 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> <script>
<meta charset="UTF-8"> setTimeout(function () {
<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" /> var loadingEl = document.getElementById('loading');
<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');
function onProcess(p) { function onProcess(p) {
if (p >= 1) { if (p >= 1) {
loadingEl.style.display = 'none'; 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, var options = {
body { resPath: "//yun.duiba.com.cn/db_games/1561784668/"
height: 100%; };
background-color: #282C34; window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
} }, 100);
#loading { window.ruleContent = '';
position: absolute; window.ruleContent += '1.点击接礼物,礼物树开始掉落奖品<br>';
left: 0; window.ruleContent += '2.奖品为随机掉落,接到实物奖品的获奖用户请于获奖当日在宴会现场工作人员处领取奖品,否则视为放弃领奖<br>';
right: 0; window.ruleContent += '3.若未在游戏开放时间内或剩余参与次数为0时开始游戏,将无法参与游戏<br>';
top: 0; window.ruleContent += '4.点击【我的奖品】可查看获奖情况<br>';
bottom: 0; window.ruleContent += '5.在本次活动期间,如用户存在任何违反法律、法规、水井坊活动规则的行为,包括但不限于作弊得奖等行为,水井坊有权取消用户的中奖资格,有权撤销违规交易<br>';
display: flex; window.ruleContent += '6.在法律规定的范围内,水井坊对本次活动拥有最终解释权';
display: -webkit-flex;
justify-content: center;
-webkit-justify-content: center;
align-items: center;
-webkit-align-items: center;
}
#floatLayer::-webkit-scrollbar { </script>
display: none <style>
} html,
</style> body,
p {
padding: 0;
margin: 0;
border: 0;
}
html,
body {
height: 100%;
background-color: #282C34;
}
<script type="text/javascript"> #loading {
var CFG = { position: absolute;
'startTime': 'Wed Jun 26 17:30:00 CST 2019', left: 0;
'endTime': 'Wed Jun 26 21:00:00 CST 2019', right: 0;
'weddingId': 1, top: 0;
'freeLimit': 4, bottom: 0;
'weixinUid': 'weiXinUid', display: flex;
'activityId': '2', display: -webkit-flex;
'nickname': 'nickName', justify-content: center;
'activity': { -webkit-justify-content: center;
"activityType": 3, "brickId": 4, "drawStatus": 0, "id": 2, "joinLimit": 5, align-items: center;
"prizeList": -webkit-align-items: center;
[ }
{ "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 #floatLayer::-webkit-scrollbar {
} display: none
}; }
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'; </style>
</script>
</body>
</html>
\ No newline at end of file
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
<script src="debug/bundle.js"></script> <script src="debug/bundle.js"></script>
<script> <script>
var CFG = { var CFG = {
'startTime': 1561703100000, 'startTime': 0.1561703100000,
'endTime': 1561714980000, 'endTime': 91561714980000,
'weddingId': 1111, 'weddingId': 1111,
'freeLimit': 10, 'freeLimit': 10,
'weixinUid': 00000, 'weixinUid': 00000,
...@@ -67,8 +67,14 @@ ...@@ -67,8 +67,14 @@
'activity': { id: 1 } '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() { function requirelogin() {
console.log('requirelogin'); console.log('requirelogin');
} }
......
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
"entryScene": "main" "entryScene": "main"
}, },
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010", "webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl": "", "webServiceUrl1": "",
"webServiceUrl1": "http://localhost:4001" "webServiceUrl": "http://localhost:4001"
}, },
"dataCenterConfig": { "dataCenterConfig": {
"dataCenterRoot": [ "dataCenterRoot": [
......
{ {
"success": true, "code": "400002",
"code": null,
"desc": null,
"timestamp": 1561704434453,
"data": { "data": {
"orderId": 497, "imgurl": "//yun.dui88.com/upload/uP99F1462438316972.png",
"prizeId": 70, "luck": null,
"title": "测试数据优化广告1", "orderId": 22,
"prizeType": 0, "freeLimit":0,
"orderStatus": 2, "prizeType": 4,
"imgurl": "//yun.dui88.com/babi/img/adbc3446-da1wjlykae.png",
"link": null, "link": null,
"freeLimit": 99, "orderStatus": 2,
"exposure": { "title": "惊喜娃娃机奖品1",
"consumerId": 1561704433922, "prizeId": 3
"appId": 1, },
"orderId": "497", "success": true,
"activityId": 21, "desc": null,
"advertId": 4337, "timestamp": 1561540156975
"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": null, "code": null,
"desc": null,
"timestamp": 1561704434453,
"data": { "data": {
"imgurl": "//yun.dui88.com/upload/uP99F1462438316972.png", "orderId": 497,
"luck": null, "prizeId": 70,
"orderId": 22, "title": "测试数据优化广告1",
"freeLimit":1, "prizeType": 0,
"prizeType": 4,
"link": null,
"orderStatus": 2, "orderStatus": 2,
"title": "惊喜娃娃机奖品1", "imgurl": "//yun.dui88.com/babi/img/adbc3446-da1wjlykae.png",
"prizeId": 3 "link": null,
}, "freeLimit": 1234,
"success": true, "exposure": {
"desc": null, "consumerId": 1561704433922,
"timestamp": 1561540156975 "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