Commit b37c7339 authored by 李维's avatar 李维

dev commit

parent 3fe625cf
...@@ -87,8 +87,8 @@ ...@@ -87,8 +87,8 @@
文字 文字
</div> </div>
<div style="flex:5"> <div style="flex:5">
<!-- <input type="text" nz-input placeholder="" [(ngModel)]="contentObj.dataArray[i]" (blur)="saveItem()" style="width: 250px;" /> --> <input type="text" nz-input placeholder="" [(ngModel)]="item.text" (blur)="saveItem()" style="width: 250px;" />
<input type="text" nz-input placeholder="" [(ngModel)]="contentObj.dataArray[i].text" (blur)="handleTextChange($event, i)" style="width: 250px;" /> <!-- <input type="text" nz-input placeholder="" [(ngModel)]="contentObj.dataArray[i].text" (blur)="handleTextChange($event, i)" style="width: 250px;" /> -->
</div> </div>
</div> </div>
</div> </div>
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
图片 图片
</div> </div>
<div style="flex:5"> <div style="flex:5">
<app-upload-image-with-preview style="width: 100%;" [picUrl]="item.image_url" (imageUploaded)="onImageUploadSuccessByItem($event, contentObj.dataArray, i)"></app-upload-image-with-preview> <app-upload-image-with-preview style="width: 100%;" [picUrl]="item.image_url" (imageUploaded)="onImageUploadSuccessByItem($event, item, 'image_url')"></app-upload-image-with-preview>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -150,12 +150,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -150,12 +150,12 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
addItem(item?, type?) { addItem(item?, type?) {
item.push("") item.push({text: "", image_url: ""})
this.saveItem(); this.saveItem();
} }
onImageUploadSuccessByItem(e, item, key) { onImageUploadSuccessByItem(e, item, key) {
this.contentObj.dataArray[key].image_url = e.url item[key] = e.url
this,this.refresh() this,this.refresh()
this.save(); this.save();
} }
......
...@@ -235,6 +235,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -235,6 +235,13 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
endGame(){ endGame(){
let audioPlayer = this.g_cartoon.getCartoonElement("bg-short-audio")
if(audioPlayer.isPlaying){
audioPlayer.playIcon.ref.visible = true
audioPlayer.pauseIcon.ref.visible = false
audioPlayer.audio.pause()
audioPlayer.isPlaying = !audioPlayer.isPlaying
}
this.showEndPatal(); this.showEndPatal();
this.clapHand(); this.clapHand();
this.g_cartoon.playAudio("sm-choice-complete", false, ()=>{ this.g_cartoon.playAudio("sm-choice-complete", false, ()=>{
...@@ -855,18 +862,20 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -855,18 +862,20 @@ export class PlayComponent implements OnInit, OnDestroy {
time = audio.duration time = audio.duration
} }
let endTime = Math.floor(time / 60) let endTime = Math.floor(time / 60)
console.log(time, time / 60, time % 60)
let timeString = "" let timeString = ""
if(endTime<9){ if(endTime<9){
timeString = "0" + endTime timeString = "0" + endTime
}else{ }else{
timeString + endTime + "" timeString + endTime + ""
} }
if(time % 60<9){ if(time % 60<9){
timeString = timeString + ":0" + (time % 60 + "").substring(0, 2) timeString = timeString + ":0" + (Math.ceil(time % 60) + "").substring(0, 2)
}else{ }else{
timeString = timeString + ":" + (time % 60 + "").substring(0, 2) timeString = timeString + ":" + (Math.ceil(time % 60) + "").substring(0, 2)
} }
console.log(timeString)
let timeStart = this.g_cartoon.createCartoonElementLabel("audio-player-start", "00:00", "BRLNSR_1", "#FFFFFF", 34) let timeStart = this.g_cartoon.createCartoonElementLabel("audio-player-start", "00:00", "BRLNSR_1", "#FFFFFF", 34)
timeStart.ref.x = -(476/2) + 30 timeStart.ref.x = -(476/2) + 30
timeStart.ref.y = 40 timeStart.ref.y = 40
...@@ -1028,18 +1037,18 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1028,18 +1037,18 @@ export class PlayComponent implements OnInit, OnDestroy {
let audioType = "L" let audioType = "L"
let element = this.g_cartoon.createCartoonElementImageFunc("bg-short-audio", "bg_laba", (w, h)=>{ let element = this.g_cartoon.createCartoonElementImageFunc("bg-short-audio", "bg_laba", (w, h)=>{
return{ return{
sx: 474 * this.g_mapScale / w, sx: 693 * this.g_mapScale / w,
sy: 98 * this.g_mapScale / h sy: 100 * this.g_mapScale / h
} }
}, (w, h)=>{ }, (w, h)=>{
let x = 0; let x = 0;
let y = 0 let y = 0
if(this.g_formData.question.type == "LongAudio"){ if(this.g_formData.question.type == "LongAudio"){
x = -235 x = -125
y = -45 y = -45
}else{ }else{
audioType = "S" audioType = "S"
x = 20 x = 80
} }
return{ return{
x: this.g_cartoon.getOrigin().x + (1280 + x) * this.g_mapScale, x: this.g_cartoon.getOrigin().x + (1280 + x) * this.g_mapScale,
...@@ -1047,17 +1056,32 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1047,17 +1056,32 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}) })
element.audioType = audioType element.audioType = audioType
element.playIcon = this.g_cartoon.createCartoonElementImageFunc("btn-audio-play", "btn_videooff", (w, h)=>{ if(element.audioType=="S"){
return{ element.playIcon = this.g_cartoon.createCartoonElementImageFunc("btn-audio-play", "btn_laba (3)", (w, h)=>{
sx: 91 / w, return{
sy: 90 / h sx: 136 / w,
} sy: 116 / h
}, (w, h)=>{ }
return{ }, (w, h)=>{
x: -140, return{
y: -80 x: -250,
} y: -80
}) }
})
}else{
element.playIcon = this.g_cartoon.createCartoonElementImageFunc("btn-audio-play", "btn_videooff", (w, h)=>{
return{
sx: 91 / w,
sy: 90 / h
}
}, (w, h)=>{
return{
x: -250,
y: -80
}
})
}
element.pauseIcon = this.g_cartoon.createCartoonElementImageFunc("btn-audio-pause", "btn_videoon", (w, h)=>{ element.pauseIcon = this.g_cartoon.createCartoonElementImageFunc("btn-audio-pause", "btn_videoon", (w, h)=>{
return{ return{
sx: 91 / w, sx: 91 / w,
...@@ -1065,7 +1089,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1065,7 +1089,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
}, (w, h)=>{ }, (w, h)=>{
return{ return{
x: -140, x: -250,
y: -80 y: -80
} }
}) })
...@@ -1101,7 +1125,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1101,7 +1125,7 @@ export class PlayComponent implements OnInit, OnDestroy {
element.starAni = this.g_cartoon.createAnimation("btn_laba", 3, 500) element.starAni = this.g_cartoon.createAnimation("btn_laba", 3, 500)
element.starAni.loop = true; element.starAni.loop = true;
element.starAni.setScaleXY(this.g_mapScale) element.starAni.setScaleXY(this.g_mapScale)
element.starAni.x = element.ref.x -140 * this.g_mapScale element.starAni.x = element.ref.x -250 * this.g_mapScale
element.starAni.y = element.ref.y -80 * this.g_mapScale element.starAni.y = element.ref.y -80 * this.g_mapScale
this.render(element.starAni, zIndexMap.animation) this.render(element.starAni, zIndexMap.animation)
element.starAni.play() element.starAni.play()
...@@ -1905,8 +1929,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1905,8 +1929,9 @@ export class PlayComponent implements OnInit, OnDestroy {
}); });
totlaWidth += (elementArray.length-1) * spacing totlaWidth += (elementArray.length-1) * spacing
let laseX = this.g_canvasWidth / 2 - totlaWidth/2; let laseX = this.g_canvasWidth / 2 - totlaWidth/2;
let baseY= 0;
elementArray.forEach((element, index) => { elementArray.forEach((element, index) => {
let bd = element.ref.getBoundingBox() let bd = element.ref.getBoundingBox();
if(withAni){ if(withAni){
tweenChange(element.ref, {x: laseX + bd.width / 2}, 0.2, ()=>{ tweenChange(element.ref, {x: laseX + bd.width / 2}, 0.2, ()=>{
this.g_cartoon.saveSize(element.id) this.g_cartoon.saveSize(element.id)
......
src/assets/play/bg_laba.png

18.6 KB | W: | H:

src/assets/play/bg_laba.png

15 KB | W: | H:

src/assets/play/bg_laba.png
src/assets/play/bg_laba.png
src/assets/play/bg_laba.png
src/assets/play/bg_laba.png
  • 2-up
  • Swipe
  • Onion skin
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