Commit a1347215 authored by wangxin's avatar wangxin

调整

parent d000fe44
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
130.5, 120,
0, 0,
0, 0,
0, 0,
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"_alignFlags": 1, "_alignFlags": 1,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 51, "_top": 61.5,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -1052,7 +1052,7 @@ ...@@ -1052,7 +1052,7 @@
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 27
...@@ -1294,6 +1294,9 @@ ...@@ -1294,6 +1294,9 @@
"stars": { "stars": {
"__id__": 23 "__id__": 23
}, },
"btnSound": {
"__id__": 26
},
"_audioTitle": null, "_audioTitle": null,
"_isPlaying": false, "_isPlaying": false,
"_isAnswer": false, "_isAnswer": false,
......
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 594, "width": 550,
"height": 94 "height": 94
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
126.5, 120,
0, 0,
0, 0,
0, 0,
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
"_alignFlags": 1, "_alignFlags": 1,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 51, "_top": 57.5,
"_bottom": 0, "_bottom": 0,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -1052,7 +1052,7 @@ ...@@ -1052,7 +1052,7 @@
"__id__": 1 "__id__": 1
}, },
"_children": [], "_children": [],
"_active": true, "_active": false,
"_components": [ "_components": [
{ {
"__id__": 27 "__id__": 27
...@@ -1294,6 +1294,9 @@ ...@@ -1294,6 +1294,9 @@
"stars": { "stars": {
"__id__": 23 "__id__": 23
}, },
"btnSound": {
"__id__": 26
},
"_audioTitle": null, "_audioTitle": null,
"_isPlaying": false, "_isPlaying": false,
"_isAnswer": false, "_isAnswer": false,
......
...@@ -1291,7 +1291,7 @@ ...@@ -1291,7 +1291,7 @@
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": -12, "width": 1149,
"height": 352 "height": 352
}, },
"_anchorPoint": { "_anchorPoint": {
...@@ -1304,7 +1304,7 @@ ...@@ -1304,7 +1304,7 @@
"ctor": "Float64Array", "ctor": "Float64Array",
"array": [ "array": [
0, 0,
-176.2, -125.43700000000001,
0, 0,
0, 0,
0, 0,
...@@ -1338,10 +1338,10 @@ ...@@ -1338,10 +1338,10 @@
"_enabled": true, "_enabled": true,
"alignMode": 2, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 4, "_alignFlags": 1,
"_left": 0, "_left": 0,
"_right": 0, "_right": 0,
"_top": 0, "_top": 344.637,
"_bottom": 43, "_bottom": 43,
"_verticalCenter": 0, "_verticalCenter": 0,
"_horizontalCenter": 0, "_horizontalCenter": 0,
...@@ -1365,7 +1365,7 @@ ...@@ -1365,7 +1365,7 @@
"_enabled": true, "_enabled": true,
"_layoutSize": { "_layoutSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": -12, "width": 1149,
"height": 352 "height": 352
}, },
"_resize": 1, "_resize": 1,
......
...@@ -121,7 +121,7 @@ cc.Class({ ...@@ -121,7 +121,7 @@ cc.Class({
getDefaultData() { getDefaultData() {
const dataJson = const dataJson =
'{"title":"test","answer":3,"question":"hello world","options":[{"pic_url":"http://staging-teach.cdn.ireadabc.com/c5a7a94fbebdbf635952454cbe8b3371.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/fff5204fc774e932bcd597b4094b0852.mp3","text":"选项1"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/3064a1f8bec54390c031b2c2d8b84e7f.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/e8627e7f3ec1a04fdb3660eae81f7636.mp3","text":"选项2"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/3064a1f8bec54390c031b2c2d8b84e7f.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/e8627e7f3ec1a04fdb3660eae81f7636.mp3","text":"选项2, how are you doing aaaa"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/acd066762f1b2aee555b8fe835bec3ae.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/e8627e7f3ec1a04fdb3660eae81f7636.mp3","text":"选项2"}],"audio_title":"http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3","audio_question":"http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3"}'; '{"title":"test","answer":3,"question":"hello world","options":[{"pic_url":"http://staging-teach.cdn.ireadabc.com/c5a7a94fbebdbf635952454cbe8b3371.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/fff5204fc774e932bcd597b4094b0852.mp3","text":"选项1"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/3064a1f8bec54390c031b2c2d8b84e7f.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/e8627e7f3ec1a04fdb3660eae81f7636.mp3","text":"选项2"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/3064a1f8bec54390c031b2c2d8b84e7f.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/e8627e7f3ec1a04fdb3660eae81f7636.mp3","text":"选项2, how are you doing aaaa"},{"pic_url":"http://staging-teach.cdn.ireadabc.com/3064a1f8bec54390c031b2c2d8b84e7f.jpeg","audio_url":"","text":"选项2, how are you doing aaaa"}],"audio_title":"http://staging-teach.cdn.ireadabc.com/f7fb9f71ab7d460ac2f78c85efba7610.mp3","audio_question":"http://staging-teach.cdn.ireadabc.com/7934cdcec68eabe639020bad5420d7f8.mp3"}';
const data = JSON.parse(dataJson); const data = JSON.parse(dataJson);
return data; return data;
}, },
...@@ -181,12 +181,12 @@ cc.Class({ ...@@ -181,12 +181,12 @@ cc.Class({
let count = this.data.options.length; let count = this.data.options.length;
let scale = 1; // let scale = 1;
let countScale = this.data.options.length - 4; // let countScale = this.data.options.length - 4;
if (countScale > 0) { // if (countScale > 0) {
scale = 1 - countScale * 0.16; // scale = 1 - countScale * 0.16;
} // }
this.options.scale = scale; // this.options.scale = scale;
for (let i = 0; i < this.data.options.length; i++) { for (let i = 0; i < this.data.options.length; i++) {
let op = null; let op = null;
...@@ -201,7 +201,7 @@ cc.Class({ ...@@ -201,7 +201,7 @@ cc.Class({
} }
op.getComponent("option").setPic(this.data.options[i].pic_url); op.getComponent("option").setPic(this.data.options[i].pic_url);
op.getComponent("option").setTitle(this.data.options[i].text); op.getComponent("option").setTitle(this.data.options[i].text);
op.getComponent("option")._audioTitle = this.data.options[i].audio_url; op.getComponent("option").setAudio(this.data.options[i].audio_url);
op.getComponent("option")._count = this.data.options.length; op.getComponent("option")._count = this.data.options.length;
this.options.addChild(op); this.options.addChild(op);
} }
......
...@@ -36,6 +36,11 @@ cc.Class({ ...@@ -36,6 +36,11 @@ cc.Class({
type: cc.Node, type: cc.Node,
}, },
btnSound: {
default: null,
type: cc.Node,
},
_audioTitle: null, _audioTitle: null,
_isPlaying: false, _isPlaying: false,
_isAnswer: false, _isAnswer: false,
...@@ -143,4 +148,11 @@ cc.Class({ ...@@ -143,4 +148,11 @@ cc.Class({
this._allowClick = true; this._allowClick = true;
} }
}, },
setAudio(url) {
if (url) {
this.btnSound.active = true;
this._audioTitle = url;
}
},
}); });
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