Commit a65352ba authored by 李维's avatar 李维

Almost completed form page

parent 4d304e3f
...@@ -437,10 +437,10 @@ export class HotZoneImageItem extends MySprite { ...@@ -437,10 +437,10 @@ export class HotZoneImageItem extends MySprite {
arrowRight; arrowRight;
init(image_url = null, text?, type?, callback?, handleSave?){ init(image_url = null, text?, type?, callback?, handleSave?){
let change = true; // let change = true;
if(type == this.type){ // if(type == this.type){
change = false // change = false
} // }
if(type && type=="Text"){ if(type && type=="Text"){
image_url = "assets/default/images/bg_50_50.png"; image_url = "assets/default/images/bg_50_50.png";
...@@ -475,9 +475,9 @@ export class HotZoneImageItem extends MySprite { ...@@ -475,9 +475,9 @@ export class HotZoneImageItem extends MySprite {
} }
this.drawArrow() this.drawArrow()
} }
if(change){ // if(change){
this.showLineDash() this.showLineDash()
} // }
}) })
} }
......
<div class="p-image-children-editor"> <div class="p-image-children-editor">
<div style="float: left; width: 60%;border-right: 2px solid #ddd; border-bottom: 2px solid #ddd;"> <div style="float: left; width: 20%; border-right: 2px solid #ddd;" class="clearfix">
<h5 style="margin-left: 2.5%;">预览:</h5> <div nzAlign="middle" style="border-bottom: 2px solid #DDD;">
<div id="canvas-container" style="margin:5px;"> <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
<div class="preview-box" #wrap style="margin-bottom: 20px"> <div style="float: left;">
<canvas id="canvas" #canvas></canvas> <h3>音频素材</h3>
<app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem, null)" > </app-audio-recorder>
</div>
</div> </div>
</div> </div>
<div style="text-align: center"> <div nzAlign="middle">
<button nz-button nzType="primary" [nzSize]="'small'" nzShape="round" (click)="saveClick()" <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
[disabled]="!hotZoneChanged"> <div style="position: relative; margin-bottom: 5px;">
<i nz-icon type="save"></i> <h3>左侧单词</h3>
Save <div style="display: flex; ">
</button> <div style="flex: 1">
</div> 音频
</div>
<h5 style="border-top: 2px solid #ddd;">背景图:</h5> <div style="flex: 4">
<div style="width: 200px;margin: auto;"> <app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.wordLeft_audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem, 'wordLeft_audio_url')" > </app-audio-recorder>
<div class="bg-box"> </div>
<app-upload-image-with-preview [picUrl]="bgItem.url" (imageUploaded)="onBackgroundUploadSuccess($event)"> </div>
</app-upload-image-with-preview> </div>
<div style="position: relative;">
<div style="display: flex; ">
<div style="flex: 1">
文字
</div>
<div style="flex: 4">
<input type="text" nz-input placeholder="" [(ngModel)]="bgItem.wordLeft_text" (blur)="autoSave()" />
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> <div nzAlign="middle" style="border-bottom: 2px solid #DDD;">
<div style="float: left; width: 40%">
<div nzAlign="middle">
<div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;"> <div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
<div style="float: left;"> <div style="position: relative; margin-bottom: 5px;">
<h3>音频素材</h3> <h3>右侧单词</h3>
<app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem)" > </app-audio-recorder> <div style="display: flex; ">
<div style="flex: 1">
音频
</div>
<div style="flex: 4">
<app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.wordRight_audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem, 'wordRight_audio_url')" > </app-audio-recorder>
</div>
</div>
</div>
<div style="position: relative;">
<div style="display: flex; ">
<div style="flex: 1">
文字
</div>
<div style="flex: 4">
<input type="text" nz-input placeholder="" [(ngModel)]="bgItem.wordRight_text" (blur)="autoSave()" />
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
<div nzAlign="middle">
<div nzAlign="middle" class="clearfix">
<div class="img-box clearfix" *ngFor="let it of hotZoneArr; let i = index" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;"> <div class="img-box clearfix" *ngFor="let it of hotZoneArr; let i = index" style="border-bottom: 1px solid #DDD; padding-bottom: 10px;">
<div style="height: 115px; position: relative; width: 250px; "> <div style="position: relative; margin-bottom: 5px;">
<h3> 选区-{{ i + 1 }}</h3> <h3>选区-{{ i + 1 }}</h3>
<div style="display: flex; "> <div style="display: flex; ">
<div style="flex:2"> <div style="flex: 1">
选区音效 音频
</div> </div>
<div style="flex:4"> <div style="flex: 4">
<app-audio-recorder id="index_audio_1" [audioUrl]="bgItem.audio_url" (audioUploaded)="onAudioUploadSuccess($event, bgItem)" > </app-audio-recorder> <app-audio-recorder id="index_audio_1" [audioUrl]="it.audio_url" (audioUploaded)="onAudioUploadSuccess($event, it, null)" > </app-audio-recorder>
</div> </div>
</div> </div>
</div> </div>
<div style="position: relative; width: 250px; "> <div style="position: relative; margin-bottom: 5px;">
<div style="display: flex; "> <div style="display: flex; ">
<div style="flex:2"> <div style="flex: 1">
文字 文字
</div> </div>
<div style="flex:4"> <div style="flex: 4">
<input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="refreshHotZoneText(it);autoSave()" /> <input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="autoSave()" />
</div> </div>
</div> </div>
</div> </div>
<div style="position: relative;">
<button style="float: right; margin-bottom: 5px;" nz-button nzType="danger" (click)="deleteItem($event, i)">
<i nz-icon nzType="delete" nzTheme="outline"></i>
删除
</button>
</div>
<div style="float: right; display: flex; padding-left: 10px;"> <div style="float: right; display: flex; padding-left: 10px;">
<!-- <button style="flex:1; margin-bottom: 5px;" nz-button nzType="dashed" (click)="handleMoveItemUp($event, i)" <!-- <button style="flex:1; margin-bottom: 5px;" nz-button nzType="dashed" (click)="handleMoveItemUp($event, i)"
...@@ -68,11 +101,11 @@ ...@@ -68,11 +101,11 @@
[disabled]="i==hotZoneArr.length-1"> [disabled]="i==hotZoneArr.length-1">
<i nz-icon nzType="down" nzTheme="outline"></i> <i nz-icon nzType="down" nzTheme="outline"></i>
下移 下移
</button> --> </button>
<button style="flex:1; margin-bottom: 5px;" nz-button nzType="danger" (click)="deleteItem($event, i)"> <button style="flex:1; margin-bottom: 5px;" nz-button nzType="danger" (click)="deleteItem($event, i)">
<i nz-icon nzType="delete" nzTheme="outline"></i> <i nz-icon nzType="delete" nzTheme="outline"></i>
删除 删除
</button> </button> -->
</div> </div>
</div> </div>
<div nz-col nzSpan="5" nzOffset="1"> <div nz-col nzSpan="5" nzOffset="1">
...@@ -85,7 +118,98 @@ ...@@ -85,7 +118,98 @@
</div> </div>
</div> </div>
</div> </div>
<nz-divider></nz-divider>
<div class="save-box"> <div style="float: left; width: 80%; border-bottom: 2px solid #ddd;">
<h5 style="margin-left: 2.5%;">预览:</h5>
<div id="canvas-container" style="margin:5px;">
<div class="preview-box" #wrap style="margin-bottom: 20px">
<canvas id="canvas" #canvas></canvas>
</div>
</div>
<div style="text-align: center">
<button nz-button nzType="primary" [nzSize]="'small'" nzShape="round" (click)="saveClick()"
[disabled]="!hotZoneChanged">
<i nz-icon type="save"></i>
Save
</button>
</div>
<h5 style="border-top: 2px solid #ddd;">背景图:</h5>
<div style="width: 200px;margin: auto;">
<div class="bg-box">
<app-upload-image-with-preview [picUrl]="bgItem.url" (imageUploaded)="onBackgroundUploadSuccess($event)">
</app-upload-image-with-preview>
</div>
</div>
<div style="border-bottom: 2px solid #DDD;"></div>
<h3>题目配置</h3>
<div nzAlign="middle" *ngFor="let item of bgItem.questions; let QI = index">
<div class="img-box clearfix" style="border-bottom: 1px solid #DDD; padding-bottom: 10px; ">
<div>
<div style="float: left; margin-right: 10px;">
<div>No.</div>
<div style="height: 32px; padding: 5px 10px;">
{{QI+1}}
</div>
</div>
<div style="float: left; margin-right: 10px;">
<div>组合数</div>
<div style="float: left;">
<nz-input-number [(ngModel)]="item.number" [nzMin]="1" [nzMax]="5" [nzStep]="1" (ngModelChange)="handleCombinLength(item)"></nz-input-number>
</div>
</div>
<div style="float: left; margin-left: 10px;">
<div>组合</div>
<div>
<nz-select *ngFor="let part of item.combin; let i = index" [(ngModel)]="item.combin[i]" style="float: left; margin-right: 5px;" (ngModelChange)="handlePartChange($event, item, i)">
<nz-option nzValue="-1" [nzLabel]="'L-' + bgItem.wordLeft_text"></nz-option>
<nz-option nzValue="-2" [nzLabel]="'R-' + bgItem.wordRight_text"></nz-option>
<nz-option *ngFor="let hot of hotZoneArr; let j = index;" [nzValue]="j" [nzLabel]="(j + 1) + '-' + hot.text"></nz-option>
</nz-select>
</div>
</div>
<div style="float: left; margin-left: 10px;">
<div>预览</div>
<div style="background-color: #ccc; height: 32px; padding: 5px 10px;">
{{getQuestionWord(item.combin)}}
</div>
</div>
<div style="float: left; margin-left: 20px;">
<div>发音</div>
<div>
<app-audio-recorder id="index_audio_1" [audioUrl]="item.audio_url" (audioUploaded)="onAudioUploadSuccess($event, item, null)" > </app-audio-recorder>
</div>
</div>
<div style="float: right;">
<div>题序/删除</div>
<div>
<button style="flex:1; margin-bottom: 5px;" nz-button nzType="dashed" (click)="handleMoveItemUp($event, QI)"
[disabled]="QI==0">
<i nz-icon nzType="up" nzTheme="outline"></i>
上移
</button>
<button style="flex:1; margin-bottom: 5px;" nz-button nzType="dashed" (click)="handleMoveItemDown($event, QI)"
[disabled]="QI==bgItem.questions.length-1">
<i nz-icon nzType="down" nzTheme="outline"></i>
下移
</button>
<button style="flex:1; margin-bottom: 5px;" nz-button nzType="danger" (click)="deleteQuestionItem($event, QI)">
<i nz-icon nzType="delete" nzTheme="outline"></i>
删除
</button>
</div>
</div>
</div>
</div>
</div>
<div style="padding-left: 10px; padding-bottom: 10px;">
<button nz-button nzType="dashed" (click)="addQustion()" [disabled]="bgItem.questions.length==8">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加题目
</button>
</div>
</div> </div>
<nz-divider></nz-divider>
</div> </div>
\ No newline at end of file
...@@ -72,6 +72,9 @@ h5 { ...@@ -72,6 +72,9 @@ h5 {
margin-top: 1rem; margin-top: 1rem;
} }
nz-select {
min-width: 80px;
}
//@import '../../../style/common_mixin'; //@import '../../../style/common_mixin';
// //
//.p-image-uploader { //.p-image-uploader {
......
...@@ -26,20 +26,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -26,20 +26,10 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
return this._bgItem; return this._bgItem;
} }
@Input() @Input() imgItemArr = null;
imgItemArr = null; @Input() hotZoneItemArr = null;
@Input() hotZoneArr = null;
@Input() @Output() save = new EventEmitter();
hotZoneItemArr = null;
@Input()
hotZoneArr = null;
@Output()
save = new EventEmitter();
@ViewChild('canvas') canvas: ElementRef; @ViewChild('canvas') canvas: ElementRef;
@ViewChild('wrap') wrap: ElementRef; @ViewChild('wrap') wrap: ElementRef;
...@@ -137,23 +127,24 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -137,23 +127,24 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
const item = this.getHotZoneItem(); const item = this.getHotZoneItem();
this.hotZoneArr.push(item); this.hotZoneArr.push(item);
this.refreshHotZoneId(); this.refreshHotZoneId();
this.refreshIndexNumber()
this.autoSave() this.autoSave()
} }
handleMoveItemUp(event, index) { handleMoveItemUp(event, index) {
if (index != 0) { if (index != 0) {
this.hotZoneArr[index] = this.hotZoneArr.splice(index - 1, 1, this.hotZoneArr[index])[0]; this.bgItem.questions[index] = this.bgItem.questions.splice(index - 1, 1, this.bgItem.questions[index])[0];
} else { } else {
this.hotZoneArr.push(this.hotZoneArr.shift()); this.bgItem.questions.push(this.bgItem.questions.shift());
} }
this.autoSave() this.autoSave()
} }
handleMoveItemDown(event, index) { handleMoveItemDown(event, index) {
if (index != this.hotZoneArr.length - 1) { if (index != this.bgItem.questions.length - 1) {
this.hotZoneArr[index] = this.hotZoneArr.splice(index + 1, 1, this.hotZoneArr[index])[0]; this.bgItem.questions[index] = this.bgItem.questions.splice(index + 1, 1, this.bgItem.questions[index])[0];
} else { } else {
this.hotZoneArr.unshift(this.hotZoneArr.splice(index, 1)[0]); this.bgItem.questions.unshift(this.bgItem.questions.splice(index, 1)[0]);
} }
this.autoSave() this.autoSave()
} }
...@@ -168,8 +159,13 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -168,8 +159,13 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.autoSave() this.autoSave()
} }
onAudioUploadSuccess(e, item) { onAudioUploadSuccess(e, item, key) {
item.audio_url = e.url; if(key) {
item.audio_url = e.url;
} else {
item[key] = e.url;
}
this.autoSave() this.autoSave()
} }
...@@ -213,8 +209,9 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -213,8 +209,9 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
// item.image_url = saveData.media.image_url // item.image_url = saveData.media.image_url
// item.text = saveData.media.text // item.text = saveData.media.text
// item.type = saveData.media.type // item.type = saveData.media.type
item.audio_url = saveData.media.audio_url?saveData.media.audio_url:""
item.image_url = "assets/play/bg_70_40.png" item.image_url = "assets/play/bg_70_40.png"
item.text = "" // item.text = ""
item.type = "Image" item.type = "Image"
} else { } else {
item.init("assets/play/bg_70_40.png", null, "Image", () => { item.init("assets/play/bg_70_40.png", null, "Image", () => {
...@@ -224,12 +221,21 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -224,12 +221,21 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
item.y = this.canvasHeight / 2 - 20; item.y = this.canvasHeight / 2 - 20;
}, () => this.autoSave()); }, () => this.autoSave());
} }
item.text = item.text?item.text:""
item.anchorX = 0.5; item.anchorX = 0.5;
item.anchorY = 0.5; item.anchorY = 0.5;
return item; return item;
} }
refreshIndexNumber() {
this.hotZoneArr.forEach((element: HotZoneImageItem, index) => {
element.init(`assets/play/hotZooCard/bg_70_40_${index+1}.png`, element.text, "Image", ()=>{
})
}, () => this.autoSave());
// this.autoSave()
}
getPicItem(img, saveData = null) { getPicItem(img, saveData = null) {
const item = new EditorItem(this.ctx); const item = new EditorItem(this.ctx);
...@@ -265,8 +271,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -265,8 +271,8 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
} }
onAudioUploadSuccessByImg(e, img) { onAudioUploadSuccessByImg(e, item) {
img.audio_url = e.url; item.audio_url = e.url;
this.autoSave() this.autoSave()
} }
...@@ -275,6 +281,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -275,6 +281,12 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshHotZoneId(); this.refreshHotZoneId();
this.autoSave() this.autoSave()
} }
deleteQuestionItem(e, i) {
this.bgItem.questions.splice(i, 1);
// this.refreshHotZoneId();
this.autoSave()
}
init() { init() {
this.initData(); this.initData();
...@@ -284,8 +296,11 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -284,8 +296,11 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
initItem() { initItem() {
if (!this.bgItem) { if (!this.bgItem) {
this.bgItem = {}; this.bgItem = { };
} else { } else {
if(!this.bgItem.questions) {
this.bgItem.questions = []
}
this.refreshBackground(() => { this.refreshBackground(() => {
if (!this.hotZoneItemArr) { if (!this.hotZoneItemArr) {
this.hotZoneItemArr = []; this.hotZoneItemArr = [];
...@@ -325,6 +340,30 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -325,6 +340,30 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshHotZoneId(); this.refreshHotZoneId();
} }
addQustion() {
this.bgItem.questions.push({
number: 2,
combin: [0,0]
})
}
handleCombinLength(item) {
if(Number(item.number)>5){
return
}
if( Number(item.number) > item.combin.length ) {
let num = Number(item.number) - item.combin.length
for(var index=0; index<num; index++) {
item.combin.push(0)
}
} else {
item.combin = item.combin.splice(0, Number(item.number))
}
this.autoSave()
console.log(item.combin)
}
initImgArr() { initImgArr() {
let curBgRect; let curBgRect;
if (this.bg) { if (this.bg) {
...@@ -361,6 +400,19 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -361,6 +400,19 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
this.refreshImageId(); this.refreshImageId();
} }
getQuestionWord(combin) {
let str = ""
combin.forEach(element => {
if(element == -1) {
str += this.bgItem.wordLeft_text?this.bgItem.wordLeft_text:"";
} else if(element == -2) {
str += this.bgItem.wordRight_text?this.bgItem.wordRight_text:"";
} else {
str += this.hotZoneArr[element] && this.hotZoneArr[element].text?this.hotZoneArr[element].text:"";
}
});
return str
}
initData() { initData() {
this.canvasWidth = this.wrap.nativeElement.clientWidth; this.canvasWidth = this.wrap.nativeElement.clientWidth;
...@@ -502,13 +554,16 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -502,13 +554,16 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
} }
changeCurItem(item) { changeCurItem(item) {
this.hideAllLineDash(); this.hideAllLineDash();
this.curItem = item; this.curItem = item;
this.curItem.showLineDash(); this.curItem.showLineDash();
} }
handlePartChange(e, item, index) {
item.combin[index] = e
console.log(item.combin, index)
}
hideAllLineDash() { hideAllLineDash() {
for (let i = 0; i < this.imgArr.length; i++) { for (let i = 0; i < this.imgArr.length; i++) {
if (this.imgArr[i].picItem) { if (this.imgArr[i].picItem) {
...@@ -690,7 +745,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges { ...@@ -690,7 +745,7 @@ export class CustomHotZoneComponent implements OnInit, OnDestroy, OnChanges {
hotZoneItem['media'].image_url = hotZoneArr[i].image_url hotZoneItem['media'].image_url = hotZoneArr[i].image_url
hotZoneItem['media'].text = hotZoneArr[i].text hotZoneItem['media'].text = hotZoneArr[i].text
hotZoneItem['media'].type = hotZoneArr[i].type hotZoneItem['media'].type = hotZoneArr[i].type
// hotZoneItem['media'].audio_url = hotZoneArr[i].audio_url ? hotZoneArr[i].audio_url : "" hotZoneItem['media'].audio_url = hotZoneArr[i].audio_url ? hotZoneArr[i].audio_url : ""
// hotZoneItem['media'].card_audio_url = hotZoneArr[i].card_audio_url ? hotZoneArr[i].card_audio_url : "" // hotZoneItem['media'].card_audio_url = hotZoneArr[i].card_audio_url ? hotZoneArr[i].card_audio_url : ""
hotZoneItemArr.push(hotZoneItem); hotZoneItemArr.push(hotZoneItem);
} }
......
...@@ -80,7 +80,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -80,7 +80,9 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (this.item.contentObj.bgItem) { if (this.item.contentObj.bgItem) {
this.bgItem = this.item.contentObj.bgItem; this.bgItem = this.item.contentObj.bgItem;
} else { } else {
this.bgItem = {} this.bgItem = {
url: 'assets/play/hotZooCard/defalut_bg.png'
}
this.item.contentObj.bgItem = this.bgItem; this.item.contentObj.bgItem = this.bgItem;
} }
} }
......
'bg_line': 'assets/play/bg_line.png', 'bg_70_40': 'assets/play/bg_70_40.png',
'bg_line_container': 'assets/play/bg_line_container.png',
'bg_sentence': 'assets/play/bg_sentence.png',
'bg_title_b': 'assets/play/bg_title_b.png',
'bg_title_c': 'assets/play/bg_title_c.png',
'bg_title_part': 'assets/play/bg_title_part.png',
'bg_white': 'assets/play/bg_white.png',
'creatJsonProfile': 'assets/play/creatJsonProfile.py', 'creatJsonProfile': 'assets/play/creatJsonProfile.py',
'filename': 'assets/play/filename.txt', 'filename': 'assets/play/filename.txt',
'hot-zoo-bg': 'assets/play/hot-zoo-bg.png',
'icon_audio_container': 'assets/play/icon_audio_container.png',
'icon_paly': 'assets/play/icon_paly.png',
'icon_pause': 'assets/play/icon_pause.png',
'resizeImg': 'assets/play/resizeImg.py', 'resizeImg': 'assets/play/resizeImg.py',
'icon_laba (1)': 'assets/play/frame/icon_laba (1).png', '1': 'assets/play/sound/1.mp3',
'icon_laba (2)': 'assets/play/frame/icon_laba (2).png', '2': 'assets/play/sound/2.mp3',
'icon_laba (3)': 'assets/play/frame/icon_laba (3).png', '3': 'assets/play/sound/3.mp3',
'icon_laba (4)': 'assets/play/frame/icon_laba (4).png', 'check': 'assets/play/sound/check.mp3',
'icon_labaxiao (1)': 'assets/play/frame/icon_labaxiao (1).png', 'fanye': 'assets/play/sound/fanye.mp3',
'icon_labaxiao (2)': 'assets/play/frame/icon_labaxiao (2).png', 'jifen': 'assets/play/sound/jifen.mp3',
'icon_labaxiao (3)': 'assets/play/frame/icon_labaxiao (3).png', 'kulian': 'assets/play/sound/kulian.mp3',
'putong': 'assets/play/sound/putong.mp3',
'correct': 'assets/play/sound/correct.mp3', 'start': 'assets/play/sound/start.mp3',
'fanhui': 'assets/play/sound/fanhui.mp3', 'xianshi': 'assets/play/sound/xianshi.mp3',
'shuibo': 'assets/play/sound/shuibo.mp3', 'xiaolian': 'assets/play/sound/xiaolian.mp3',
'xinyemian': 'assets/play/sound/xinyemian.mp3', 'xingxing': 'assets/play/sound/xingxing.mp3',
'yes': 'assets/play/sound/yes.mp3',
import os
import json
def file_name(file_dir):
fileList =["bg_kuang", "bg_kuang2", "bg_light"]
f = open('filename.txt', 'w');
blank = False
for root, dirs, files in os.walk(file_dir):
for fileName in files:
print(root.split("\\")[-1])
f.write("'" + fileName.split(".")[0] + "': 'assets/hotZooCard/" + root.split("\\")[-1] + "/" + fileName + "',\n")
f.close()
fileList = file_name(os.path.abspath('.'))
'bg_70_40_1': 'assets/hotZooCard/hotZooCard/bg_70_40_1.png',
'bg_70_40_10': 'assets/hotZooCard/hotZooCard/bg_70_40_10.png',
'bg_70_40_11': 'assets/hotZooCard/hotZooCard/bg_70_40_11.png',
'bg_70_40_12': 'assets/hotZooCard/hotZooCard/bg_70_40_12.png',
'bg_70_40_13': 'assets/hotZooCard/hotZooCard/bg_70_40_13.png',
'bg_70_40_14': 'assets/hotZooCard/hotZooCard/bg_70_40_14.png',
'bg_70_40_15': 'assets/hotZooCard/hotZooCard/bg_70_40_15.png',
'bg_70_40_16': 'assets/hotZooCard/hotZooCard/bg_70_40_16.png',
'bg_70_40_17': 'assets/hotZooCard/hotZooCard/bg_70_40_17.png',
'bg_70_40_18': 'assets/hotZooCard/hotZooCard/bg_70_40_18.png',
'bg_70_40_19': 'assets/hotZooCard/hotZooCard/bg_70_40_19.png',
'bg_70_40_2': 'assets/hotZooCard/hotZooCard/bg_70_40_2.png',
'bg_70_40_20': 'assets/hotZooCard/hotZooCard/bg_70_40_20.png',
'bg_70_40_21': 'assets/hotZooCard/hotZooCard/bg_70_40_21.png',
'bg_70_40_22': 'assets/hotZooCard/hotZooCard/bg_70_40_22.png',
'bg_70_40_23': 'assets/hotZooCard/hotZooCard/bg_70_40_23.png',
'bg_70_40_24': 'assets/hotZooCard/hotZooCard/bg_70_40_24.png',
'bg_70_40_25': 'assets/hotZooCard/hotZooCard/bg_70_40_25.png',
'bg_70_40_3': 'assets/hotZooCard/hotZooCard/bg_70_40_3.png',
'bg_70_40_4': 'assets/hotZooCard/hotZooCard/bg_70_40_4.png',
'bg_70_40_5': 'assets/hotZooCard/hotZooCard/bg_70_40_5.png',
'bg_70_40_6': 'assets/hotZooCard/hotZooCard/bg_70_40_6.png',
'bg_70_40_7': 'assets/hotZooCard/hotZooCard/bg_70_40_7.png',
'bg_70_40_8': 'assets/hotZooCard/hotZooCard/bg_70_40_8.png',
'bg_70_40_9': 'assets/hotZooCard/hotZooCard/bg_70_40_9.png',
'creatJsonProfile': 'assets/hotZooCard/hotZooCard/creatJsonProfile.py',
'filename': 'assets/hotZooCard/hotZooCard/filename.txt',
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