Commit 715d9644 authored by wildfirecode's avatar wildfirecode

1

parent 91ad4502
......@@ -120,7 +120,7 @@
"properties": {
"method": "POST",
"name": "doJoin",
"uri": "/hdtool/recon/doJoin",
"uri": "/customActivity/sjf/activity/dojion",
"onError": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
......@@ -137,27 +137,6 @@
]
}
},
{
"script": "./scripts/api/SamplePollingApi",
"properties": {
"name": "getNgameStartStatus",
"onError": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "onGotError_getNgameStartStatus"
}
],
"onResponse": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "onGot_getNgameStartStatus"
}
],
"uri": "/hdtool/recon/ngame/getNgameStartStatus"
}
},
{
"script": "./scripts/api/SamplePollingApi",
"properties": {
......@@ -1066,7 +1045,7 @@
"uuid": "4d9e497d-0507-4c38-b639-54336e9ee8e6"
}
],
"disabled": false
"disabled": true
},
{
"name": "Alert",
......@@ -1225,7 +1204,11 @@
"properties": {
"pic": "entity|5e468650-9e44-4f2d-8dba-be066cd89c37",
"label": "entity|e6dc4c00-8481-4356-8610-8abe1a354663",
"getOrderStatus": "dynamic|API|getOrderStatus"
"getOrderStatus": "dynamic|API|getOrderStatus",
"useBtn": "entity|4a171b87-ea4d-41c2-9009-31eb1bf19383",
"prizeType": "entity|f5f89b3f-da91-42ba-ac08-3cda2792bb07",
"name": "entity|6720c2b8-f3ab-42a1-a714-b3420c4ce356",
"tips": "entity|e67a692f-68ea-43ca-8046-d4db33798873"
}
}
],
......@@ -1336,9 +1319,11 @@
"script": "components/base/Transform",
"properties": {
"position": {
"_hashCode": 47933,
"_x": 0,
"_y": 50,
"x": 0,
"y": 50,
"_type_": "scilla/support/Vector2D"
"y": 72.22222222222223
}
}
},
......@@ -1348,9 +1333,90 @@
}
],
"uuid": "5e468650-9e44-4f2d-8dba-be066cd89c37"
},
{
"name": "name",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"x": 0,
"y": 204.44444444444443
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "兑吧奖品",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 22
}
}
}
],
"uuid": "6720c2b8-f3ab-42a1-a714-b3420c4ce356"
},
{
"name": "tips",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"_hashCode": 49002,
"_x": 0,
"_y": 233.33333333333331,
"x": 0,
"y": 248.88888888888886
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "请于婚宴现场领取奖品~",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 24
}
}
}
],
"uuid": "e67a692f-68ea-43ca-8046-d4db33798873"
},
{
"name": "prizeType",
"components": [
{
"script": "components/base/Transform",
"properties": {
"position": {
"_hashCode": 47404,
"_x": 0,
"_y": -93.33333333333333,
"x": 0,
"y": -86.66666666666666
}
}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "获得xx等奖",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 30
}
}
}
],
"uuid": "f5f89b3f-da91-42ba-ac08-3cda2792bb07"
}
],
"disabled": true
"disabled": false
}
],
"disabled": false
......
......@@ -26,42 +26,42 @@ export default class MainController extends ScillaComponent {
initEnv();
this.broadcast('callApi', 1, 'ajaxElement', { duibaId: this.hdToolId, activityId: this.actId })
// this.broadcast('callApi', 1, 'ajaxElement', { duibaId: this.hdToolId, activityId: this.actId })
}
onGotAjaxElement() {
this.broadcast('initGameStage');
}
// onGotAjaxElement() {
// this.broadcast('initGameStage');
// }
onGotAjaxElementError(e) {
console.log(e);
// onGotAjaxElementError(e) {
// console.log(e);
// if (typeof e === 'string') {
// switch (e) {
// case '0100016': //活动未开始
// case '0100014': //活动已结束
// case '0100017': //活动已关闭
// this.showErrorToast(e);
// break;
// default:
// this.showNetError();
// }
// } else {
// this.showNetError();
// }
}
// // if (typeof e === 'string') {
// // switch (e) {
// // case '0100016': //活动未开始
// // case '0100014': //活动已结束
// // case '0100017': //活动已关闭
// // this.showErrorToast(e);
// // break;
// // default:
// // this.showNetError();
// // }
// // } else {
// // this.showNetError();
// // }
// }
showErrorToast(e) {
// switch (e) {
// case '0100016': //活动未开始
// this.showToast('活动未开始,暂时无法参与');
// break;
// case '0100014': //活动已结束
// case '0100017': //活动已关闭
// this.showToast('活动已结束,无法参与');
// break;
// }
}
// showErrorToast(e) {
// // switch (e) {
// // case '0100016': //活动未开始
// // this.showToast('活动未开始,暂时无法参与');
// // break;
// // case '0100014': //活动已结束
// // case '0100017': //活动已关闭
// // this.showToast('活动已结束,无法参与');
// // break;
// // }
// }
showToast(content, duration?) {
this._toast.show({
......
......@@ -5,14 +5,19 @@
*/
import { TextureRenderer } from "scilla-components/src";
import { AssetsManager, createTexture, EngineConfig, Entity, Texture, dynamic } from "scilla/src";
import { createTexture, EngineConfig, Entity, Texture } from "scilla/src";
import DialogContent from "../popup/DialogContent";
import { setScale } from "../transformUtils";
import { setText } from "../entityUtils";
export default class PrizeDialogContent extends DialogContent {
name: Entity;
tips: Entity;
prizeType: Entity;
pic: Entity;
getOrderStatus:dynamic;
useBtn: Entity;
// getOrderStatus:dynamic;
private _link: string;
private loadImage = (url: string): Promise<HTMLImageElement> => {
return new Promise<HTMLImageElement>((resolve, reject) => {
let img = new Image();
......@@ -35,17 +40,29 @@ export default class PrizeDialogContent extends DialogContent {
return texture;
}
onClick_usebtn(){
window.location.href=this.getOrderStatus.lottery.link
onClick_usebtn() {
window.location.href = this._link
}
onAwake() {
super.onAwake();
}
async setup(dat1a: any = {}) {
async setup({ isDuibaPrize, data }) {
let imgUrl: string;
this.useBtn.enabled = this.name.enabled = isDuibaPrize;
this.tips.enabled = !isDuibaPrize;
if (isDuibaPrize) {//大牌券
this._link;
} else {//线下
imgUrl = data.imgurl;
}
setText(this.prizeType, this.getTypeStr(data.prizeType));
const texRender = this.pic.getComponent(TextureRenderer);
const texture = await this.loadTexture(this.getOrderStatus.lottery.imgUrl);
const texture = await this.loadTexture(imgUrl);
texRender.texture = texture;
if (texture.bounds.width > texture.bounds.height) {
const maxWidth = 500;
......@@ -55,4 +72,19 @@ export default class PrizeDialogContent extends DialogContent {
setScale(this.pic, width / texture.bounds.width)
}
}
private getTypeStr(type: number) {
if (type == 1) {
return `获得一等奖`
}
if (type == 2) {
return `获得二等奖`
}
if (type == 3) {
return `获得三等奖`
}
if (type == 4) {
return `获得四等奖`
}
}
}
......@@ -2,5 +2,6 @@ import { TextRenderer } from "scilla-components/src";
import { Entity } from "scilla/src";
export const setText = (entity: Entity, text) => {
// console.log(text)
entity.getComponent(TextRenderer).text = text;
}
\ No newline at end of file
......@@ -12,9 +12,7 @@ import Drop from "./Drop";
export default class SceneStart extends ScillaComponent implements INavigatorViewBase {
Drop: resource;
ajaxElement: dynamic;
doJoin: dynamic;
getNgameStartStatus: dynamic;
getOrderStatus: dynamic;
countTxt: Entity;
......@@ -91,15 +89,22 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
}
onGotDojoin() {
onGotDojoin(data) {
console.log('onGotDojoin', this.doJoin);
// this.startbtn.getComponent(Button).enabled = true;
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
// this.broadcast('callApi', 1, 'getNgameStartStatus', {
// orderId: this.doJoin
// });
if (data.prizeType == 0) {//幸运奖
this.broadcast('callApi', 1, 'getOrderStatus', {
orderId: this.doJoin
});
} 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');
}
}
}
onGotDojoinError(error) {
......@@ -123,7 +128,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
this.startbtn.getComponent(Button).enabled = true;
console.log('onResponse_getOrderStatus', this.getOrderStatus);
if (this.getOrderStatus.lottery) {
this.bubbling('showDialog', 'Prize', this.getOrderStatus);
this.bubbling('showDialog', 'Prize', {isDuibaPrize:true,data:this.getOrderStatus});
} else {
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
}
......@@ -147,34 +152,6 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
console.log('onError_getOrderStatus', error);
}
onGot_getNgameStartStatus() {
this.startbtn.getComponent(Button).enabled = true;
console.log('onGot_getNgameStartStatus', this.getNgameStartStatus);
if (this.getNgameStartStatus.orderId) {
this.bubbling('showDialog', 'Prize', this.getNgameStartStatus);
} else {
this.bubbling('showDialog', 'Alert', '您与奖品擦肩而过~');
}
}
onGotError_getNgameStartStatus(error) {
this.startbtn.getComponent(Button).enabled = true;
this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// if (error === '0') {
// this.bubbling('showDialog', 'Alert', '活动还未开始\n敬请期待~');
// }
// else if (error === '1') {
// this.bubbling('showDialog', 'Alert', '活动已结束\n下次早点来哦~');
// }
// else if (error === '2') {
// this.bubbling('showDialog', 'Alert', '您已经没有抽奖机会了');
// }
// else {
// this.bubbling('showDialog', 'Alert', '网络异常,请稍后再试~');
// }
console.log('onGotError_getNgameStartStatus', error);
}
onClick_rulebtn() {
console.log('onClick_rulebtn');
this.bubbling('showDialog', 'Rule');
......
......@@ -56,8 +56,17 @@
<script src="./security.js"></script>
<script src="debug/bundle.js"></script>
<script>
CFG={};
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';
var CFG = {
'startTime': 1,
'endTime': 2,
'weddingId': 1111,
'freeLimit': 0,
'weixinUid': 00000,
'nickname': 'honingwon',
'activity': 123
};
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';
function requirelogin() {
console.log('requirelogin');
......
......@@ -4,12 +4,12 @@
"desc": null,
"timestamp": 1561445946866,
"data": {
"orderId": 123,
"orderId": 132,
"prizeId": null,
"title": null,
"prizeType": 6,
"prizeType": 5,
"orderStatus": 1,
"imgurl": null,
"imgurl": "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"link": null
}
}
\ No newline at end of file
{
"code": "0000000000",
"data": {
"creditsConf": {
"creditsUp": 100,
"creditsType": "virtual",
"creditsDown": 50,
"prize": [
{
"img": "adsfsadf",
"credits": 20,
"id": 4,
"title": "0.3"
},
{
"img": "sadfasdf",
"credits": 150,
"id": 3,
"title": "1.5倍"
},
{
"img": "sadfasdf",
"credits": 100,
"id": 2,
"title": "1倍"
},
{
"img": "sadfasdf",
"credits": 50,
"id": 1,
"title": "0.5倍"
}
]
},
"floating": {
"jsTest": "//yun1.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191434.js",
"cssTest": "//yun1.duiba.com.cn/h5/showCouponPrize/4.0.0/index_201710191440.css"
},
"options": [
{
"hidden": false,
"prizeType": "thanks",
"name": "谢谢参与",
"description": "",
"logo": "//yun1.duiba.com.cn/upload/uP99F1462438316972.png",
"id": 15581
},
{
"hidden": false,
"prizeType": "lucky",
"name": "幸运福袋",
"description": "",
"logo": "//yun1.duiba.com.cn/webapp/img/luckynewn.png",
"id": 15582
},
{
"itemId": 47861,
"scoreArea": "",
"hidden": false,
"prizeType": "alipay",
"name": "支付宝1",
"description": "",
"logo": "//yun1.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"id": 15585
}
],
"rule": "adsfasdf",
"type": "hdtool",
"element": {
"isCreditsTypeOpen": false,
"myCreditsLong": 999999632167,
"freeLimit": -1,
"success": false,
"myCredits": "999999632167",
"needCredits": "100",
"freeEmpty": true,
"needCreditsLong": 100,
"status": 1
}
},
"success": true,
"desc": "OK",
"timestamp": 1548832971636
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550564744291,
"data": {
"skincontent": "f2fcc331f44c98883f3a5b4868d7d7f4",
"throughInfo": [
{
"step": 3,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 4,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 5,
"prizeType": 2,
"description": null,
"img": ""
},
{
"step": 6,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 7,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 9,
"prizeType": 2,
"description": null,
"img": ""
},
{
"step": 10,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 11,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 13,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 15,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 16,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 18,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 19,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 21,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 22,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 24,
"prizeType": 1,
"description": null,
"img": ""
},
{
"step": 27,
"prizeType": 4,
"description": null,
"img": ""
}
]
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":1
}
\ No newline at end of file
{
"success": true,
"code": "2",
"desc": "OK",
"timestamp": 1548915321930,
"data": 123456
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550569853824,
"data": {
"prizeType": "alipay",
"facePrice": "100",
"title": "1"
}
}
\ No newline at end of file
{
"success":true,
"code": 1,
"desc":"L(*ythj",
"timestamp":1548923950498
}
\ No newline at end of file
{
"code": "1C000000001",
"data": {
"creditsInfo": {
"activityId": 21194,
"score": 31,
"recordStatus": 1,
"developerBizId": "3013273",
"prizeId": 1
},
"lottery": {
"imgUrl": "//yun.duiba.com.cn/babi/img/q7yx1sus73.gif",
"imgUrl1": "//yun.duiba.com.cn/developer/img/activityTool/slotMachine/alipay.png",
"itemId": 20348,
"appHidden": true,
"link": "//activity.m.duibatest.com.cn/activity/takePrizeNew?recordId=3395303&dbnewopen",
"id": 9,
"title": "虚拟商品",
"type": "v",
"isDownloadUrl": true
},
"element": {
"isCreditsTypeOpen": false,
"myCreditsLong": 4993862,
"freeLimit": 2,
"success": true,
"myCredits": "4993862",
"needCredits": "200",
"freeEmpty": false,
"needCreditsLong": 200,
"status": 5
}
},
"success": true,
"desc": "OK",
"timestamp": 1550543212313
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":1
}
\ No newline at end of file
{
"success": true,
"code": "0",
"desc": "OK",
"timestamp": 1550570639368,
"data": {
"orderId": "12345",
"submitToken": "d895deb9118f4b938d0b70a3dd2ace19",
"credits": "999999491765",
"unitName": "金币",
"consumerCredits": 999999491765
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":123456
}
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550646190489,
"data": {
"score": 100,
"maxScore": 100
}
}
\ No newline at end of file
{
"success": true,
"code": 1,
"desc": "Hl7&L",
"timestamp": "1548915321930",
"data": "123123123"
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1551066205001,
"data": {
"resurrectionStatus": true,
"resurrectionCount": 2,
"resurrectionCredits": 300
}
}
\ No newline at end of file
{
"success": true,
"code": 0,
"desc": "ok",
"timestamp": "1519442544000",
"data": {
"valiDate": "2019-04-11 11:11:11",
"description": "xxx",
"title": "title",
"img": "//yun1.duiba.com.cn/upload/uP99F1462438316972.png"
}
}
\ No newline at end of file
{
"success":true,
"code":"0000000000",
"desc":"OK",
"timestamp":1548915321930,
"data":1
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550647892216,
"data": "扣积分成功"
}
\ No newline at end of file
{
"success": true,
"code": "0000000000",
"desc": "OK",
"timestamp": 1550568405622,
"data": {
"needPrize": true,
"lastThrough": null,
"currentLocation": 6,
"prizeType": 5,
"retreat": null,
"forward": null,
"url": null,
"plginOrderId": null,
"point": 5
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
"main": "index.js",
"license": "MIT",
"scripts": {
"livereload": "livereload . -ee scene,jpg,png,html",
"livereload": "livereload . -ee jpg,png,html",
"mock": "game-cli m -p 4001 -f './mock'",
"server": "game-cli serve -p 3001",
"dev": "game-cli dev"
......
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