Commit d13fabc8 authored by wangxin's avatar wangxin

v2

parent 9e83db57
...@@ -1367,9 +1367,9 @@ ...@@ -1367,9 +1367,9 @@
"_enabled": true, "_enabled": true,
"alignMode": 2, "alignMode": 2,
"_target": null, "_target": null,
"_alignFlags": 41, "_alignFlags": 17,
"_left": 180.39999999999998, "_left": 25.940000000000055,
"_right": 180.39999999999998, "_right": 25.940000000000055,
"_top": 388.041, "_top": 388.041,
"_bottom": 43, "_bottom": 43,
"_verticalCenter": 0, "_verticalCenter": 0,
...@@ -1413,7 +1413,7 @@ ...@@ -1413,7 +1413,7 @@
"_N$spacingY": 0, "_N$spacingY": 0,
"_N$verticalDirection": 1, "_N$verticalDirection": 1,
"_N$horizontalDirection": 0, "_N$horizontalDirection": 0,
"_N$affectedByScale": false, "_N$affectedByScale": true,
"_id": "830bHE3kZM7LAWOcn0VoNv" "_id": "830bHE3kZM7LAWOcn0VoNv"
}, },
{ {
......
...@@ -126,7 +126,7 @@ cc.Class({ ...@@ -126,7 +126,7 @@ cc.Class({
getDefaultData() { getDefaultData() {
const dataJson = const dataJson =
'{"title":"test","answer":3,"question":"hello world hello world hello world hello world","options":[{"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"}'; '{"title":"test","answer":3,"question":"hello world hello world hello world hello world","options":[{"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"},{"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"},{"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"},{"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;
}, },
...@@ -186,12 +186,25 @@ cc.Class({ ...@@ -186,12 +186,25 @@ 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 scaleAdjust = 1;
// if (countScale > 0) { let countScale = this.data.options.length - 4;
// scale = 1 - countScale * 0.16; if (countScale <= 1) {
// } scaleAdjust = 0.2;
// this.options.scale = scale; } else if (countScale >= 2 && countScale < 3) {
scaleAdjust = 0.16;
} else if (countScale >= 3 && countScale < 4) {
scaleAdjust = 0.14;
} else if (countScale >= 4 && countScale < 5) {
scaleAdjust = 0.13;
} else {
scaleAdjust = 0.12;
}
if (countScale > 0) {
scale = 1 - countScale * scaleAdjust;
}
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;
......
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