Commit 35bcd130 authored by 范雪寒's avatar 范雪寒

feat: UI走查完成

parent 3a909711
......@@ -128,5 +128,8 @@
}
}
},
"defaultProject": "ng-template-generator"
}
"defaultProject": "ng-template-generator",
"cli": {
"analytics": false
}
}
\ No newline at end of file
<div class="model-content">
<div style="padding: 10px;">
<div style="width: 300px;" align='center'>
<div style="width: 300px; float: left;" align='center'>
<span>图1: </span>
<app-upload-image-with-preview
[picUrl]="item.pic_url"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url')">
[picUrl]="item.options[0].image"
(imageUploaded)="onImageUploadSuccess($event, 0)">
</app-upload-image-with-preview>
<span>图1文本: </span>
<input type="text" style="width: 240px;" nz-input [(ngModel)]="item.options[0].word" (blur)="save()">
</div>
<div style="width: 300px; margin-top: 5px;" align='center'>
<div style="width: 300px; float: left;" align='center'>
<span>图2: </span>
<app-upload-image-with-preview
[picUrl]="item.pic_url_2"
(imageUploaded)="onImageUploadSuccess($event, 'pic_url_2')">
[picUrl]="item.options[1].image"
(imageUploaded)="onImageUploadSuccess($event, 1)">
</app-upload-image-with-preview>
<span>图2文本: </span>
<input type="text" style="width: 240px;" nz-input [(ngModel)]="item.options[1].word" (blur)="save()">
</div>
<div style="width: 300px; margin-top: 15px;">
<span>文本: </span>
<input type="text" nz-input [(ngModel)]="item.text" (blur)="save()">
<div style="width: 300px; float: left;" align='center'>
<span>图3: </span>
<app-upload-image-with-preview
[picUrl]="item.options[2].image"
(imageUploaded)="onImageUploadSuccess($event, 2)">
</app-upload-image-with-preview>
<span>图3文本: </span>
<input type="text" style="width: 240px;" nz-input [(ngModel)]="item.options[2].word" (blur)="save()">
</div>
<div style="margin-top: 5px">
<span>音频: </span>
<app-audio-recorder
[audioUrl]="item.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, 'audio_url')"
></app-audio-recorder>
<div style="float: none; clear: both; height: 30px;"></div>
<div style="float: none;">
<div style="width: 150px; margin-top: 15px; float: left;">
<span>文本(下划线之前): </span>
<input type="text" style="width: 150px;" nz-input [(ngModel)]="item.question.labelLeft" (blur)="save()">
</div>
<div style="width: 150px; margin-left: 15px; margin-top: 15px; float: left;">
<span>文本(下划线之后): </span>
<input type="text" nz-input [(ngModel)]="item.question.labelRight" (blur)="save()">
</div>
</div>
</div>
</div>
......@@ -10,7 +10,7 @@ import { JsonPipe } from '@angular/common';
export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "test_001";
saveKey = "AK09";
// 储存对象
item;
......@@ -18,24 +18,24 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
createShell() {
this.item.wordList.push({
word: '',
audio: '',
backWord: '',
backWordAudio: '',
});
this.save();
}
removeShell(idx) {
this.item.wordList.splice(idx, 1);
this.save();
}
ngOnInit() {
this.item = {};
this.item = {
question: {
labelLeft: 'I like',
labelRight: '.'
},
options: [{
image: '//staging-teach.cdn.ireadabc.com/9f05f3c93fa5222c2290309b24db3d6a.png',
word: 'Apple'
}, {
image: '//staging-teach.cdn.ireadabc.com/eb28421cc9a72506c11f5db3e1d15b99.png',
word: 'Banana'
}, {
image: '//staging-teach.cdn.ireadabc.com/20f8ba0fdb560d0ab9af76adfae8fda4.png',
word: 'Orange'
}],
};
// 获取存储的数据
(<any>window).courseware.getData((data) => {
......@@ -67,9 +67,10 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
* 储存图片数据
* @param e
*/
onImageUploadSuccess(e, key) {
this.item[key] = e.url;
onImageUploadSuccess(e, idx) {
this.item.options[idx].image = e.url
.replaceAll('https:', '')
.replaceAll('http:', '');
this.save();
}
......
......@@ -17,16 +17,16 @@
"__id__": 2
},
{
"__id__": 107
"__id__": 108
},
{
"__id__": 109
"__id__": 110
},
{
"__id__": 111
"__id__": 112
},
{
"__id__": 113
"__id__": 114
}
],
"_active": false,
......@@ -84,19 +84,19 @@
"__id__": 3
},
{
"__id__": 96
"__id__": 97
}
],
"_active": true,
"_components": [
{
"__id__": 104
},
{
"__id__": 105
},
{
"__id__": 106
},
{
"__id__": 107
}
],
"_prefab": null,
......@@ -165,16 +165,16 @@
"__id__": 83
},
{
"__id__": 87
"__id__": 88
}
],
"_active": true,
"_components": [
{
"__id__": 94
"__id__": 95
},
{
"__id__": 95
"__id__": 96
}
],
"_prefab": null,
......@@ -4271,7 +4271,7 @@
"_active": true,
"_components": [
{
"__id__": 86
"__id__": 87
}
],
"_prefab": null,
......@@ -4334,6 +4334,9 @@
"_components": [
{
"__id__": 85
},
{
"__id__": 86
}
],
"_prefab": null,
......@@ -4416,6 +4419,33 @@
"_atlas": null,
"_id": "99PLmDe39DMIyXZBWf7xls"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 1280,
"_originalHeight": 720,
"_id": "b1q4phGplK16vW4yr3G6Ig"
},
{
"__type__": "cc.Widget",
"_name": "",
......@@ -4452,19 +4482,19 @@
},
"_children": [
{
"__id__": 88
"__id__": 89
},
{
"__id__": 90
"__id__": 91
}
],
"_active": true,
"_components": [
{
"__id__": 92
"__id__": 93
},
{
"__id__": 93
"__id__": 94
}
],
"_prefab": null,
......@@ -4520,13 +4550,13 @@
"_name": "tipLabel",
"_objFlags": 0,
"_parent": {
"__id__": 87
"__id__": 88
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 89
"__id__": 90
}
],
"_prefab": null,
......@@ -4582,7 +4612,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 88
"__id__": 89
},
"_enabled": true,
"_materials": [
......@@ -4617,13 +4647,13 @@
"_name": "starNode",
"_objFlags": 0,
"_parent": {
"__id__": 87
"__id__": 88
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 91
"__id__": 92
}
],
"_prefab": null,
......@@ -4679,7 +4709,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 90
"__id__": 91
},
"_enabled": true,
"_materials": [
......@@ -4711,7 +4741,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
"__id__": 88
},
"_enabled": true,
"_materials": [
......@@ -4743,7 +4773,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
"__id__": 88
},
"_enabled": true,
"alignMode": 1,
......@@ -4833,7 +4863,7 @@
},
"_children": [
{
"__id__": 97
"__id__": 98
}
],
"_active": true,
......@@ -4891,17 +4921,17 @@
"_name": "testBtn",
"_objFlags": 0,
"_parent": {
"__id__": 96
"__id__": 97
},
"_children": [
{
"__id__": 98
"__id__": 99
}
],
"_active": true,
"_components": [
{
"__id__": 103
"__id__": 104
}
],
"_prefab": null,
......@@ -4957,20 +4987,20 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 97
"__id__": 98
},
"_children": [
{
"__id__": 99
"__id__": 100
}
],
"_active": true,
"_components": [
{
"__id__": 101
"__id__": 102
},
{
"__id__": 102
"__id__": 103
}
],
"_prefab": null,
......@@ -5026,13 +5056,13 @@
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 98
"__id__": 99
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 100
"__id__": 101
}
],
"_prefab": null,
......@@ -5088,7 +5118,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 99
"__id__": 100
},
"_enabled": true,
"_materials": [
......@@ -5121,7 +5151,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 98
"__id__": 99
},
"_enabled": true,
"_materials": [
......@@ -5153,7 +5183,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 98
"__id__": 99
},
"_enabled": true,
"alignMode": 0,
......@@ -5180,7 +5210,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 97
"__id__": 98
},
"_enabled": true,
"_normalMaterial": null,
......@@ -5253,7 +5283,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 98
"__id__": 99
},
"_id": "0bNdPv3K1CubNfgwCtNZnD"
},
......@@ -5322,7 +5352,7 @@
"_active": true,
"_components": [
{
"__id__": 108
"__id__": 109
}
],
"_prefab": null,
......@@ -5378,7 +5408,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 107
"__id__": 108
},
"_enabled": true,
"_materials": [
......@@ -5419,7 +5449,7 @@
"_active": true,
"_components": [
{
"__id__": 110
"__id__": 111
}
],
"_prefab": null,
......@@ -5475,7 +5505,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 109
"__id__": 110
},
"_enabled": true,
"_materials": [
......@@ -5513,7 +5543,7 @@
"_active": true,
"_components": [
{
"__id__": 112
"__id__": 113
}
],
"_prefab": null,
......@@ -5569,7 +5599,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 111
"__id__": 112
},
"_enabled": true,
"_clip": {
......@@ -5594,7 +5624,7 @@
"_active": true,
"_components": [
{
"__id__": 114
"__id__": 115
}
],
"_prefab": null,
......@@ -5650,7 +5680,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 113
"__id__": 114
},
"_enabled": true,
"_clip": {
......
......@@ -238,9 +238,11 @@ cc.Class({
next();
});
window.courseware.onEvent('hideOption', (data, next) => {
this.updateStatus(data.status);
next();
});
window.courseware.onEvent('hideQuestion', (data, next) => {
this.updateStatus(data.status);
next();
});
},
......@@ -262,6 +264,39 @@ cc.Class({
tipNode.active = this.teachFlag;
},
updateStatus(status) {
this._status = status;
this._status.options.forEach((optionData, idx) => {
const optionNode = cc.find(`Canvas/bg/book/option/option_${idx}`);
if (!optionNode) {
return;
}
const starOn = cc.find(`ImageStarOn`, optionNode);
const starOff = cc.find(`ImageStarOff`, optionNode);
if (optionData.selected) {
starOn.opacity = 255;
starOff.opacity = 0;
} else {
starOn.opacity = 0;
starOff.opacity = 255;
}
});
const questionLayout = cc.find('Canvas/bg/book/question/questionNode/questionLayout');
if (!questionLayout) {
return;
}
const starOn = cc.find('starNode/ImageStarOn', questionLayout);
const starOff = cc.find('starNode/ImageStarOff', questionLayout);
if (this._status.quesion.selected) {
starOn.opacity = 255;
starOff.opacity = 0;
} else {
starOn.opacity = 0;
starOff.opacity = 255;
}
},
initOptions() {
this.data.options.forEach((optionData, idx) => {
const imgNode = cc.find(`Canvas/bg/book/option/option_${idx}/image`);
......@@ -422,7 +457,7 @@ cc.Class({
questionNode.parent = maskBase;
questionNode.setPosition(newPos);
await asyncTweenTo(questionNode, 0.6, { x: 0, y: 0, scale: 1.4 }, { easing: 'sineInOut' });
this.playAudioByNodeName('right');
const starOn = cc.find('questionLayout/starNode/ImageStarOn', questionNode);
const starOff = cc.find('questionLayout/starNode/ImageStarOff', questionNode);
......
{"ios":{"sceneName":"AK09","version":"80358"},"android":{"sceneName":"AK09","version":"80358"}}
\ No newline at end of file
{"ios":{"sceneName":"AK09","version":"180f8"},"android":{"sceneName":"AK09","version":"180f8"}}
\ No newline at end of file
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