Commit 1e9318d5 authored by huoshizhe's avatar huoshizhe

删除了无用的注释

parent 74abd8c6
<div class="model-content"> <div class="model-content">
<!-- <button style="margin: 4vw; display: flex; align-items: center" nz-button nzType="primary" nzGhost (click)="guideBtnClick(true)">
<i nz-icon type="play-circle"></i>
1分钟简易教程
</button> -->
<div *ngFor="let it of picArr; let i = index" style="padding: 0.5vw; width: 80%;"> <div *ngFor="let it of picArr; let i = index" style="padding: 0.5vw; width: 80%;">
<div class="border" style="display: flex; align-items: center;"> <div class="border" style="display: flex; align-items: center;">
<div style="width: 10%; padding-left: 20px"> <div style="width: 10%; padding-left: 20px">
<h5 style="padding-left: 15px; margin: auto"> 组-{{i+1}}: </h5> <h5 style="padding-left: 15px; margin: auto"> 组-{{i+1}}: </h5>
<div style="display: flex; justify-items: center; align-items: center; height: 40px;"> <div style="display: flex; justify-items: center; align-items: center; height: 40px;">
<!--<app-audio-recorder-->
<!--[audioUrl]="it.audio_url"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it)">-->
<!--</app-audio-recorder>-->
<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)"> <button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">
<span>删除</span> <span>删除</span>
<!--<i nz-icon type="close"></i>-->
</button> </button>
</div> </div>
</div> </div>
<div class="item-box" style="width: 50%"> <div class="item-box" style="width: 50%">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<span style="padding-right: 10px"> 类型:</span> <span style="padding-right: 10px"> 类型:</span>
<nz-radio-group [(ngModel)]="it.optionTypeA" (ngModelChange)="save()"> <nz-radio-group [(ngModel)]="it.optionTypeA" (ngModelChange)="save()">
<label nz-radio nzValue="A">文本</label> <label nz-radio nzValue="A">文本</label>
<label nz-radio nzValue="B">图片</label> <label nz-radio nzValue="B">图片</label>
</nz-radio-group> </nz-radio-group>
</div> </div>
<div *ngIf="it.optionTypeA == 'A'" style="width: 60%"> <div *ngIf="it.optionTypeA == 'A'" style="width: 60%">
<input style="width: 100%; margin-bottom: 0.5vw" type="text" nz-input placeholder="点击输入文本内容" [(ngModel)]="it.a_text" (blur)="saveItem()"> <input style="width: 100%; margin-bottom: 0.5vw" type="text" nz-input placeholder="点击输入文本内容" [(ngModel)]="it.a_text" (blur)="saveItem()">
</div> </div>
<div *ngIf="it.optionTypeA == 'B'" style="width: 90%; margin: auto"> <div *ngIf="it.optionTypeA == 'B'" style="width: 90%; margin: auto">
<div style="width: 100%;"> <div style="width: 100%;">
<app-upload-image-with-preview <app-upload-image-with-preview
[picUrl]="it['a_pic_url']" [picUrl]="it['a_pic_url']"
(imageUploaded)="onImageUploadSuccessByItem($event, it, 'a')" (imageUploaded)="onImageUploadSuccessByItem($event, it, 'a')"
></app-upload-image-with-preview> ></app-upload-image-with-preview>
</div> </div>
</div> </div>
...@@ -113,19 +81,11 @@ ...@@ -113,19 +81,11 @@
[audioUrl]="it['b_audio_url']" [audioUrl]="it['b_audio_url']"
(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'b')"> (audioUploaded)="onAudioUploadSuccessByItem($event, it, 'b')">
</app-audio-recorder> </app-audio-recorder>
</div> </div>
</div> </div>
</div> </div>
<div nz-col nzSpan="8" class="add-btn-box" > <div nz-col nzSpan="8" class="add-btn-box" >
<!--<div style="width: 100%; height: 100%;">--> <!--<div style="width: 100%; height: 100%;">-->
...@@ -136,152 +96,8 @@ ...@@ -136,152 +96,8 @@
</button> </button>
<!--</div>--> <!--</div>-->
</div> </div>
<!--<div style="padding-bottom: 30px;">-->
<!--<h5> title-sound: </h5>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="item.contentObj.title_audio_url"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, item.contentObj, 'title')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
<!--<div style="padding-bottom: 30px;">-->
<!--<h5> bg-sound: </h5>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="item.contentObj.bg_audio_url"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, item.contentObj, 'bg')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
<!--<span style="margin-bottom: 20px"> 10 : 23 </span>-->
<!--<div *ngFor="let it of picArr; let i = index">-->
<!--<span> pic-{{i + 1}}: </span>-->
<!--<div style="display: flex; align-items: center; padding-bottom: 20px">-->
<!--<div style="width: 40%; padding-right: 20px">-->
<!--<app-upload-image-with-preview-->
<!--[picUrl]="it.pic_url"-->
<!--(imageUploaded)="onImageUploadSuccessByItem($event, it)"-->
<!--&gt;</app-upload-image-with-preview>-->
<!--</div>-->
<!--<div class="pic-sound-box">-->
<!--<div nz-row style="width: 50%; padding-bottom: 20px;">-->
<!--<div *ngFor="let it2 of it.soundArr; let i2 = index" nz-col nzSpan="8">-->
<!--<label nz-checkbox nzValue="{{'answer_' + (i2 + 1)}}" [(ngModel)]="it2.answer" (ngModelChange)="clickCheckBox()" >{{i2 + 1}}</label>-->
<!--</div>-->
<!--</div>-->
<!--<div *ngFor="let it2 of it.soundArr; let i2 = index" style="display: flex; align-items: center; padding-bottom: 5px">-->
<!--<span style="padding-right: 10px">sound-{{i2 + 1}}:</span>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="it2.audio_url"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it2)">-->
<!--</app-audio-recorder>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--<div style="margin: auto; width: 95%;" nz-row nzType="flex" nzJustify="start" nzAlign="middle">-->
<!--<div *ngFor="let it of picArr; let i = index"-->
<!--nz-col nzSpan="8" >-->
<!--<div class="item-box">-->
<!--<h5> id-{{i+1}} </h5>-->
<!--<div style="display: flex; align-items: center; justify-content: center; padding-bottom: 5px">-->
<!--<input type="text" nz-input placeholder="" [(ngModel)]="it.text" (blur)="saveItem()">-->
<!--<button style="margin-left: 10px;" nz-button nzType="danger" (click)="deleteItem(it)">-->
<!--<i nz-icon type="close"></i>-->
<!--</button>-->
<!--</div>-->
<!--<app-upload-image-with-preview-->
<!--style="width: 100%"-->
<!--[picUrl]="it.pic_url"-->
<!--(imageUploaded)="onImageUploadSuccessByItem($event, it)"-->
<!--&gt;</app-upload-image-with-preview>-->
<!--<div style="display: flex; align-items: center; justify-content: center">-->
<!--<span style="width: 80px;">-->
<!--question:-->
<!--</span>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="it['q_audio_url']"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'q')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
<!--<div style="display: flex; align-items: center; justify-content: center">-->
<!--<span style="width: 80px;">-->
<!--answer:-->
<!--</span>-->
<!--<app-audio-recorder-->
<!--[audioUrl]="it['a_audio_url']"-->
<!--(audioUploaded)="onAudioUploadSuccessByItem($event, it, 'a')">-->
<!--</app-audio-recorder>-->
<!--</div>-->
<!--<nz-radio-group [(ngModel)]="it.radioValue" >-->
<!--<label nz-radio nzValue="A" (click)="radioClick(it, 'A')"> <i nz-icon nzType="check" nzTheme="outline"></i> </label>-->
<!--<label nz-radio nzValue="B" (click)="radioClick(it, 'B')"> <i nz-icon nzType="close" nzTheme="outline"></i> </label>-->
<!--</nz-radio-group>-->
<!--</div>-->
<!--</div>-->
</div> </div>
...@@ -293,7 +109,4 @@ ...@@ -293,7 +109,4 @@
您的浏览器不支持 audio 标签。 您的浏览器不支持 audio 标签。
</video> </video>
</div> </div>
</div> </div>
...@@ -130,30 +130,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -130,30 +130,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
console.log('item:' , this.item); console.log('item:' , this.item);
// this.picArr = this.getDefaultPicArr();
// this.item.contentObj.picArr = this.picArr;
// console.log('this.item:;', this.picArr);
} }
getDefaultPicArr() { getDefaultPicArr() {
const arr = []; const arr = [];
// for (let i = 0; i < 4; i ++) {
// const data = {};
// data['pic_url'] = '';
//
// const soundArr = [];
// for (let i = 0; i < 3; i++) {
// const tmpData = {};
// tmpData['answer'] = false;
// tmpData['audio_url'] = '';
// soundArr.push(tmpData);
// }
// data['soundArr'] = soundArr;
//
// arr.push(data);
// }
return arr; return arr;
} }
...@@ -176,11 +156,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy { ...@@ -176,11 +156,6 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
} }
onImageUploadSuccessByItem(e, item, id = null) { onImageUploadSuccessByItem(e, item, id = null) {
if (id != null) { if (id != null) {
......
...@@ -373,26 +373,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -373,26 +373,6 @@ export class PlayComponent implements OnInit, OnDestroy {
if (!contentObj) { return; } if (!contentObj) { return; }
// const addAudio = (key) => {
// const audioUrl = contentObj[key];
// if (audioUrl) {
// const audio = new Audio();
// audio.src = audioUrl;
// audio.load();
// this.audioObj[key] = audio;
// }
// }
//
// for (let i = 0; i < 4; i ++) {
// const key = i + '_audio_url';
// addAudio(key);
// }
//
// addAudio('audio_url');
//
const addUrlToAudioObj = (audioUrl) => { const addUrlToAudioObj = (audioUrl) => {
if (audioUrl) { if (audioUrl) {
...@@ -444,37 +424,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -444,37 +424,6 @@ export class PlayComponent implements OnInit, OnDestroy {
addOneAudio('wrong', this.rawAudios.get('wrong'), 1); addOneAudio('wrong', this.rawAudios.get('wrong'), 1);
addOneAudio('finish', this.rawAudios.get('finish'), 1); addOneAudio('finish', this.rawAudios.get('finish'), 1);
//
// const titleUrl = this.data.contentObj.title_audio_url;
// if (titleUrl) {
//
// this.titleAudio.src = titleUrl;
// this.titleAudio.load();
// }
// this.bgAudio.src = 'assets/bat-mail/music/bg.mp3';
// this.bgAudio.load();
// this.bgAudio.loop = true;
// this.bgAudio.volume = 0.5;
//
// this.wrongAudio.src = 'assets/common/music/wrong.mp3';
// this.wrongAudio.load();
//
// this.rightAudio.src = 'assets/common/music/right.mp3';
// this.rightAudio.load();
//
// this.successAudio.src = 'assets/magic-hat/music/finish.mp3';
// this.successAudio.load();
//
// this.successAudio.onended = () => {
// // this.showSuccessAudio();
// };
} }
initImg() { initImg() {
...@@ -522,30 +471,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -522,30 +471,10 @@ export class PlayComponent implements OnInit, OnDestroy {
initFontImg() { initFontImg() {
// const fontbaseUrlW = 'assets/mechanical/letter/';
// const fontDataW = {};
//
// let num = 97;
// for (let i = 0; i < 26; i++) {
//
// const key = String.fromCharCode(num + i); // 'a'
// const url = fontbaseUrlW + key + '.png';
//
// this.rawImages.set(url, url);
// fontDataW[key] = url;
// }
//
//
// this.fontDataW = fontDataW;
} }
setfontData() { setfontData() {
// for (let key in this.fontDataW) {
// this.fontDataW[key] = this.images.get(this.fontDataW[key]);
// }
} }
...@@ -586,15 +515,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -586,15 +515,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initBg(); this.initBg();
this.initItem(); this.initItem();
// this.initWheel();
//
// this.showStartAnima();
//
// this.initLightAnimaNew();
//
// this.initQuestionWindow();
//
// this.playAudio('bg');
} }
...@@ -1125,44 +1045,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1125,44 +1045,6 @@ export class PlayComponent implements OnInit, OnDestroy {
// hotZone['audio'] = this.audioObj[data.audio_url]; // hotZone['audio'] = this.audioObj[data.audio_url];
// this.imgArr.push(img); // this.imgArr.push(img);
} }
//
//
// const hotZoneItemArr = this.data.contentObj.hotZoneItemArr;
// if (!hotZoneItemArr) {
// return;
// }
//
// if (!this.bg) {
// return;
// }
//
// const bgRect = this.bg.getBoundingBox();
// const bgItem = this.data.contentObj.bgItem;
//
// const rate = bgRect.width / bgItem.rect.width;
//
//
// for (let i = 0; i < hotZoneItemArr.length; i++) {
//
// const tmpData = hotZoneItemArr[i];
// const shapeRect = new ShapeRect(this.ctx);
// shapeRect.anchorX = 0;
// shapeRect.anchorY = 0;
// shapeRect.setSize(tmpData.rect.width, tmpData.rect.height);
// shapeRect.setScaleXY(this.bg.scaleX);
// shapeRect.x = (bgItem.rect.x - bgRect.x + tmpData.rect.x ) / rate;
// shapeRect.y = (bgItem.rect.y - bgRect.y + tmpData.rect.y ) / rate;
//
// // shapeRect.x = tmpData.rect.x - this.bg.width / 2;
// // shapeRect.y = tmpData.rect.y - this.bg.height / 2;
// // this.bg.addChild(shapeRect);
//
// this.renderArr.push(shapeRect);
// }
} }
...@@ -1317,134 +1199,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1317,134 +1199,6 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
initWheel() { initWheel() {
//
// const wheelBottom = new MySprite(this.ctx);
// wheelBottom.init(this.images.get('wheel_bottom'));
// wheelBottom.x = this.canvasWidth / 2;
// wheelBottom.y = this.canvasHeight / 2;
// wheelBottom.setScaleXY(this.mapScale);
// this.renderArr.push(wheelBottom);
//
//
// const num = this.picArr.length;
// const colorArr = ['#efd303', '#f0b904', '#ef9303'];
// const len = wheelBottom.width / 2 * wheelBottom.scaleX * 0.78;
// const wheel = new Wheel(this.ctx);
// wheel.initWheel(num, len, colorArr);
// wheel.x = wheelBottom.x;
// wheel.y = wheelBottom.y - 5;
// this.renderArr.push(wheel);
// this.wheel = wheel;
//
//
// const arrow = new MySprite(this.ctx);
// arrow.init(this.images.get('arrow'));
// arrow.setScaleXY(this.mapScale);
// arrow.x = wheel.x;
// arrow.y = wheel.y;
// this.renderArr.push(arrow);
// this.arrow = arrow;
// arrow['baseY'] = arrow.y;
//
//
// const wheelTop = new MySprite(this.ctx);
// wheelTop.init(this.images.get('wheel_top'));
// wheelTop.setScaleXY(this.mapScale);
// wheelTop.x = wheel.x;
// wheelTop.y = wheel.y;
// this.renderArr.push(wheelTop);
//
//
//
//
// const title = new MySprite(this.ctx);
// title.init(this.images.get('title'));
// title.setScaleXY(this.mapScale);
// title.x = (wheelBottom.x - wheelBottom.width / 2 * wheelBottom.scaleX) / 2;
// title.y = title.height * title.scaleY;
// this.bgArr.push(title);
//
//
//
//
// const addBallLight = (ball, key) => {
//
// const light = new MySprite(this.ctx);
// light.init(this.images.get(key + '_light'));
// // light.visible = false;
// light.alpha = 0;
// ball.addChild(light);
// ball.light = light;
// return light;
// };
//
//
// this.ballArr = [];
// let ballId = 1;
// const ballLen = len * 1.1;
// const addAngle = Math.round(360 / 16 * 100) / 100;
// let ballGroupObj = {};
// for (let i = 0; i < 16; i++) {
//
// const angle = i * addAngle;
// const pos = getPosByAngle(angle, ballLen);
//
//
// const key = 'ball_' + ballId;
// const ball = new MySprite(this.ctx);
// ball.init(this.images.get(key));
// ball.x = wheel.x ; // - 2;
// ball.y = wheel.y ; // - 5;
// ball.x += pos.x;
// ball.y += pos.y;
// this.renderArr.push(ball);
// // wheelBottom.addChild(ball);
// ball.setScaleXY(this.mapScale);
// const light = addBallLight(ball, key);
// this.ballArr.push(ball);
//
// if (!ballGroupObj[key]) {
// ballGroupObj[key] = {};
// ballGroupObj[key].id = ballId;
// ballGroupObj[key].arr = [];
// }
// ballGroupObj[key].arr.push(light);
//
//
// ballId ++;
// if (ballId > 4) {
// ballId = 1;
// }
// }
//
// this.ballGroupArr = [];
// for (let key in ballGroupObj) {
// this.ballGroupArr.push(ballGroupObj[key]);
// }
// this.ballGroupArr.sort((a, b) => {
// return a.id - b.id;
// });
//
//
// for (let i = 0; i < this.picArr.length; i++) {
//
// const picData = this.picArr[i];
// let pic;
// if (picData.pic_url) {
// pic = new MySprite(this.ctx);
// pic.init(this.images.get(picData.pic_url));
// } else {
// const label = new Label(this.ctx);
// label.text = picData.title;
// label.fontName = 'BRLNSDB';
// label.fontColor = '#000000';
// label.textAlign = 'center';
// label.refreshSize();
// pic = label;
// }
//
// this.wheel.addItem(pic, this.mapScale);
// }
} }
...@@ -1835,22 +1589,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1835,22 +1589,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.leftWin = leftWin; this.leftWin = leftWin;
this.rightWin = rightWin; this.rightWin = rightWin;
// const light = new MySprite(this.ctx);
// light.init(this.images.get('light_png'));
// light.x = this.canvasWidth / 2;
// light.y = this.canvasHeight / 5 * 2;
// light.setScaleXY(this.mapScale);
// this.endPageArr.push(light);
// this.light = light;
//
// const hand = new MySprite(this.ctx);
// hand.init(this.images.get('hand_png'));
// hand.x = this.canvasWidth / 2;
// hand.y = light.y;
// hand.setScaleXY(this.mapScale);
// this.endPageArr.push(hand);
// this.hand = hand;
const replayBtn = new MySprite(this.ctx); const replayBtn = new MySprite(this.ctx);
replayBtn.init(this.images.get('replay_btn')); replayBtn.init(this.images.get('replay_btn'));
replayBtn.x = this.canvasWidth / 2; replayBtn.x = this.canvasWidth / 2;
...@@ -1861,16 +1599,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1861,16 +1599,6 @@ export class PlayComponent implements OnInit, OnDestroy {
this.hideArr(this.endPageArr); this.hideArr(this.endPageArr);
// const lightAction = () => {
// light.rotation = 0;
// rotateItem(light, 360, 10, () => {
// lightAction();
// });
// };
//
// lightAction();
} }
...@@ -2058,13 +1786,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2058,13 +1786,6 @@ export class PlayComponent implements OnInit, OnDestroy {
return; return;
} }
} }
} }
...@@ -2434,18 +2155,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -2434,18 +2155,6 @@ export class PlayComponent implements OnInit, OnDestroy {
const id = this.getLinkLineId(); const id = this.getLinkLineId();
const key = 'line_' + id; const key = 'line_' + id;
// const colorArr = [
// '#deffac',
// '#ffb062',
// '#ff66bf',
// '#fbff81',
// '#90ff62',
// '#9cffec',
// '#6dc5ff',
// '#ff6862',
// '#b8e887',
// '#ff8f8f',
// ];
const colorArr = [ const colorArr = [
'#9637FF', '#9637FF',
'#FFA802', '#FFA802',
......
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