Commit f3824d68 authored by 李维's avatar 李维

dev done

parent f3e33862
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="5" nzFor="item.text_main">正确选项</nz-form-label> <nz-form-label [nzSpan]="5" nzFor="item.text_main">正确选项</nz-form-label>
<nz-form-control [nzSpan]="10"> <nz-form-control [nzSpan]="10">
<nz-select [(ngModel)]="item.rightSide"> <nz-select [(ngModel)]="item.rightSide" (ngModelChange)="saveItem()">
<nz-option nzValue="left" nzLabel="左选项" default></nz-option> <nz-option nzValue="left" nzLabel="左选项" default></nz-option>
<nz-option nzValue="right" nzLabel="右选项"></nz-option> <nz-option nzValue="right" nzLabel="右选项"></nz-option>
</nz-select> </nz-select>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
<td> <td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()"> <nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="#363333" nzLabel="灰色"></nz-option> <nz-option nzValue="#363333" nzLabel="灰色"></nz-option>
<nz-option nzValue="#c8161d" nzLabel="红色"></nz-option> <nz-option nzValue="#c8161e" nzLabel="红色"></nz-option>
</nz-select> </nz-select>
</td> </td>
</tr> </tr>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<td> <td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()"> <nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="#363333" nzLabel="灰色"></nz-option> <nz-option nzValue="#363333" nzLabel="灰色"></nz-option>
<nz-option nzValue="#c8161d" nzLabel="红色"></nz-option> <nz-option nzValue="#c8161e" nzLabel="红色"></nz-option>
</nz-select> </nz-select>
</td> </td>
</tr> </tr>
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
<td> <td>
<nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()"> <nz-select [(ngModel)]="data.letter_color" (ngModelChange)="saveItem()">
<nz-option nzValue="#363333" nzLabel="灰色"></nz-option> <nz-option nzValue="#363333" nzLabel="灰色"></nz-option>
<nz-option nzValue="#c8161d" nzLabel="红色"></nz-option> <nz-option nzValue="#c8161e" nzLabel="红色"></nz-option>
</nz-select> </nz-select>
</td> </td>
</tr> </tr>
......
...@@ -105,6 +105,11 @@ ...@@ -105,6 +105,11 @@
font-family: 'FuturaBT Medium'; font-family: 'FuturaBT Medium';
src: url("../../assets/play/font/FuturaBT Medium.ttf") ; src: url("../../assets/play/font/FuturaBT Medium.ttf") ;
} }
@font-face{
font-family: 'Century Gothic Bold';
src: url("../../assets/play/font/Century Gothic Bold.ttf") ;
}
// @font-face{ // @font-face{
// font-family: 'FuturaStd-Medium'; // font-family: 'FuturaStd-Medium';
// src: url("../../assets/play/font/FuturaStd-Medium.otf") ; // src: url("../../assets/play/font/FuturaStd-Medium.otf") ;
......
...@@ -180,6 +180,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -180,6 +180,7 @@ export class PlayComponent implements OnInit, OnDestroy {
contentObj.long_audio.audio_url && array.push(contentObj.long_audio.audio_url) contentObj.long_audio.audio_url && array.push(contentObj.long_audio.audio_url)
contentObj.title.mainTextAudio_url && array.push(contentObj.title.mainTextAudio_url) contentObj.title.mainTextAudio_url && array.push(contentObj.title.mainTextAudio_url)
contentObj.dataArray.forEach(element => { contentObj.dataArray.forEach(element => {
element.audio_url_main && array.push(element.audio_url_main)
element.audio_url_left && array.push(element.audio_url_left) element.audio_url_left && array.push(element.audio_url_left)
element.audio_url_right && array.push(element.audio_url_right) element.audio_url_right && array.push(element.audio_url_right)
}); });
...@@ -378,7 +379,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -378,7 +379,7 @@ export class PlayComponent implements OnInit, OnDestroy {
textMainContainer.ref.alpha = 0; textMainContainer.ref.alpha = 0;
let baseX = 0; let baseX = 0;
for(let wi=0; wi<dataItem.letters_main.length; wi++) { for(let wi=0; wi<dataItem.letters_main.length; wi++) {
let letter = this.g_cartoon.createLabel(dataItem.letters_main[wi].letter_val, "FuturaBT-Bold", dataItem.letters_main[wi].letter_color, 48 * 1, baseX, 50, "left") let letter = this.g_cartoon.createLabel(dataItem.letters_main[wi].letter_val, "Century Gothic Bold", dataItem.letters_main[wi].letter_color, 48 * 1, baseX, 50, "left")
let bd = letter.getBoundingBox(); let bd = letter.getBoundingBox();
baseX += bd.width + 1 baseX += bd.width + 1
textMainContainer.ref.addChild(letter) textMainContainer.ref.addChild(letter)
...@@ -388,28 +389,36 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -388,28 +389,36 @@ export class PlayComponent implements OnInit, OnDestroy {
textMainContainer.ref.y = pos[len].textMain.y - 50; textMainContainer.ref.y = pos[len].textMain.y - 50;
let textLeftContainer = this.g_cartoon.createCartoonElementShapeRect(`popup-text-back-left-${i}-container`, 386, 100, "#FFFF00"); let textLeftContainer = this.g_cartoon.createCartoonElementShapeRect(`popup-text-back-left-${i}-container`, 386, 100, "#FFFF00");
let lettersLeft = []
bgCard.ref.addChild(textLeftContainer.ref); bgCard.ref.addChild(textLeftContainer.ref);
textLeftContainer.ref.alpha = 0; textLeftContainer.ref.alpha = 0;
baseX = 0; baseX = 0;
for(let wi=0; wi<dataItem.letters_left.length; wi++) { for(let wi=0; wi<dataItem.letters_left.length; wi++) {
let letter = this.g_cartoon.createLabel(dataItem.letters_left[wi].letter_val, "FuturaBT-Bold", dataItem.letters_left[wi].letter_color, 42 * 1, baseX, 50, "left") let letter = this.g_cartoon.createLabel(dataItem.letters_left[wi].letter_val, "FuturaBT-Bold", "#363333", 42 * 1, baseX, 50, "left")
let bd = letter.getBoundingBox(); let bd = letter.getBoundingBox();
baseX += bd.width + 1 baseX += bd.width + 1
textLeftContainer.ref.addChild(letter) textLeftContainer.ref.addChild(letter);
if(dataItem.letters_left[wi].letter_color=="#c8161e") {
lettersLeft.push(letter)
}
} }
textLeftContainer.ref.width = baseX; textLeftContainer.ref.width = baseX;
textLeftContainer.ref.x = pos[len].textLeft.x - baseX / 2; textLeftContainer.ref.x = pos[len].textLeft.x - baseX / 2;
textLeftContainer.ref.y = pos[len].textLeft.y - 50; textLeftContainer.ref.y = pos[len].textLeft.y - 50;
let textRightContainer = this.g_cartoon.createCartoonElementShapeRect(`popup-text-back-right-${i}-container`, 386, 100, "#FFFF00"); let textRightContainer = this.g_cartoon.createCartoonElementShapeRect(`popup-text-back-right-${i}-container`, 386, 100, "#FFFF00");
let lettersRight = []
bgCard.ref.addChild(textRightContainer.ref); bgCard.ref.addChild(textRightContainer.ref);
textRightContainer.ref.alpha = 0; textRightContainer.ref.alpha = 0;
baseX = 0; baseX = 0;
for(let wi=0; wi<dataItem.letters_right.length; wi++) { for(let wi=0; wi<dataItem.letters_right.length; wi++) {
let letter = this.g_cartoon.createLabel(dataItem.letters_right[wi].letter_val, "FuturaBT-Bold", dataItem.letters_right[wi].letter_color, 42 * 1, baseX, 50, "left") let letter = this.g_cartoon.createLabel(dataItem.letters_right[wi].letter_val, "FuturaBT-Bold", "#363333", 42 * 1, baseX, 50, "left")
let bd = letter.getBoundingBox(); let bd = letter.getBoundingBox();
baseX += bd.width + 1 baseX += bd.width + 1
textRightContainer.ref.addChild(letter) textRightContainer.ref.addChild(letter)
if(dataItem.letters_right[wi].letter_color=="#c8161e") {
lettersRight.push(letter)
}
} }
textRightContainer.ref.width = baseX; textRightContainer.ref.width = baseX;
textRightContainer.ref.x = pos[len].textRight.x - baseX / 2; textRightContainer.ref.x = pos[len].textRight.x - baseX / 2;
...@@ -513,27 +522,79 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -513,27 +522,79 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
this.subscribeMapDownEvent(textMainContainer.id, ()=>{
if(dataItem.audio_url_main) {
this.g_cartoon.playAudio(dataItem.audio_url_main, false, ()=>{
this.g_enableMapDown = true;
})
} else {
this.g_enableMapDown = true;
}
})
this.subscribeMapDownEvent(textLeftContainer.id, ()=>{
if(dataItem.audio_url_left) {
this.g_cartoon.playAudio(dataItem.audio_url_left, false, ()=>{
this.g_enableMapDown = true;
})
} else {
this.g_enableMapDown = true;
}
})
this.subscribeMapDownEvent(textRightContainer.id, ()=>{
if(dataItem.audio_url_right) {
this.g_cartoon.playAudio(dataItem.audio_url_right, false, ()=>{
this.g_enableMapDown = true;
})
} else {
this.g_enableMapDown = true;
}
})
bgCard.selected = false; bgCard.selected = false;
this.subscribeMapDownEvent(targetRight.id, ()=>{ this.subscribeMapDownEvent(radioButtonRight_out.id, ()=>{
if(!bgCard.selected) { if(!bgCard.selected) {
bgCard.switchSelect("right") bgCard.switchSelect("right")
if(dataItem.rightSide == "right") { if(dataItem.rightSide == "right") {
this.g_cartoon.playAudio("sm-correct", false, ()=>{
this.g_enableMapDown = true;
})
circleRight.ref.alpha = 255; circleRight.ref.alpha = 255;
lettersRight.forEach(le=>{
le.fontColor = "#c8161e"
})
bgCard.selected = true; bgCard.selected = true;
} else {
this.g_cartoon.playAudio("sm-wrong", false, ()=>{
this.g_enableMapDown = true;
})
} }
} else {
this.g_enableMapDown = true;
} }
this.g_enableMapDown = true;
}) })
this.subscribeMapDownEvent(targetLeft.id, ()=>{ this.subscribeMapDownEvent(radioButtonLeft_out.id, ()=>{
if(!bgCard.selected) { if(!bgCard.selected) {
bgCard.switchSelect("left") bgCard.switchSelect("left")
if(dataItem.rightSide == "left") { if(dataItem.rightSide == "left") {
this.g_cartoon.playAudio("sm-correct", false, ()=>{
this.g_enableMapDown = true;
})
circleLeft.ref.alpha = 255; circleLeft.ref.alpha = 255;
lettersLeft.forEach(le=>{
le.fontColor = "#c8161e"
})
bgCard.selected = true; bgCard.selected = true;
} else {
this.g_cartoon.playAudio("sm-wrong", false, ()=>{
this.g_enableMapDown = true;
})
} }
} else {
this.g_enableMapDown = true;
} }
this.g_enableMapDown = true;
}) })
cardContainer.ref.addChild(bgCard.ref) cardContainer.ref.addChild(bgCard.ref)
......
This diff is collapsed.
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