Commit 5ec68f3c authored by yu's avatar yu

1

parent 92a53a1c
......@@ -12,6 +12,7 @@ const { ccclass, property } = cc._decorator;
export default class LayerBack extends cc.Component {
private btn_back: cc.Node;
private img_npc_voice: cc.Node;
private bg_forbid: cc.Node;
onLoad() {
this.initView();
this.initEvent();
......@@ -20,6 +21,7 @@ export default class LayerBack extends cc.Component {
initView() {
this.bg_forbid = pg.view.find(this, 'bg_forbid')
this.btn_back = pg.view.find(this, 'btn_back')
this.label_title = pg.view.find(this, 'label_title')
this.img_npc_voice = pg.view.find(this.label_title, 'img_npc_voice')
......@@ -39,6 +41,7 @@ export default class LayerBack extends cc.Component {
pg.event.on('npc_layer_back_init', (data) => {
this.updateView(data);
if (!this.npcAudio) {
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end');
} else {
this.playVoiceStart();
......@@ -56,6 +59,7 @@ export default class LayerBack extends cc.Component {
this.schedule(this.playVoiceRunning, 0.3)
pg.audio.playAudioByUrl(this.npcAudio, () => {
this.playVoiceEnd();
pg.view.visible(this.bg_forbid, false)
pg.event.emit('npc_voice_play_voice_end')
}, (audioId) => {
this.audioId = audioId;
......
......@@ -21,20 +21,23 @@
"__id__": 2
},
{
"__id__": 7
"__id__": 6
},
{
"__id__": 11
}
],
"_active": true,
"_components": [
{
"__id__": 22
"__id__": 27
},
{
"__id__": 23
"__id__": 28
}
],
"_prefab": {
"__id__": 24
"__id__": 29
},
"_opacity": 255,
"_color": {
......@@ -85,7 +88,7 @@
},
{
"__type__": "cc.Node",
"_name": "btn_back",
"_name": "bg_forbid",
"_objFlags": 0,
"_parent": {
"__id__": 1
......@@ -98,13 +101,128 @@
},
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1920,
"height": 1080
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_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": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "0b87ca13-07e1-4237-ab3b-7f27c69deb2d"
},
"fileId": "07DTTDThBNdJCrgpsUtJSh",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "btn_back",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 7
},
{
"__id__": 8
},
{
"__id__": 5
"__id__": 9
}
],
"_prefab": {
"__id__": 6
"__id__": 10
},
"_opacity": 255,
"_color": {
......@@ -158,7 +276,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 6
},
"_enabled": true,
"_materials": [
......@@ -190,7 +308,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 6
},
"_enabled": true,
"_normalMaterial": null,
......@@ -258,7 +376,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 2
"__id__": 6
},
"_enabled": true,
"alignMode": 1,
......@@ -300,17 +418,20 @@
},
"_children": [
{
"__id__": 8
"__id__": 12
}
],
"_active": true,
"_components": [
{
"__id__": 20
"__id__": 24
},
{
"__id__": 25
}
],
"_prefab": {
"__id__": 21
"__id__": 26
},
"_opacity": 255,
"_color": {
......@@ -364,27 +485,27 @@
"_name": "img_npc_voice",
"_objFlags": 0,
"_parent": {
"__id__": 7
"__id__": 11
},
"_children": [
{
"__id__": 9
"__id__": 13
},
{
"__id__": 12
"__id__": 16
},
{
"__id__": 15
"__id__": 19
}
],
"_active": true,
"_components": [
{
"__id__": 18
"__id__": 22
}
],
"_prefab": {
"__id__": 19
"__id__": 23
},
"_opacity": 255,
"_color": {
......@@ -438,17 +559,17 @@
"_name": "p1",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 12
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 10
"__id__": 14
}
],
"_prefab": {
"__id__": 11
"__id__": 15
},
"_opacity": 255,
"_color": {
......@@ -502,7 +623,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 9
"__id__": 13
},
"_enabled": true,
"_materials": [
......@@ -545,17 +666,17 @@
"_name": "p2",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 12
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 13
"__id__": 17
}
],
"_prefab": {
"__id__": 14
"__id__": 18
},
"_opacity": 255,
"_color": {
......@@ -609,7 +730,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 12
"__id__": 16
},
"_enabled": true,
"_materials": [
......@@ -652,17 +773,17 @@
"_name": "p3",
"_objFlags": 0,
"_parent": {
"__id__": 8
"__id__": 12
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 16
"__id__": 20
}
],
"_prefab": {
"__id__": 17
"__id__": 21
},
"_opacity": 255,
"_color": {
......@@ -716,7 +837,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 15
"__id__": 19
},
"_enabled": true,
"_materials": [
......@@ -759,7 +880,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 8
"__id__": 12
},
"_enabled": true,
"alignMode": 2,
......@@ -797,7 +918,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 7
"__id__": 11
},
"_enabled": true,
"_materials": [
......@@ -827,6 +948,33 @@
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 11
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 1,
"_left": 0,
"_right": 0,
"_top": 67.39999999999998,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
......
......@@ -69,3 +69,4 @@ export default class LayerCoin extends cc.Component {
......@@ -57,3 +57,4 @@ export default class LayerEnding extends cc.Component {
......@@ -39,13 +39,16 @@ export default class Candy extends cc.Component {
ch.y = 0;
let ju = cc.jumpBy(0.5, cc.v2(x, y), this.jumpHeight, 1);
let call = cc.callFunc(() => {
if (idx == this.node.children.length - 1)
if (idx == this.node.children.length - 1) {
pg.event.emit("camdy_action_end", this.node);
if (this.isHide) this.node.active = !this.isHide;
let light = cc.find("pic_light", this.node);
cc.tween(light).to(1, { opacity: 0 }).start();
}
// if (this.isHide) this.node.active = !this.isHide;
})
// ch.runAction(ju);
cc.tween(ch).sequence(ju, call).start();
cc.tween(ch).delay(0.5).to(0.2, { opacity: 0 }).start();
})
......@@ -59,3 +62,4 @@ export default class Candy extends cc.Component {
......@@ -55,3 +55,4 @@ export default class ImgVoice extends cc.Component {
......@@ -200,3 +200,4 @@ export default class LayerRecord extends cc.Component {
......@@ -111,3 +111,4 @@ export default class LayerRight extends cc.Component {
......@@ -4,7 +4,7 @@ export let imageZize = {
}
export class OptionJigsaw {
export class Option {
type;
txt;
picUrl;
......@@ -17,11 +17,11 @@ export class OptionJigsaw {
this.data = data;
this.type = data.type;
this.txt = data.text;
this.picUrl = data.image;
this.picUrl = data.pic_url;
this.audioUrl = data.optionAudio;
}
}
export class ItemJigsaw {
export class Item {
public page;
public audio;
public image;
......@@ -29,26 +29,42 @@ export class ItemJigsaw {
public voice;
public time;
public id;
public hotZoneItemArr;
count: number;
constructor(data, page) {
// this.audio = data.audio;
this.image = data.pic_url;
// this.voice = data.voice;
// this.time = data.time;
this.id = page;
// this.optionList = data.options.map(o => {
// return new Option(o, id++);
// })
// this.optionList.sort(function () {
// return (0.5 - Math.random());
// });
// for (let i = 0; i < this.optionList.length; i++) {
// this.optionList[i].count = i;
// }
this.page = page;
this.audio = data.audioUrl;
this.image = data.bgItem.url;
this.hotZoneItemArr = [];
for (let i = 0; i < data.hotZoneItemArr.length; i++) {
let d = data.hotZoneItemArr[i];
this.hotZoneItemArr.push(new Option(d, i));
}
this.changepoints(data);
}
// this.page = page;
public pointsArr;
private changepoints(data) {
let scX = imageZize.width / data.bgItem.rect.width;
let scY = imageZize.height / data.bgItem.rect.height;
let px = data.bgItem.rect.x;
let py = data.bgItem.rect.y;
this.pointsArr = [];
let arr = [];
data.hotZoneItemArr.forEach((item, idx) => {
let p = item.rect;
arr[idx] = {
x: (p.x + (p.width / 2)) * scX,// - px
y: -((p.y + (p.height / 2)) * scY)// - py
}
})
this.pointsArr = arr.concat();
}
}
export default class GameJigsaw {
......@@ -58,7 +74,7 @@ export default class GameJigsaw {
return GameJigsaw.ins;
}
private data: any;
public lists: Array<ItemJigsaw>
public lists: Array<Item>
public title: string;
public titleAudio: string;
public image: string;
......@@ -82,7 +98,7 @@ export default class GameJigsaw {
public init(data) {
this.start = false;
this.lists = [];
this.data = data.hotZoneItemArr;
this.data = data.questions;
this.aniEnter = data.imgAni;
this.endImgAni = data.endImgAni;
this.title = data.title;
......@@ -95,7 +111,6 @@ export default class GameJigsaw {
this.tipSwitch = data.tipSwitch;
this.endImgTitle = data.endImgTitle;
this.jumpIdx = data.jumpIdx || -1;
this.changepoints(data);
}
public start: boolean;
public page: number;
......@@ -105,13 +120,13 @@ export default class GameJigsaw {
this.lists = [];
for (let i = 0; i < this.data.length; i++) {
let data = this.data[i];
this.lists.push(new ItemJigsaw(data, i));
this.lists.push(new Item(data, i + 1));
}
this.lists.sort(function () {
return (0.5 - Math.random());
});
}
checkSuccess(arr: OptionJigsaw[]) {
checkSuccess(arr: Option[]) {
let data = this.getCurrentPage();
let options = data.optionList.concat();
options.sort((A, B) => A.id - B.id)
......@@ -122,23 +137,7 @@ export default class GameJigsaw {
}
return true;
}
public pointsArr;
private changepoints(data) {
let scX = imageZize.width / data.bgItem.rect.width;
let scY = imageZize.height / data.bgItem.rect.height;
let px = data.bgItem.rect.x;
let py = data.bgItem.rect.y;
this.pointsArr = [];
let arr = [];
data.hotZoneItemArr.forEach((item, idx) => {
let p = item.rect;
arr[idx] = {
x: (p.x + (p.width / 2)) * scX,// - px
y: -((p.y + (p.height / 2)) * scY)// - py
}
})
this.pointsArr = arr.concat();
}
getTotalLabel() {
let data = this.getCurrentPage();
......@@ -149,10 +148,10 @@ export default class GameJigsaw {
return str;
}
getDataByPage(page): ItemJigsaw {
getDataByPage(page): Item {
return this.lists.filter(li => li.page == page)[0]
}
getCurrentPage(): ItemJigsaw {
getCurrentPage(): Item {
let page = this.page;
return this.lists.filter(li => li.page == page)[0]
}
......@@ -190,3 +189,4 @@ let win: any = window;
win.Game = GameJigsaw;
This diff is collapsed.
import { asyncDelay, exchangeNodePos, getSprNode, onHomeworkFinish, onHomeworkStart, playAudio } from "../script/util_hy05_pintu";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent_hy05_pintu";
import GameJigsaw, { imageZize, ItemJigsaw, OptionJigsaw } from "./Gamehy05_pintu";
import GameJigsaw, { imageZize, Item, Option } from "./Gamehy05_pintu";
import pg from "./pg_hy05_pintu";
const { ccclass, property } = cc._decorator;
......@@ -63,7 +63,6 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
this.flyAction();
this.startGame();
pg.view.setNetImg(this.img_bg, GameJigsaw.getIns().image, { w: imageZize.width, h: imageZize.height });
}
initEvent() {
......@@ -79,7 +78,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
});
pg.event.on('npc_voice_play_voice_end', () => {
})
pg.event.emit('npc_layer_back_init', this.data)
......@@ -155,7 +154,6 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
private currentCards: cc.Node[];
//开始游戏
startGame() {
GameJigsaw.getIns().reset();
this.nextPage();
}
nextPage() {
......@@ -163,21 +161,22 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
this.cards = [];
this.currentCards = [];
this.cardBgs = [];
let data = GameJigsaw.getIns().list;
let data = GameJigsaw.getIns().getCurrentPage();
//自动创建卡片
this.right_layout.active = true;
this.createCrads(data);
pg.view.setNetImg(this.img_bg, data.image, { w: imageZize.width, h: imageZize.height });
}
//创建卡片
private cards: cc.Node[];
private cardBgs: cc.Node[];
createCrads(list) {
createCrads(data: Item) {
this.right_layout.removeAllChildren();
// this.cleanLayoutSort();
this.layout_sort.removeAllChildren();
let count = 0;
list.forEach((li, idx) => {
data.hotZoneItemArr.forEach((li, idx) => {
let item = cc.instantiate(this.node_card);
this.right_layout.addChild(item);
li.count = count;
......@@ -185,7 +184,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
count++;
})
count = 0;
let pos = GameJigsaw.getIns().pointsArr;
let pos = data.pointsArr;
pos.forEach((li, idx) => {
let item = cc.instantiate(this.sort_card);
this.layout_sort.addChild(item);
......@@ -201,7 +200,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
}
private initTopCard(item, data, idx) {
let img = cc.find("img", item);
pg.view.setNetImg(img, data.image, { w: 118, h: 118 }, false);
pg.view.setNetImg(img, data.picUrl, { w: 118, h: 118 }, false);
img.x = idx % 2 == 0 ? -107 : 107
item.active = true;
item.y = 0;
......@@ -314,8 +313,7 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
// }, 1000);
if (this.checkRoundEnd()) {
GameJigsaw.getIns().addPage();
pg.event.emit("gameOver");
this.checkGameOver();
}
} else {
this.playLocalAudio("error");
......@@ -353,6 +351,19 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
return this.currentCards.every(card => !!card);
}
private checkGameOver() {
let audio = GameJigsaw.getIns().getCurrentPage().audio;
let over = GameJigsaw.getIns().addPage();
pg.audio.playAudioByUrl(audio).then(async () => {
await asyncDelay(1);
if (!over) {
pg.event.emit("gameOver");
} else {
this.nextPage();
}
});
}
gameOver() {
pg.event.once('layer_right_show_excellent_end', () => {
pg.event.emit('layer_coin_show_coin', 3) //1 2 3硬币数量
......@@ -388,3 +399,4 @@ export default class PuzzleJigsaw extends MyCocosSceneComponent {
......@@ -587,3 +587,4 @@ let pg = {
export default pg;
......@@ -179,3 +179,4 @@ export class MyCocosSceneComponent extends cc.Component {
}
export const defaultData = {
"npcTitle": "pintu",
"npcAudio": "http://staging-teach.cdn.ireadabc.com/449e65975d358514cc3494f9f67bc012_l.mp3",
"npcAudioName": "cape.mp3",
"tipSwitch": 1,
"tipType": "page",
"tipBg": "",
"tipPage": [{
"title": "",
"audio": ""
}
"title": "",
"audio": ""
}
],
"title": "",
"audio": "",
......@@ -15,43 +18,37 @@ export const defaultData = {
"points": "",
"questionScore": 0,
"questions": [{
"options": [{
"type": "img",
"image": "",
"audio": "",
"text": "",
"time": "",
"right": false
}, {
"type": "img",
"image": "",
"audio": "",
"text": "",
"time": "",
"right": false
}, {
"type": "img",
"image": "",
"audio": "",
"text": "",
"time": "",
"right": false
}
],
"type": "img"
}
],
"bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/1553dfbd077983ec0c42e03c28ded825.png",
"rect": {
"x": 0,
"y": 62.27,
"width": 904,
"height": 567.45
"options": [{
"audio": "",
"hotZoneItemArr": [],
"bgItem": "",
"right": false
}, {
"audio": "",
"hotZoneItemArr": [],
"bgItem": "",
"right": false
}, {
"audio": "",
"hotZoneItemArr": [],
"bgItem": "",
"right": false
}
},
"hotZoneItemArr": [{
"id": "1686815485086",
],
"type": "img",
"audioUrl": "http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3",
"audioName": "bear_3.mp3",
"bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/1553dfbd077983ec0c42e03c28ded825.png",
"rect": {
"x": 0,
"y": 62.27,
"width": 904,
"height": 567.45
}
},
"hotZoneItemArr": [{
"id": "1688889611322",
"index": 0,
"pic_url": "http://staging-teach.cdn.ireadabc.com/43529c2ca99eb66d78fd920d863559a9.png",
"itemType": "pic",
......@@ -70,12 +67,12 @@ export const defaultData = {
"ontColor": "#8f3758",
"rect": {
"x": 311.77,
"y": 143.51,
"y": 143.5,
"width": 280.46,
"height": 280.46
}
}, {
"id": "1686815494742",
"id": "1688889615595",
"index": 1,
"pic_url": "http://staging-teach.cdn.ireadabc.com/47041db332a1ba4cd5050abf729b817d.png",
"itemType": "pic",
......@@ -93,13 +90,13 @@ export const defaultData = {
"fontName": "ahronbd-1",
"ontColor": "#8f3758",
"rect": {
"x": 489.77,
"y": 330.5,
"x": 490.77,
"y": 331.5,
"width": 280.46,
"height": 280.46
}
}, {
"id": "1686815513031",
"id": "1688889616169",
"index": 2,
"pic_url": "http://staging-teach.cdn.ireadabc.com/ce34627cca00e3eb7d869c95086d2a85.png",
"itemType": "pic",
......@@ -118,12 +115,12 @@ export const defaultData = {
"ontColor": "#8f3758",
"rect": {
"x": -33.23,
"y": 140.5,
"y": 143.5,
"width": 280.46,
"height": 280.46
}
}, {
"id": "1686815513951",
"id": "1688889617242",
"index": 3,
"pic_url": "http://staging-teach.cdn.ireadabc.com/feba2ef37c412aa71a46c3c5f20abda2.png",
"itemType": "pic",
......@@ -133,27 +130,115 @@ export const defaultData = {
"imgSizeH": 300,
"mapScale": 0.70625,
"dragDot": {
"x": 452,
"y": 346
"x": 320,
"y": 166
},
"gIdx": "0",
"fontSize": 50,
"fontName": "ahronbd-1",
"ontColor": "#8f3758",
"rect": {
"x": 129.77,
"x": 128.77,
"y": -47.5,
"width": 280.46,
"height": 280.46
}
}
]
}, {
"options": [],
"type": "img",
"bgItem": {
"url": "http://staging-teach.cdn.ireadabc.com/1553dfbd077983ec0c42e03c28ded825.png",
"rect": {
"x": 0,
"y": 2.64,
"width": 1094,
"height": 686.72
}
},
"hotZoneItemArr": [{
"id": "1688889777085",
"index": 0,
"pic_url": "http://staging-teach.cdn.ireadabc.com/43529c2ca99eb66d78fd920d863559a9.png",
"itemType": "pic",
"fontScale": 0.8546875,
"imgScale": 1.1313340227507755,
"imgSizeW": 300,
"imgSizeH": 300,
"mapScale": 0.8546875,
"dragDot": {
"x": 547,
"y": 346
},
"gIdx": "0",
"fontSize": 50,
"fontName": "ahronbd-1",
"ontColor": "#8f3758",
"rect": {
"x": 377.3,
"y": 173.66,
"width": 339.4,
"height": 339.4
}
}, {
"id": "1688889778564",
"index": 1,
"pic_url": "http://staging-teach.cdn.ireadabc.com/47041db332a1ba4cd5050abf729b817d.png",
"itemType": "pic",
"fontScale": 0.8546875,
"imgScale": 1.1313340227507755,
"imgSizeW": 300,
"imgSizeH": 300,
"mapScale": 0.8546875,
"dragDot": {
"x": 547,
"y": 346
},
"gIdx": "0",
"fontSize": 50,
"fontName": "ahronbd-1",
"ontColor": "#8f3758",
"rect": {
"x": 592.3,
"y": 398.66,
"width": 339.4,
"height": 339.4
}
}, {
"id": "1688889788878",
"index": 2,
"pic_url": "http://staging-teach.cdn.ireadabc.com/feba2ef37c412aa71a46c3c5f20abda2.png",
"itemType": "pic",
"fontScale": 0.8546875,
"imgScale": 1.1313340227507755,
"imgSizeW": 300,
"imgSizeH": 300,
"mapScale": 0.8546875,
"dragDot": {
"x": 547,
"y": 346
},
"gIdx": "0",
"fontSize": 50,
"fontName": "ahronbd-1",
"ontColor": "#8f3758",
"rect": {
"x": 155.3,
"y": -60.34,
"width": 339.4,
"height": 339.4
}
}
],
"audioUrl": "http://staging-teach.cdn.ireadabc.com/36067f9e2415d59fa37c3795a3929087_l.mp3",
"audioName": "bear_3.mp3"
}
],
"questionText": "",
"npcTitle": "hi fiddler",
"npcAudio": "http://staging-teach.cdn.ireadabc.com/449e65975d358514cc3494f9f67bc012_l.mp3",
"npcAudioName": "cape.mp3"
"bgItem": "",
"hotZoneItemArr": [],
"questionText": ""
}
......@@ -444,3 +444,4 @@ export function onHomeworkStart(cb) {
}
......@@ -89,78 +89,56 @@
<span>{{ item.npcAudioName}}</span>
</div>
</div>
<!-- <span style="margin-right: 20px;font-size: 18px;font-weight: bold;">提示开关 </span>
<nz-radio-group [ngModel]="item.tipSwitch" (ngModelChange)="customRadioChange($event, item,'tipSwitch')"
style="font-size: 20px;display: flex; align-items: center; justify-content: left; flex-wrap: wrap;">
<label nz-radio nzValue="1">开</label>
<label nz-radio nzValue="0">关</label>
</nz-radio-group> -->
<!--
<div *ngIf="item.tipSwitch == 1">
<span style="font-size: 20px;">提示动画: </span>
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)"
[skeJsonData]="item.imgAni.ske" [texJsonData]="item.imgAni.tex" [texPngData]="item.imgAni.png">
</app-upload-dragon-bone>
<div>
<span style="font-size: 20px;">提示背景: </span>
<div style="width:300px">
<app-upload-image-with-preview [picUrl]="item.tipBg"
(imageUploaded)="onImageUploadSuccess($event,'tipBg', item)"></app-upload-image-with-preview>
</div>
</div>
<div>
<span style="font-size: 20px;">提示内容: </span>
<input *ngIf="item.tipType == 'scroll'" type="text" nz-input [(ngModel)]="item.title" (blur)="save()">
<div *ngIf="item.tipType == 'page'">
<div *ngFor="let page of item.tipPage; let m = index" style="margin-bottom: 5px; ">
<div style="display: flex;">
<div style="font-size: 20px;line-height:32px">页{{m+1}}</div>
<input style="width:700px;margin-left: 10px;" type="text" nz-input [(ngModel)]="page.title"
(blur)="save()">
<div style="margin-left: 20px;">
<app-audio-recorder [audioUrl]="page.audio"
(audioUploaded)="onAudioUploadSuccess($event, 'audio',page)">
</div>
<div style="margin: 20px;width: 1300px;">
<div *ngFor="let question of item.questions; let i = index">
<div style="display: flex;margin-top: 20px;">
<div class="border-solid" style="min-width: 1300px;">
<div class="word-type-title">
题目{{i+1}}
</div>
<div class="option-audio">
<div class="word-input-title">
结束音频:
</div>
<div style="display: flex">
<div>
<app-audio-recorder [audioUrl]="question.audioUrl"
(audioUploaded)="onAudioUploadSuccess($event, 'audioUrl', question,'audioName')">
</app-audio-recorder>
</div>
<button class="btn-red" style="width: 100px; height: 32px;margin-left: 20px;" nz-button nzType="default"
nzDanger (click)="removePage(m)">删除</button>
<div style="margin: 5px">
<span>
{{ question.audioName}}
</span>
</div>
</div>
<div class="border-dashed" style="margin: 20px;width: 1200px;">
<h2>热区配置:</h2>
<app-custom-hot-zone [bgItem]="question.bgItem" [hotZoneItemArr]="question.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr" (save)="saveHotZone(question, $event)">
</app-custom-hot-zone>
</div>
</div>
<button class="btn-blue" style="width: 150px; height: 32px;" nz-button nzType="default" nzDanger
(click)="addPage()">+增加提示内容</button>
</div>
<div style="margin:0 20px">
<button class="btn-red" nz-button nzType="default" nzDanger (click)="removequestion(i)">删除题目</button>
</div>
</div>
</div> -->
<!--
<div>
<span style="font-size: 20px;">游戏背景: </span>
<div style="width:300px">
<app-upload-image-with-preview [picUrl]="item.image"
(imageUploaded)="onImageUploadSuccess($event,'image', item)"></app-upload-image-with-preview>
<div style="margin-top: 20px;">
<button class="btn-blue" style="width: 1300px; height: 50px;" nz-button nzType="default" nzDanger
(click)="addquestion()">+增加题目</button>
</div>
</div>
<div style="display: flex; align-items: center; ">
<h2> 题目分值: </h2>
</div>
<input type="text" nz-input [(ngModel)]="item.questionScore" (blur)="save()">
<span style="font-size: 20px;">结束动画: </span>
<app-upload-dragon-bone style="width: 100%" (save)="onDragonBoneSave($event,item)"
[skeJsonData]="item.endImgAni.ske" [texJsonData]="item.endImgAni.tex" [texPngData]="item.endImgAni.png">
</app-upload-dragon-bone>
<span style="font-size: 20px;">结束动画文本: </span>
<input type="text" nz-input [(ngModel)]="item.endImgTitle" (blur)="save()">
<div style="display: flex; align-items: center; ">
<h2> 跳转页面: </h2>
</div>
<input type="text" nz-input [(ngModel)]="item.jumpIdx" (blur)="save()">
</div> -->
<div class="border-dashed" style="margin: 20px;width: 1000px;">
<h2>热区配置:</h2>
<app-custom-hot-zone [bgItem]="item.bgItem" [hotZoneItemArr]="item.hotZoneItemArr"
[customTypeGroupArr]="customTypeGroupArr" (save)="saveHotZone(item, $event)">
</app-custom-hot-zone>
</div>
</div>
......
......@@ -176,11 +176,9 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addoption(i) {
this.item.questions[i].options.push({
type: "img",
image: "",
audio: "",
text: "",
time: "",
hotZoneItemArr: [],
bgItem: "",
right: false
});
this.save();
......
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