Commit 20af45f8 authored by Tt's avatar Tt

1

parent 8299aa28
...@@ -77,21 +77,8 @@ export default class LayoutTip extends cc.Component { ...@@ -77,21 +77,8 @@ export default class LayoutTip extends cc.Component {
} else { } else {
type = score > 60 ? LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_EXCELLENT : score > 10 ? LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_GOOD : LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_TRYAGAIN; type = score > 60 ? LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_EXCELLENT : score > 10 ? LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_GOOD : LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_TRYAGAIN;
} }
this.img_wrong.active = type == LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_WRONG;
this.img_wrong.active && pg.hw.playLocalAudio('error')
this.img_right.active = type == LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_RIGHT; this.img_right.active = type == LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_RIGHT;
this.img_right.active && pg.hw.playLocalAudio('right') this.img_right.active && pg.hw.playLocalAudio('right')
this.img_excellent.active = type == LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_EXCELLENT;
this.img_excellent.active && pg.hw.playLocalAudio('excellent')
this.img_good.active = type == LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_GOOD;
this.img_good.active && pg.hw.playLocalAudio('good')
this.img_tryagain.active = type == LayoutTip.LAYOUT_TIP_TYPE.LAYOUT_TIP_TYPE_TRYAGAIN;
this.img_tryagain.active && pg.hw.playLocalAudio('tryagain')
this.log("this.img_wrong.active->" + this.img_wrong.active)
this.log("this.img_right.active->" + this.img_right.active)
this.log("this.img_excellent.active->" + this.img_excellent.active)
this.log("this.img_good.active->" + this.img_good.active)
this.log("this.img_tryagain.active->" + this.img_tryagain.active)
} }
......
...@@ -8612,9 +8612,6 @@ ...@@ -8612,9 +8612,6 @@
"btn_next": { "btn_next": {
"__id__": 72 "__id__": 72
}, },
"label_title": {
"__id__": 48
},
"btn_voice": { "btn_voice": {
"__id__": 49 "__id__": 49
}, },
......
...@@ -186,7 +186,6 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -186,7 +186,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
updateBtns() { updateBtns() {
if (this.CurrentData) { if (this.CurrentData) {
pg.view.setString(this.label_title, this.CurrentData.text);
pg.view.setString(this.label_round, `${this.count + 1}/${this.list.length}`); pg.view.setString(this.label_round, `${this.count + 1}/${this.list.length}`);
} }
...@@ -244,12 +243,12 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -244,12 +243,12 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg.view.visible(this.btn_record, true) pg.view.visible(this.btn_record, true)
this.btn_record.y = -550; this.btn_record.y = -550;
cc.tween(this.btn_record).to(0.3, { y: 0 }).start(); cc.tween(this.btn_record).to(0.3, { y: 0 }).start();
let com = this.btn_record.getComponent(ImgAuto4); let com = this.btn_record.getChildByName("img_voice").getComponent(ImgAuto);
com.playVoiceStart(); com.playVoiceStart();
} }
hideVoiceFlash() { hideVoiceFlash() {
pg.view.visible(this.btn_record, false) pg.view.visible(this.btn_record, false)
let com = this.btn_record.getComponent(ImgAuto4); let com = this.btn_record.getChildByName("img_voice").getComponent(ImgAuto);
com.playVoiceEnd(); com.playVoiceEnd();
} }
...@@ -531,15 +530,16 @@ export default class SceneComponent extends MyCocosSceneComponent { ...@@ -531,15 +530,16 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node) @property(cc.Node)
public btn_next: cc.Node = null; public btn_next: cc.Node = null;
@property(cc.Node)
public label_title: cc.Node = null;
@property(cc.Node) @property(cc.Node)
public btn_voice: cc.Node = null; public btn_voice: cc.Node = null;
updateLayer(layer, data) { updateLayer(layer, data) {
let img = pg.view.find(layer, 'img');
// 根据数据来渲染 // 根据数据来渲染
let img = pg.view.find(layer, 'img');
img.active = true; img.active = true;
// 需要根据图片设定的类型来动态的识别对应的图片大小 和不同的背景图
pg.view.setNetImg(img, data.image, { w: 1330, h: 655 }) pg.view.setNetImg(img, data.image, { w: 1330, h: 655 })
} }
onTouchVoice(e) { onTouchVoice(e) {
if (this.voiceTouchForbid) return; if (this.voiceTouchForbid) return;
......
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