Commit 121bd2a0 authored by wildfirecode's avatar wildfirecode

1

parent b55bc6cd
No preview for this file type
node_modules
debug
debug/*.js
debug/*.js.map
.rpt2_cache
dist
**/*/.DS_Store
\ No newline at end of file
......@@ -189,6 +189,21 @@
}
]
}
},
{
"script": "./scripts/api/SampleApi",
"properties": {
"method": "POST",
"name": "limitTimes",
"onResponse": [
{
"entity": "entity|41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
"component": 1,
"method": "updateCountFromNet"
}
],
"uri": "/customActivity/sjf/activity/getActivityFreeLimt"
}
}
],
"uuid": "41f0a20e-9d0a-445b-8ffc-d8a0b04ab02c",
......@@ -383,7 +398,7 @@
"_x": 0,
"_y": 245.1060606060605,
"x": 0,
"y": 199.07431457431449
"y": 187.64574314574307
}
}
},
......@@ -429,7 +444,7 @@
"_x": 0,
"_y": 299.651515151515,
"x": 0,
"y": 271.08008658008646
"y": 259.65151515151507
}
}
},
......@@ -481,7 +496,7 @@
"script": "components/renderer/TextRenderer",
"properties": {
"fillColor": "rgba(254, 220, 187, 1)",
"text": "啥也没发"
"text": ""
}
}
],
......
......@@ -21,7 +21,8 @@ export default class MainController extends ScillaComponent {
initEnv();
console.log('游戏刷新了...');
// const limit = localStorage.getItem('')
}
......
......@@ -4,16 +4,16 @@
* 简单的api组件
*/
import {utils, } from 'scilla/src'
import { utils, } from 'scilla/src'
import ApiComponent from "./ApiComponent";
import {callApi} from "../net/webService";
import { callApi } from "../net/webService";
export default class SampleApi extends ApiComponent {
uri: string;
ignoreSuccessField = false;
async callApi(name, paramsInput, ...args){
if(this.name == name){
async callApi(name, paramsInput, ...args) {
if (this.name == name) {
await this.execute(paramsInput, ...args);
}
}
......@@ -23,20 +23,22 @@ export default class SampleApi extends ApiComponent {
const params = {};
if(this.params){
if (this.params) {
utils.injectProp(params, this.params);
}
if(paramsInput){
if (paramsInput) {
utils.injectProp(params, paramsInput);
}
const {uri, method} = this;
const { uri, method } = this;
try {
console.log(`${uri}==>${JSON.stringify(params)}`);
const response = await callApi(uri, params, method, 'json', this.ignoreSuccessField);
this.onGotResponse(response);
console.log(`${uri}<<==${JSON.stringify(response)}`);
return response.data;
} catch (e) {
......
......@@ -52,14 +52,36 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
}
updateCountFromNet(limit: number) {
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountFromNet', `剩余次数:${limit}`)
}
updateCountTxtFromDojoin() {
let limit = 0;
if (this.doJoin) {
limit = this.doJoin.freeLimit;
}
if (limit < 0)
limit = 0;
setText(this.countTxt, `剩余次数:${limit}`);
console.log('updateCountTxtFromDojoin', `剩余次数:${limit}`)
}
onAwake() {
super.onAwake();
this.updateCountTxt();
this.broadcast('callApi', 1, 'rankInfo2', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
this.broadcast('callApi', 1, 'limitTimes', {
weddingId: window['CFG'].weddingId,
activityId: window['CFG'].activityId
});
this._shakeTimes = 0;
this._counter = 0;
this._lastTime = -1;
......@@ -88,18 +110,6 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
return 'prizeShowed-' + window['CFG'].weixinUid + '-' + window['CFG'].weddingId + '-' + window['CFG'].activityId
}
updateCountTxt() {
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(`剩余次数:${limit}`)
}
initGameStage() {
console.log('initGameStage')
}
......@@ -131,7 +141,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
onGotDojoin() {
console.log('onGotDojoin', this.doJoin);
this.startbtn.getComponent(Button).enabled = true;
this.updateCountTxt();
this.updateCountTxtFromDojoin();
setTimeout(() => {
this.bubbling('fuck', 'guide');
}, 50);
......
This diff is collapsed.
This diff is collapsed.
......@@ -12,6 +12,9 @@
<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" />
......@@ -23,13 +26,13 @@
<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/1561641018/bundle.js"></script>
<script src="//yun.duiba.com.cn/db_games/1561707303/bundle.js"></script>
<script> setTimeout(function () {
var loadingEl = document.getElementById('loading'); function onProcess(p) { if (p >= 1) { loadingEl.style.display = 'none'; } }
var options = { resPath: "//yun.duiba.com.cn/db_games/1561639721/" }; window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
var options = { resPath: "//yun.duiba.com.cn/db_games/1561707833/" }; window['shuijf'].startup(document.getElementById('gameContainer'), options, onProcess);
}, 100);
window['COUNT_DOWN_SEC'] = 10;
window['COUNT_DOWN_SEC'] = 5;
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>
......@@ -70,8 +73,6 @@
<script src="https://yun.duiba.com.cn/db_games/debug/vconsole.min.js"></script>
<script>
// init vConsole
......
......@@ -16,8 +16,8 @@
"entryScene": "main"
},
"webServiceUrl-": "http://10.10.93.204:7555 http://localhost:3010",
"webServiceUrl1": "",
"webServiceUrl": "http://localhost:4001"
"webServiceUrl1": "http://localhost:4001",
"webServiceUrl": ""
},
"dataCenterConfig": {
"dataCenterRoot": [
......
{
"success": true,
"code": null,
"desc": null,
"timestamp": 1561625108247,
"data": 111
}
\ 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