Commit 8f00e4e1 authored by linzhiguo's avatar linzhiguo

+ 修改表结构

parent 06b7d607
......@@ -24,7 +24,11 @@ export class Kind{
pic_url : string;
page_id : string;
is_disturb: boolean;
is_text : boolean;
//star_id : string;
options : Array<Option> = [];
}
export class Option{
......@@ -33,4 +37,5 @@ export class Option{
pic_url : string;
kind_id : string;
is_text : boolean;
}
@import '../style/common_mixin.css';
.model-content {
width: 100%;
height: 100%;
}
<div class="model-content">
<nz-card nzTitle="分类模板内容编辑" style="margin:5vw;" nzType="inner">
<nz-divider nzText="星" nzOrientation="left"></nz-divider>
<div nz-row>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="add-btn" nzNoColon=true></nz-form-label>
<nz-form-control [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='6'>
<button nz-button nzType="dashed" class="add-btn" id="add-btn" (click)="addStar()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
</nz-form-control>
</nz-form-item>
<nz-divider nzText="星" nzOrientation="left"></nz-divider>
<!-- <div nz-row>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="add-btn" nzNoColon=true>页</nz-form-label>
<nz-form-control [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='6'>
<button nz-button nzType="dashed" class="add-btn" id="add-btn" (click)="addStar()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
</nz-form-control>
</nz-form-item>
</div> -->
<div nz-row>
<div style="text-align: center; float: right;">
<button nz-button nzType="primary" (click)="addStar()" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</button>
</div>
<div nz-row>
<div *ngFor="let data of item.stars;let i = index" style="margin: 2vw;">
<div nz-col [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='4'>
<nz-card nzTitle="星-{{i + 1}}" [nzExtra]="extraTemplate" style="height: 100px; margin: 1vw;">
</nz-card>
<ng-template #extraTemplate>
<button style="margin: 10px;" nz-button nzType="danger" (click)="delStar(i)">
<span>删除</span>
</button>
</ng-template>
</div>
<div *ngFor="let data of item.stars;let i = index" style="margin: 2vw;">
<div nz-col [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='4'>
<nz-card nzTitle="星-{{i + 1}}" [nzExtra]="extraTemplate" style="height: 100px; margin: 1vw;">
</nz-card>
<ng-template #extraTemplate>
<button style="margin: 10px;" nz-button nzType="danger" (click)="delStar(i)">
<span>删除</span>
</button>
</ng-template>
</div>
</div>
<nz-divider nzText="页" nzOrientation="left"></nz-divider>
<div nz-row>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="add-btn" nzNoColon=true></nz-form-label>
<nz-form-control [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]=''>
<button nz-button nzType="dashed" class="add-btn" id="add-btn" (click)="addPage()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
</nz-form-control>
</nz-form-item>
</div>
<div nz-row>
<div *ngFor="let data of item.pages;let i = index" style="margin: 2vw;">
<div nz-col [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='4'>
<nz-card nzTitle="页-{{i + 1}}" [nzExtra]="extraTemplate" style="height: 200px; margin: 1vw;">
<nz-form-item>
<nz-form-label [nzSpan]="6"></nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-select [(ngModel)]="data.star_id" (ngModelChange)="setStarID($event, data)" style="width:120px" nzAllowClear>
<nz-option *ngFor="let o of item.stars let j = index" [nzValue]="o.id" [nzLabel]="'星-'+(j+1)"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</nz-card>
<ng-template #extraTemplate>
<button style="margin: 10px;" nz-button nzType="danger" (click)="delPage(i)">
<span>删除</span>
</button>
</ng-template>
</div>
</div>
</div>
<nz-divider nzText="页" nzOrientation="left"></nz-divider>
<!-- <div nz-row>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="add-btn" nzNoColon=true>页</nz-form-label>
<nz-form-control [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]=''>
<button nz-button nzType="dashed" class="add-btn" id="add-btn" (click)="addPage()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
</nz-form-control>
</nz-form-item>
</div> -->
<div nz-row>
<div style="text-align: center; float: right;">
<button nz-button nzType="primary" (click)="addPage()" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</button>
</div>
<nz-divider nzText="分组" nzOrientation="left"></nz-divider>
<div nz-row>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="add-btn" nzNoColon=true>分组</nz-form-label>
<nz-form-control [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='6'>
<button nz-button nzType="dashed" class="add-btn" id="add-btn" (click)="addKind()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
<div *ngFor="let data of item.pages;let i = index" style="margin: 2vw;">
<div nz-col [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='4'>
<nz-card nzTitle="页-{{i + 1}}" [nzExtra]="extraTemplate" style="height: 200px; margin: 1vw;">
<nz-form-item>
<nz-form-label> 建议:4个分组以内为最佳效果。图片:最佳尺寸为188*122像素</nz-form-label>
<nz-form-label [nzSpan]="6"></nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-select [(ngModel)]="data.star_id" (ngModelChange)="setStarID($event, data)" style="width:120px" nzAllowClear>
<nz-option *ngFor="let o of item.stars let j = index" [nzValue]="o.id" [nzLabel]="'星-'+(j+1)"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
</nz-form-control>
</nz-form-item>
</nz-card>
<ng-template #extraTemplate>
<button style="margin: 10px;" nz-button nzType="danger" (click)="delPage(i)">
<span>删除</span>
</button>
</ng-template>
</div>
</div>
<div nz-row>
<div *ngFor="let data of item.kinds;let i = index" style="margin: 2vw;">
<div nz-col [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='6'>
<nz-card nzTitle="分组-{{i + 1}}" [nzExtra]="extraTemplate" style="height: 400px; margin: 1vw;">
<nz-form-item>
<nz-form-label [nzSpan]="6"></nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-select [(ngModel)]="data.page_id" (ngModelChange)="setPageID($event, data)" style="width:120px" nzAllowClear>
<nz-option *ngFor="let o of item.pages let j = index" [nzValue]="o.id" [nzLabel]="'页-'+(j+1)"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="{{i}}.word">文本</nz-form-label>
<nz-form-control [nzSpan]="12">
<input nz-input type="text" id="{{i}}.word" placeholder="请录入内容" [(ngModel)]="data.word" (blur)="save()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="{{i}}.pic_url">图片</nz-form-label>
<nz-form-control [nzSpan]="12">
<app-upload-image-with-preview style="width: 100%" [picUrl]="data.pic_url"
(imageUploaded)="onImageUploadSuccess($event, data, 'pic_url')"></app-upload-image-with-preview>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzNoColon=true>声音</nz-form-label>
<nz-form-control [nzSpan]="18">
<app-audio-recorder [audioUrl]="data.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, data, 'audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</nz-card>
<ng-template #extraTemplate>
<button style="margin: 10px;" nz-button nzType="danger" (click)="delKind(i)">
<span>删除</span>
</div>
<nz-divider nzOrientation="left"></nz-divider>
<div class="card-config">
<div *ngFor="let data of item.kinds; let i = index" class="card-item" style="padding: 0.5vw;" >
<div class="card-item-content border">
<div class="card-item-content">
<div class="title" >
分组-<strong>{{ i + 1 }}</strong>
</div>
<div class="section" >
建议:4个分组以内为最佳效果<p></p>图片:最佳尺寸为188*122像素
<div style="text-align: right; padding-right: 20px;">
<button style="margin-bottom: 10px;" nz-button nzType="danger" (click)="delKind(i)" >
<span>删除此分组</span>
</button>
</div>
</div>
<div class="section" >
<div class="section-title" >
分组信息
</div>
<div class="section-content">
<div style="flex:10">
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
</div>
<div style="flex:5">
<nz-select [(ngModel)]="data.page_id" (ngModelChange)="setPageID($event, data)" style="width:120px" nzAllowClear>
<nz-option *ngFor="let o of item.pages let j = index" [nzValue]="o.id" [nzLabel]="'页-'+(j+1)"></nz-option>
</nz-select>
</div>
</div>
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:5">
<label nz-checkbox [(ngModel)]="data.is_disturb">干扰选项分组</label>
</div>
</div>
<div *ngIf="data.is_disturb != true">
<div style="display: flex; ">
<div style="flex:2">
类型
</div>
<div style="flex:4">
<nz-radio-group [(ngModel)]="data.is_text" (ngModelChange)="saveItem()" >
<label nz-radio [nzValue]="true">文字</label>
<label nz-radio [nzValue]="false">图片</label>
</nz-radio-group>
</div>
</div>
<div *ngIf="data.is_text != false">
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
文字
</div>
<div style="flex:5">
<input type="text" nz-input placeholder="" [(ngModel)]="data.word" (blur)="saveItem()"/>
</div>
</div>
</div>
<div *ngIf="data.is_text == false">
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
图片
</div>
<div style="flex:5">
<app-upload-image-with-preview style="width: 100%;" [picUrl]="data.pic_url" (imageUploaded)="onImageUploadSuccess($event, data, 'pic_url')"></app-upload-image-with-preview>
</div>
</div>
</div>
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
音频
</div>
<div style="flex:5">
<app-audio-recorder [audioUrl]="data.audio_url" (audioUploaded)="onAudioUploadSuccess($event, data, 'audio_url')" ></app-audio-recorder>
</div>
</div>
</div>
</div>
<div style="flex:20">
</div>
</div>
</div>
<div class="section" >
<div class="section-title" >
选项信息 <label>图片:最佳尺寸为258*174像素</label>
<div style="text-align: center; float: right;">
<button nz-button nzType="primary" (click)="addOption(i)" >
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
添加
</button>
</div>
</div>
<div class="section-content">
<div *ngFor="let choiceItem of data.options; let choiceIndex = index" style="width:220px; height:280px; border:1px solid #CCC; padding:5px; border-radius: 5px; margin: 0 10px;">
<div style="display: flex; ">
<div style="flex:2">
类型
</div>
<div style="flex:4">
<nz-radio-group [(ngModel)]="choiceItem.is_text" (ngModelChange)="saveItem()" >
<label nz-radio [nzValue]="true">文字</label>
<label nz-radio [nzValue]="false">图片</label>
</nz-radio-group>
</div>
</div>
<div *ngIf="choiceItem.is_text != false">
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
文字
</div>
<div style="flex:5">
<input type="text" nz-input placeholder="" [(ngModel)]="choiceItem.word" (blur)="saveItem()" />
</div>
</div>
</div>
<div *ngIf="choiceItem.is_text == false">
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
图片
</div>
<div style="flex:5">
<app-upload-image-with-preview style="width: 100%;" [picUrl]="choiceItem.pic_url" (imageUploaded)="onImageUploadSuccess($event, choiceItem, 'pic_url')"></app-upload-image-with-preview>
</div>
</div>
</div>
<div style="display: flex; margin-bottom: 10px;">
<div style="flex:1">
音频
</div>
<div style="flex:5">
<app-audio-recorder [audioUrl]="choiceItem.audio_url" (audioUploaded)="onAudioUploadSuccess($event, choiceItem, 'audio_url')" ></app-audio-recorder>
</div>
</div>
<div *ngIf="choiceIndex>-1" style="text-align: center;">
<button style="margin-top: 10px;" nz-button nzType="danger" (click)="delOption(i, choiceIndex)" >
<span>删除此选项</span>
</button>
</div>
</div>
</div>
</div>
<!-- <div class="card-item" style="padding: 0.5vw;" >
<button nz-button nzType="primary" class="add-btn" (click)="addOption(i)">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
新建选项
</button>
</ng-template>
</div>
</div> -->
</div>
</div>
</div>
<nz-divider nzText="选项" nzOrientation="left"></nz-divider>
<div nz-row>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="add-btn" nzNoColon=true>选项</nz-form-label>
<nz-form-control [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='6'>
<button nz-button nzType="dashed" class="add-btn" id="sheep-add-btn" (click)="addOption()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>添加
</button>
<nz-form-item>
<nz-form-label> 图片:最佳尺寸为258*174像素</nz-form-label>
</nz-form-item>
</nz-form-control>
</nz-form-item>
<div class="card-item" style="padding: 0.5vw;" >
<button nz-button nzType="primary" class="add-btn" (click)="addKind()">
<i nz-icon nzType="plus-circle" nzTheme="outline"></i>
新建分组
</button>
</div>
<div nz-row>
<div *ngFor="let data of item.options;let i = index" style="margin: 1vw;">
<div nz-col [nzXs]='24' [nzSm]='12' [nzMd]='12' [nzLg]='6'>
<nz-card nzTitle="选项-{{i + 1}}" [nzExtra]="extraTemplate" style="height: 400px; margin: 1vw;">
<nz-form-item>
<nz-form-label [nzSpan]="6">分组</nz-form-label>
<nz-form-control [nzSpan]="12">
<nz-select [(ngModel)]="data.kind_id" (ngModelChange)="setKindID($event, data)" style="width:150px" nzAllowClear>
<nz-option *ngFor="let o of item.kinds let j = index" [nzValue]="o.id" [nzLabel]="'分组-'+(j+1) +'('+o.word + ')'"></nz-option>
</nz-select>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="{{i}}.word">文本</nz-form-label>
<nz-form-control [nzSpan]="12">
<input nz-input type="text" id="{{i}}.word" placeholder="请录入内容" [(ngModel)]="data.word" (blur)="save()">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzFor="{{i}}.pic_url">图片</nz-form-label>
<nz-form-control [nzSpan]="12">
<app-upload-image-with-preview style="width: 100%" [picUrl]="data.pic_url"
(imageUploaded)="onImageUploadSuccess($event, data, 'pic_url')"></app-upload-image-with-preview>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="6" nzNoColon=true>声音</nz-form-label>
<nz-form-control [nzSpan]="18">
<app-audio-recorder [audioUrl]="data.audio_url"
(audioUploaded)="onAudioUploadSuccess($event, data, 'audio_url')">
</app-audio-recorder>
</nz-form-control>
</nz-form-item>
</nz-card>
<ng-template #extraTemplate>
<button style="margin: 10px;" nz-button nzType="danger" (click)="delOption(i)">
<span>删除</span>
</button>
</ng-template>
</div>
</div>
</div>
</div>
</nz-card>
</div>
\ No newline at end of file
</div>
@import "../style/common_mixin";
.model-content {
.card-config {
width: 100%;
height: 100%;
margin-left: 10px;
display: flex;
flex-wrap: wrap;
.card-item{
flex:1;
.border {
border-radius: 20px;
border-style: dashed;
padding:20px;
width: 800px;
}
.card-item-content{
.title {
font-size: 24px;
width: 100%;
text-align: center;
}
.section{
border-top: 1px solid ;
padding: 10px 0;
.section-title{
font-size: 24px;
width: 100%;
}
.section-content{
display: flex;
margin: 5px 0 10px 0;
}
}
.pic-sound-box {
width: 50%;
display: flex;
flex-direction: column;
}
.add-btn-box {
display: flex;
align-items: center;
justify-content: center;
height: 20vw;
padding: 10px;
padding-top: 5vw;
}
}
}
}
}
import { Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef } from '@angular/core';
import {Component, EventEmitter, Input, OnDestroy, OnChanges, OnInit, Output, ApplicationRef, ChangeDetectorRef} from '@angular/core';
import { Star, Page, Kind, Option, East10 } from './east10';
import { ThrowStmt } from '@angular/compiler';
import { JsonPipe } from '@angular/common';
@Component({
selector: 'app-form',
templateUrl: './form.component.html',
styleUrls: ['./form.component.css']
styleUrls: ['./form.component.scss']
})
export class FormComponent implements OnInit, OnChanges, OnDestroy {
// 储存数据用
saveKey = "EAST-10";
// 储存对象
item;
@Output()
update = new EventEmitter();
constructor(private appRef: ApplicationRef, private changeDetectorRef: ChangeDetectorRef) {
}
ngOnInit() {
//this.item = new Course();
......@@ -32,26 +34,26 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
if (data) {
this.item = data;
this.preData();
}
console.log(data);
//console.log(data);
this.init();
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
}, this.saveKey);
console.log(this.item);
//console.log(this.item);
}
ngOnChanges() {
}
ngOnDestroy() {
}
init() {
if(!this.item){
this.item = new East10();
......@@ -59,44 +61,79 @@ export class FormComponent implements OnInit, OnChanges, OnDestroy {
}
/**
* 储存图片数据
* @param e
*/
initData() {
}
onImageUploadSuccess(e, item, key) {
item[key] = e.url;
this.save();
}
}
onAudioUploadSuccess(e, item, key) {
item[key] = e.url;
this.save();
}
/**
* 储存音频数据
* @param e
*/
onAudioUploadSuccess(e, item, key) {
item[key] = e.url;
this.save();
}
radioClick(it, radioValue) {
it.radioValue = radioValue;
this.saveItem();
}
clickCheckBox() {
this.saveItem();
}
saveItem() {
this.save();
}
/**
* 储存数据
*/
save() {
(<any>window).courseware.setData(this.item, null, this.saveKey);
this.refresh();
console.log('this.item = ' + JSON.stringify(this.item));
}
/**
* 刷新 渲染页面
*/
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
preData(){
let options = this.item.options;
if (!options || options.length <= 0)
return;
for(let i = 0; i < options.length; i++){
if (!options[i].is_text != true && !options[i].is_text != false){
options[i].is_text = true;
}
for(let j = 0; j < this.item.kinds; j++){
if (!this.item.kinds[j].is_text != true && !this.item.kinds[j].is_text != false){
this.item.kinds[j].is_text = true;
}
if (options[i].kind_id == this.item.kinds[j].id){
if (!this.item.kinds[j].options){
this.item.kinds[j].options = new Array<Option>();
}
this.item.kinds[j].options.push(options[i]);
break;
}
}
}
this.item.options = null;
}
randomChar() {
var x = "0123456789qwertyuioplkjhgfdsazxcvbnm";
var tmp = "";
......@@ -138,6 +175,9 @@ onAudioUploadSuccess(e, item, key) {
addKind(){
let kind = new Kind();
kind.options = new Array<Option>();
kind.is_disturb = false;
kind.is_text = true;
kind.id = this.randomChar();
this.item.kinds.push(kind);
this.save();
......@@ -150,15 +190,26 @@ onAudioUploadSuccess(e, item, key) {
}
}
addOption(){
addOption(kind_id){
if (kind_id < 0 || kind_id >= this.item.kinds.length){
return;
}
let option = new Option();
this.item.options.push(option);
option.is_text = true;
if (!this.item.kinds[kind_id].options)
this.item.kinds[kind_id].options = new Array<Option>();
this.item.kinds[kind_id].options.push(option);
this.save();
}
delOption(idx){
if (idx !== -1){
this.item.options.splice(idx, 1);
delOption(kind_id, idx){
if (kind_id < 0 || kind_id >= this.item.kinds.length)
return;
if (idx !== -1){
this.item.kinds[kind_id].options.splice(idx, 1);
this.save();
}
}
......@@ -178,19 +229,5 @@ onAudioUploadSuccess(e, item, key) {
this.save();
}
// getIndexInArray(ar, id){
// for(let i = 0; i < ar.length; i++){
// if (ar[i].id == id){
// return i;
// }
// }
// return -1;
// }
// getStarPage(kind){
// let star_id = -1, page_id = this.getIndexInArray(this.item.pages, kind.page_id);
// if (page_id >= 0)
// star_id = this.getIndexInArray(this.item.stars, this.item.pages[page_id].star_id);
// }
}
{
"__type__": "cc.AnimationClip",
"_name": "blink",
"_objFlags": 0,
"_native": "",
"_duration": 0.35,
"sample": 60,
"speed": 1,
"wrapMode": 1,
"curveData": {
"comps": {
"cc.Sprite": {
"spriteFrame": [
{
"frame": 0,
"value": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
}
},
{
"frame": 0.08333333333333333,
"value": {
"__uuid__": "6602e0ef-5cd0-4ad3-ba55-c8da54251a0b"
}
},
{
"frame": 0.16666666666666666,
"value": {
"__uuid__": "04b220cf-1b02-4dcc-877a-ce7da5ac4bc0"
}
},
{
"frame": 0.25,
"value": {
"__uuid__": "f5fce9c2-6845-4c54-b49b-41a64abea47f"
}
},
{
"frame": 0.3333333333333333,
"value": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
}
}
]
}
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.0",
"uuid": "539e8c8e-333b-41fd-b662-796c0bdc8fd0",
"subMetas": {}
}
\ No newline at end of file
......@@ -17,16 +17,16 @@
"__id__": 2
},
{
"__id__": 157
"__id__": 164
},
{
"__id__": 170
"__id__": 177
},
{
"__id__": 38
},
{
"__id__": 176
"__id__": 183
}
],
"_active": false,
......@@ -104,9 +104,6 @@
{
"__id__": 28
},
{
"__id__": 128
},
{
"__id__": 135
},
......@@ -117,19 +114,22 @@
"__id__": 149
},
{
"__id__": 150
"__id__": 156
},
{
"__id__": 157
}
],
"_active": true,
"_components": [
{
"__id__": 154
"__id__": 161
},
{
"__id__": 155
"__id__": 162
},
{
"__id__": 156
"__id__": 163
}
],
"_prefab": null,
......@@ -1388,7 +1388,7 @@
"_active": true,
"_components": [
{
"__id__": 127
"__id__": 134
}
],
"_prefab": null,
......@@ -1598,7 +1598,7 @@
"_contentSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 309
"height": 150
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -1675,7 +1675,7 @@
"_layoutSize": {
"__type__": "cc.Size",
"width": 1280,
"height": 309
"height": 150
},
"_resize": 0,
"_N$layoutType": 1,
......@@ -1709,8 +1709,8 @@
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": -309,
"_bottom": 0,
"_top": -229.5,
"_bottom": 79.5,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
......@@ -1760,19 +1760,19 @@
"__id__": 114
},
{
"__id__": 120
"__id__": 127
},
{
"__id__": 122
"__id__": 129
}
],
"_active": true,
"_components": [
{
"__id__": 125
"__id__": 132
},
{
"__id__": 126
"__id__": 133
}
],
"_prefab": null,
......@@ -5010,7 +5010,7 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_alignFlags": 4,
"_left": -19,
"_right": 0,
"_top": 194.5,
......@@ -5183,7 +5183,7 @@
"_N$string": "Dinosaur",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": true,
"_enableWrapText": false,
"_N$file": {
"__uuid__": "5fdf5285-bbd9-4c4b-b967-c8f369eb56ca"
},
......@@ -5336,7 +5336,7 @@
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_alignFlags": 4,
"_left": -27,
"_right": 0,
"_top": 252.5,
......@@ -5363,15 +5363,30 @@
"_children": [
{
"__id__": 115
},
{
"__id__": 117
},
{
"__id__": 119
},
{
"__id__": 121
}
],
"_active": true,
"_components": [
{
"__id__": 118
"__id__": 123
},
{
"__id__": 119
"__id__": 124
},
{
"__id__": 125
},
{
"__id__": 126
}
],
"_prefab": null,
......@@ -5424,19 +5439,16 @@
},
{
"__type__": "cc.Node",
"_name": "Background",
"_objFlags": 512,
"_name": "btn_laba1",
"_objFlags": 0,
"_parent": {
"__id__": 114
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 116
},
{
"__id__": 117
}
],
"_prefab": null,
......@@ -5485,7 +5497,7 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "f0mWtX1xJJ1LFj/+Ka6QNZ"
"_id": "50hp1nabtAUb1t+5h37LVw"
},
{
"__type__": "cc.Sprite",
......@@ -5503,10 +5515,10 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
"__uuid__": "6602e0ef-5cd0-4ad3-ba55-c8da54251a0b"
},
"_type": 1,
"_sizeMode": 0,
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
......@@ -5517,156 +5529,20 @@
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "b7AHg6HxVNa4NhQ5pQgCdV"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 115
},
"_enabled": true,
"alignMode": 0,
"_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": 100,
"_originalHeight": 40,
"_id": "9c01ORK2JEiZWZE9g0Sg+I"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 115
},
"_id": "e0mhGmRlRMfLPZO0bKDTQn"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 0,
"_right": 0,
"_top": -24.232000000000014,
"_bottom": -45,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 66,
"_id": "67jB//RBxDhYhhTInLsmAC"
"_id": "76/V33S6BJ0LdQDgHcYrhc"
},
{
"__type__": "cc.Node",
"_name": "show_node",
"_name": "btn_laba2",
"_objFlags": 0,
"_parent": {
"__id__": 37
"__id__": 114
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 121
"__id__": 118
}
],
"_prefab": null,
......@@ -5680,8 +5556,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
"width": 63,
"height": 66
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -5715,54 +5591,496 @@
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "6eRi2gOSxBco2GyIGV1H6D"
"_id": "56GBc3wbxNx7ubzysYzugL"
},
{
"__type__": "cc.Widget",
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 120
"__id__": 117
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 18,
"_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": "b1SuZ57mxGGKy5kVHfSz4m"
},
{
"__type__": "cc.Node",
"_name": "db_correct",
"_objFlags": 0,
"_parent": {
"__id__": 37
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 123
},
"_materials": [
{
"__id__": 124
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_prefab": null,
"_opacity": 255,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "04b220cf-1b02-4dcc-877a-ce7da5ac4bc0"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "76IunnV6VE/KmUNkHWlJoV"
},
{
"__type__": "cc.Node",
"_name": "btn_laba3",
"_objFlags": 0,
"_parent": {
"__id__": 114
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 120
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 63,
"height": 66
},
"_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": "5dClTa2e1BBLaOZ6JzdGhJ"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 119
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "f5fce9c2-6845-4c54-b49b-41a64abea47f"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "818FXqwmhLB7OC5VbC4n92"
},
{
"__type__": "cc.Node",
"_name": "btn_laba",
"_objFlags": 0,
"_parent": {
"__id__": 114
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 122
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 63,
"height": 66
},
"_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": "fdv2o6pRBOZLnqbRKpxG2Q"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 121
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "2fLAP/KwpNu6H5BBlvkJ6y"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 230,
"g": 230,
"b": 230,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 200,
"g": 200,
"b": 200,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 120,
"g": 120,
"b": 120,
"a": 200
},
"_N$normalSprite": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
},
"_N$pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"pressedSprite": {
"__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
},
"_N$hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"hoverSprite": {
"__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
},
"_N$disabledSprite": {
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 114
},
"_id": "e0mhGmRlRMfLPZO0bKDTQn"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": 0,
"_right": 0,
"_top": -24.232000000000014,
"_bottom": -45,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 66,
"_id": "67jB//RBxDhYhhTInLsmAC"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "539e8c8e-333b-41fd-b662-796c0bdc8fd0"
},
"_clips": [
{
"__uuid__": "539e8c8e-333b-41fd-b662-796c0bdc8fd0"
}
],
"playOnLoad": false,
"_id": "a6tM8XdFxFDJSEJ3iW63o+"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 114
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "30bb9bba-6500-4164-a63c-0ca87c923727"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "2blRDlYi1APJFANVdwuX+j"
},
{
"__type__": "cc.Node",
"_name": "show_node",
"_objFlags": 0,
"_parent": {
"__id__": 37
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 128
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "6eRi2gOSxBco2GyIGV1H6D"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 127
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 18,
"_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": "b1SuZ57mxGGKy5kVHfSz4m"
},
{
"__type__": "cc.Node",
"_name": "db_correct",
"_objFlags": 0,
"_parent": {
"__id__": 37
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 130
},
{
"__id__": 131
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
......@@ -5814,7 +6132,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 122
"__id__": 129
},
"_enabled": true,
"_materials": [
......@@ -5854,7 +6172,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 122
"__id__": 129
},
"_enabled": true,
"alignMode": 1,
......@@ -5920,7 +6238,7 @@
"__id__": 97
},
"btn_sound": {
"__id__": 118
"__id__": 123
},
"tips_text_bg": {
"__id__": 107
......@@ -5929,10 +6247,10 @@
"__id__": 100
},
"show_node": {
"__id__": 120
"__id__": 127
},
"animate_node": {
"__id__": 122
"__id__": 129
},
"_id": "c9qKhRAYhDn4CMZDd11frs"
},
......@@ -5972,13 +6290,13 @@
},
"_children": [
{
"__id__": 129
"__id__": 136
}
],
"_active": true,
"_components": [
{
"__id__": 134
"__id__": 141
}
],
"_prefab": null,
......@@ -6034,20 +6352,20 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 128
"__id__": 135
},
"_children": [
{
"__id__": 130
"__id__": 137
}
],
"_active": true,
"_components": [
{
"__id__": 132
"__id__": 139
},
{
"__id__": 133
"__id__": 140
}
],
"_prefab": null,
......@@ -6103,13 +6421,13 @@
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 129
"__id__": 136
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 131
"__id__": 138
}
],
"_prefab": null,
......@@ -6165,7 +6483,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 130
"__id__": 137
},
"_enabled": true,
"_materials": [
......@@ -6198,7 +6516,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
"__id__": 136
},
"_enabled": true,
"_materials": [
......@@ -6230,7 +6548,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 129
"__id__": 136
},
"_enabled": true,
"alignMode": 0,
......@@ -6257,7 +6575,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 128
"__id__": 135
},
"_enabled": true,
"_normalMaterial": null,
......@@ -6330,7 +6648,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 129
"__id__": 136
},
"_id": "08X/7fPaZJsYxODfLTQ3pD"
},
......@@ -6343,13 +6661,13 @@
},
"_children": [
{
"__id__": 136
"__id__": 143
}
],
"_active": true,
"_components": [
{
"__id__": 141
"__id__": 148
}
],
"_prefab": null,
......@@ -6405,20 +6723,20 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 135
"__id__": 142
},
"_children": [
{
"__id__": 137
"__id__": 144
}
],
"_active": true,
"_components": [
{
"__id__": 139
"__id__": 146
},
{
"__id__": 140
"__id__": 147
}
],
"_prefab": null,
......@@ -6474,13 +6792,13 @@
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 136
"__id__": 143
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 138
"__id__": 145
}
],
"_prefab": null,
......@@ -6536,7 +6854,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 137
"__id__": 144
},
"_enabled": true,
"_materials": [
......@@ -6569,7 +6887,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 136
"__id__": 143
},
"_enabled": true,
"_materials": [
......@@ -6601,7 +6919,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 136
"__id__": 143
},
"_enabled": true,
"alignMode": 0,
......@@ -6628,7 +6946,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 135
"__id__": 142
},
"_enabled": true,
"_normalMaterial": null,
......@@ -6701,7 +7019,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 136
"__id__": 143
},
"_id": "c9YYFUeMZEJIDtnNx+WYUc"
},
......@@ -6714,13 +7032,13 @@
},
"_children": [
{
"__id__": 143
"__id__": 150
}
],
"_active": true,
"_components": [
{
"__id__": 148
"__id__": 155
}
],
"_prefab": null,
......@@ -6776,20 +7094,20 @@
"_name": "Background",
"_objFlags": 512,
"_parent": {
"__id__": 142
"__id__": 149
},
"_children": [
{
"__id__": 144
"__id__": 151
}
],
"_active": true,
"_components": [
{
"__id__": 146
"__id__": 153
},
{
"__id__": 147
"__id__": 154
}
],
"_prefab": null,
......@@ -6845,13 +7163,13 @@
"_name": "Label",
"_objFlags": 512,
"_parent": {
"__id__": 143
"__id__": 150
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 145
"__id__": 152
}
],
"_prefab": null,
......@@ -6907,7 +7225,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 144
"__id__": 151
},
"_enabled": true,
"_materials": [
......@@ -6940,7 +7258,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 143
"__id__": 150
},
"_enabled": true,
"_materials": [
......@@ -6972,7 +7290,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 143
"__id__": 150
},
"_enabled": true,
"alignMode": 0,
......@@ -6999,7 +7317,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 142
"__id__": 149
},
"_enabled": true,
"_normalMaterial": null,
......@@ -7072,7 +7390,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 143
"__id__": 150
},
"_id": "49NDPbH/xBe5OuIIfr1l+x"
},
......@@ -7145,13 +7463,13 @@
"_active": true,
"_components": [
{
"__id__": 151
"__id__": 158
},
{
"__id__": 152
"__id__": 159
},
{
"__id__": 153
"__id__": 160
}
],
"_prefab": null,
......@@ -7207,7 +7525,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 150
"__id__": 157
},
"_enabled": true,
"_materials": [
......@@ -7237,7 +7555,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 150
"__id__": 157
},
"_enabled": true,
"_layoutSize": {
......@@ -7269,7 +7587,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 150
"__id__": 157
},
"_enabled": true,
"alignMode": 1,
......@@ -7354,22 +7672,22 @@
},
"_children": [
{
"__id__": 158
"__id__": 165
},
{
"__id__": 160
"__id__": 167
},
{
"__id__": 162
"__id__": 169
},
{
"__id__": 164
"__id__": 171
},
{
"__id__": 166
"__id__": 173
},
{
"__id__": 168
"__id__": 175
}
],
"_active": true,
......@@ -7427,13 +7745,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 157
"__id__": 164
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 159
"__id__": 166
}
],
"_prefab": null,
......@@ -7489,7 +7807,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 158
"__id__": 165
},
"_enabled": true,
"_materials": [
......@@ -7521,13 +7839,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 157
"__id__": 164
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 161
"__id__": 168
}
],
"_prefab": null,
......@@ -7583,7 +7901,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 160
"__id__": 167
},
"_enabled": true,
"_materials": [
......@@ -7615,13 +7933,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 157
"__id__": 164
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 163
"__id__": 170
}
],
"_prefab": null,
......@@ -7677,7 +7995,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 162
"__id__": 169
},
"_enabled": true,
"_materials": [
......@@ -7709,13 +8027,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 157
"__id__": 164
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 165
"__id__": 172
}
],
"_prefab": null,
......@@ -7771,7 +8089,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 164
"__id__": 171
},
"_enabled": true,
"_materials": [
......@@ -7803,13 +8121,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 157
"__id__": 164
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 167
"__id__": 174
}
],
"_prefab": null,
......@@ -7865,7 +8183,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 166
"__id__": 173
},
"_enabled": true,
"_materials": [
......@@ -7897,13 +8215,13 @@
"_name": "bg_sahua",
"_objFlags": 0,
"_parent": {
"__id__": 157
"__id__": 164
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 169
"__id__": 176
}
],
"_prefab": null,
......@@ -7959,7 +8277,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 168
"__id__": 175
},
"_enabled": true,
"_materials": [
......@@ -7995,13 +8313,13 @@
},
"_children": [
{
"__id__": 171
"__id__": 178
}
],
"_active": true,
"_components": [
{
"__id__": 175
"__id__": 182
}
],
"_prefab": null,
......@@ -8057,17 +8375,17 @@
"_name": "Star",
"_objFlags": 0,
"_parent": {
"__id__": 170
"__id__": 177
},
"_children": [
{
"__id__": 172
"__id__": 179
}
],
"_active": false,
"_components": [
{
"__id__": 174
"__id__": 181
}
],
"_prefab": null,
......@@ -8123,13 +8441,13 @@
"_name": "StarBig",
"_objFlags": 0,
"_parent": {
"__id__": 171
"__id__": 178
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 173
"__id__": 180
}
],
"_prefab": null,
......@@ -8185,7 +8503,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 172
"__id__": 179
},
"_enabled": true,
"_materials": [],
......@@ -8213,7 +8531,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 171
"__id__": 178
},
"_enabled": true,
"_materials": [
......@@ -8245,7 +8563,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 170
"__id__": 177
},
"_enabled": true,
"_materials": [
......@@ -8281,22 +8599,22 @@
},
"_children": [
{
"__id__": 177
"__id__": 184
},
{
"__id__": 179
"__id__": 186
},
{
"__id__": 183
"__id__": 190
},
{
"__id__": 185
"__id__": 192
}
],
"_active": true,
"_components": [
{
"__id__": 190
"__id__": 197
}
],
"_prefab": null,
......@@ -8352,13 +8670,13 @@
"_name": "bg_picture1-finish",
"_objFlags": 0,
"_parent": {
"__id__": 176
"__id__": 183
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 178
"__id__": 185
}
],
"_prefab": null,
......@@ -8414,7 +8732,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 177
"__id__": 184
},
"_enabled": true,
"_materials": [
......@@ -8446,17 +8764,17 @@
"_name": "bg_picture1",
"_objFlags": 0,
"_parent": {
"__id__": 176
"__id__": 183
},
"_children": [
{
"__id__": 180
"__id__": 187
}
],
"_active": true,
"_components": [
{
"__id__": 182
"__id__": 189
}
],
"_prefab": null,
......@@ -8512,13 +8830,13 @@
"_name": "pic",
"_objFlags": 0,
"_parent": {
"__id__": 179
"__id__": 186
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 181
"__id__": 188
}
],
"_prefab": null,
......@@ -8574,7 +8892,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 180
"__id__": 187
},
"_enabled": true,
"_materials": [
......@@ -8606,7 +8924,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 179
"__id__": 186
},
"_enabled": true,
"_materials": [
......@@ -8638,13 +8956,13 @@
"_name": "bg_word1-finish",
"_objFlags": 0,
"_parent": {
"__id__": 176
"__id__": 183
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 184
"__id__": 191
}
],
"_prefab": null,
......@@ -8700,7 +9018,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 183
"__id__": 190
},
"_enabled": true,
"_materials": [
......@@ -8732,17 +9050,17 @@
"_name": "bg_word1",
"_objFlags": 0,
"_parent": {
"__id__": 176
"__id__": 183
},
"_children": [
{
"__id__": 186
"__id__": 193
}
],
"_active": true,
"_components": [
{
"__id__": 189
"__id__": 196
}
],
"_prefab": null,
......@@ -8798,16 +9116,16 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 185
"__id__": 192
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 187
"__id__": 194
},
{
"__id__": 188
"__id__": 195
}
],
"_prefab": null,
......@@ -8863,7 +9181,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 186
"__id__": 193
},
"_enabled": true,
"_materials": [
......@@ -8898,7 +9216,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 186
"__id__": 193
},
"_enabled": true,
"alignMode": 1,
......@@ -8925,7 +9243,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 185
"__id__": 192
},
"_enabled": true,
"_materials": [
......@@ -8957,26 +9275,26 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 176
"__id__": 183
},
"_enabled": true,
"pic_node": {
"__id__": 179
"__id__": 186
},
"pic_finish": {
"__id__": 177
"__id__": 184
},
"pic": {
"__id__": 181
"__id__": 188
},
"word_node": {
"__id__": 185
"__id__": 192
},
"word_finish": {
"__id__": 183
"__id__": 190
},
"word": {
"__id__": 187
"__id__": 194
},
"_id": "8dsxiyZ1dGt6uZJDUodj+3"
}
......
......@@ -81,16 +81,21 @@ cc.Class({
for(let k = 0; k < kinds.length; k++){
let _kind = {};
data[i][j][k] = _kind;
_kind.text = kinds[k].word||"";
_kind.pic = kinds[k].pic_url||"";
_kind.text = kinds[i].is_text == false?"":kinds[k].word||"";
_kind.pic = kinds[i].is_text == false?kinds[k].pic_url||"":"";
_kind.audio = kinds[k].audio_url||"";
if (kinds[i].is_disturb){
_kind.text = "";
_kind.pic = "";
_kind.audio = "";
}
_kind.options = [];
let options = this.getArrayByID(res.options, kinds[k].id, 'kind_id');
let options = kinds[k].options//this.getArrayByID(res.options, kinds[k].id, 'kind_id');
for(let m = 0; m < options.length; m++){
let _option = {};
_kind.options[m] = _option;
_option.text = options[m].word||"";
_option.pic = options[m].pic_url||"";
_option.text = options[m].is_text == false?"":options[m].word||"";
_option.pic = options[m].is_text == false?options[m].pic_url||"":"";
_option.audio = options[m].audio_url||"";
}
}
......@@ -241,12 +246,12 @@ cc.Class({
let option = option_node.getComponent(cc.js.getClassByName('WordOption'));
if (this._touched != true && cc.rect(option_node.getBoundingBoxToWorld()).contains(event.touch._point)){
this.playAudioByName('tap');
cc.tween(this)
.delay(0.2)
.call(()=>{
// cc.tween(this)
// .delay(0.2)
// .call(()=>{
option.playAudio();
})
.start();
// })
// .start();
//this._moved = false;
this._touched = true;
selected.copyValues(option);
......@@ -302,18 +307,16 @@ cc.Class({
let ot = node.getComponent(cc.js.getClassByName('WordOption'));
ot.copyValues(selected);
ot.selected(true);
//node.width *= 0.4;
//node.height *= 0.4;
kind.showCorrect(node, ()=>{
if (this.tryFinish())
this.pageFinish();
});
cc.tween(this)
.delay(0.2)
.call(()=>{
// cc.tween(this)
// .delay(0.2)
// .call(()=>{
ot.playAudio();
})
.start();
// })
// .start();
selected.target.removeFromParent();
selected.target = null;
......@@ -364,8 +367,10 @@ cc.Class({
upForeground(cb){
let fg = cc.find('Canvas/fg');
let fg_top = cc.find('Canvas/fg_top').y;
let fg_bottom = fg_top - 260;
let fg_top = -this._frameSize.height/2-150;
let fg_bottom = fg_top - 160 * this._frameSize.width /1280;
console.log('bottom = ' + fg_bottom);
fg.y = fg_bottom;
this.playAudioByName('up');
cc.tween(fg)
......@@ -379,8 +384,8 @@ cc.Class({
downForeground(cb){
let fg = cc.find('Canvas/fg');
let fg_top = cc.find('Canvas/fg_top').y;
let fg_bottom = fg_top - 260;
let fg_top = -this._frameSize.height/2-150;
let fg_bottom = fg_top - 160 * this._frameSize.width /1280;
fg.y = fg_top;
cc.tween(fg)
.to(0.3, {y :fg_bottom})
......
export const defaultData = {
"stars":[{"id":"16239922308635wok5p"},{"id":"1623992233278l9trhw"}],"pages":[{"id":"1623992235665ryt80q","star_id":"16239922308635wok5p"},{"id":"1623992246832rwwxwc","star_id":"16239922308635wok5p"},{"id":"162399224768148xblq","star_id":"1623992233278l9trhw"},{"id":"1624169541137z3l0l8","star_id":"1623992233278l9trhw"}],"kinds":[{"id":"1623981972242lokdmj","word":"aaa","page_id":"1623992235665ryt80q","pic_url":"http://staging-teach.cdn.ireadabc.com/9fe5243645c4d48f5ccddcac67e1808e.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/dd360bbbcf5817eea26ac5fa3341ef5d.mp3"},{"id":"1623988481981dyiqg7","word":"bbb","page_id":"1623992235665ryt80q","pic_url":"http://staging-teach.cdn.ireadabc.com/7c1537fcf875cc782235ddebfa0d5d72.jpg"},{"id":"162417027477500qwmy","word":"","page_id":"1623992235665ryt80q"},{"id":"1624170275274l1s0xq","word":"ddd","page_id":"1623992246832rwwxwc"},{"id":"16241702766879192s4","word":"eee","page_id":"1623992246832rwwxwc"},{"id":"1624170277020xpdwcp","word":"","page_id":"1623992246832rwwxwc"},{"id":"1624227738503to7kx2","page_id":"162399224768148xblq","word":"fff"},{"id":"1624227738776v99r1v","page_id":"162399224768148xblq","word":"ggg"},{"id":"1624227740414bof8zt","page_id":"162399224768148xblq","word":""},{"id":"1624227741225xhhzbp","page_id":"1624169541137z3l0l8","word":"kkk"},{"id":"162422774153338vuvx","page_id":"1624169541137z3l0l8","word":"lll"},{"id":"1624227741787cdi54f","page_id":"1624169541137z3l0l8","word":""}],"options":[{"kind_id":"1623981972242lokdmj","word":"a1","pic_url":"http://staging-teach.cdn.ireadabc.com/9475b713f231acb63a2f1defa1c358d8.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/738ef124b1882d10b31d59fb2fbd7eb7.mp3"},{"kind_id":"1623981972242lokdmj","word":"a2","pic_url":"http://staging-teach.cdn.ireadabc.com/7e6859583e7cce173d500021d164be4a.jpg","audio_url":"http://staging-teach.cdn.ireadabc.com/f228f396d2007fc20ab07763ebeda22e.mp3"},{"kind_id":"1623981972242lokdmj","word":"a3","pic_url":"http://staging-teach.cdn.ireadabc.com/e0e3c605b5c4136569c7468352fcd10d.jpg"},{"kind_id":"1623988481981dyiqg7","word":"b1","pic_url":"http://staging-teach.cdn.ireadabc.com/6c04a4211a3664f64dcda68f027f1f40.jpeg"},{"kind_id":"1623988481981dyiqg7","word":"b2"},{"kind_id":"1623988481981dyiqg7","word":"b3"},{"kind_id":"162417027477500qwmy","word":"fff"},{"kind_id":"162417027477500qwmy","word":"rrr"},{"kind_id":"1624170275274l1s0xq","word":"d1"},{"kind_id":"1624170275274l1s0xq","word":"d2"},{"kind_id":"1624170275274l1s0xq","word":"d3"},{"kind_id":"16241702766879192s4","word":"e1"},{"kind_id":"16241702766879192s4","word":"e2"},{"kind_id":"16241702766879192s4","word":"e3"},{"kind_id":"1624170277020xpdwcp","word":"we"},{"kind_id":"1624170277020xpdwcp","word":"eewr"},{"kind_id":"1624227738503to7kx2","word":"f1"},{"kind_id":"1624227738503to7kx2","word":"f2"},{"kind_id":"1624227738503to7kx2","word":"f3"},{"kind_id":"1624227738776v99r1v","word":"g1"},{"kind_id":"1624227738776v99r1v","word":"g2"},{"kind_id":"1624227738776v99r1v","word":"g3"},{"kind_id":"1624227740414bof8zt","word":"3434"},{"kind_id":"1624227740414bof8zt","word":"444"},{"kind_id":"1624227741225xhhzbp","word":"k1"},{"kind_id":"1624227741225xhhzbp","word":"k2"},{"kind_id":"162422774153338vuvx","word":"l1"},{"kind_id":"162422774153338vuvx","word":"l2"},{"kind_id":"1624227741787cdi54f","word":"erg3"},{"kind_id":"1624227741787cdi54f","word":"g34t"}]
}
export const defaultData =
{"stars":[{"id":"16239922308635wok5p"},{"id":"1623992233278l9trhw"}],"pages":[{"id":"1623992235665ryt80q","star_id":"16239922308635wok5p"},{"id":"1623992246832rwwxwc","star_id":"16239922308635wok5p"},{"id":"1624506193914ksvus9","star_id":"1623992233278l9trhw"}],"kinds":[{"id":"1623981972242lokdmj","word":"aaa","page_id":"1623992235665ryt80q","pic_url":"http://staging-teach.cdn.ireadabc.com/9fe5243645c4d48f5ccddcac67e1808e.jpeg","audio_url":"http://staging-teach.cdn.ireadabc.com/dd360bbbcf5817eea26ac5fa3341ef5d.mp3","is_text":false,"options":[{"is_text":false,"audio_url":"http://staging-teach.cdn.ireadabc.com/a812f773f22fdb5fa0de04bc7979f6d7.mp3","pic_url":"http://staging-teach.cdn.ireadabc.com/9475b713f231acb63a2f1defa1c358d8.jpeg"},{"is_text":false,"audio_url":"http://staging-teach.cdn.ireadabc.com/f228f396d2007fc20ab07763ebeda22e.mp3","pic_url":"http://staging-teach.cdn.ireadabc.com/6c04a4211a3664f64dcda68f027f1f40.jpeg"}]},{"id":"1623988481981dyiqg7","word":"bbb","page_id":"1623992235665ryt80q","pic_url":"http://staging-teach.cdn.ireadabc.com/7c1537fcf875cc782235ddebfa0d5d72.jpg","is_text":false,"options":[{"is_text":true,"word":"b1"},{"is_text":false,"pic_url":"http://staging-teach.cdn.ireadabc.com/bc67a6550d9b566aa61eafc3634f752e.jpg"}]},{"options":[{"is_text":true,"word":"rrr"},{"is_text":true,"word":"tewre"}],"is_disturb":true,"is_text":true,"id":"16245126704047qu7b3","page_id":"1623992235665ryt80q"},{"options":[{"is_text":true,"word":"d1dddddddddddddd"},{"is_text":true,"word":"d2"},{"is_text":true,"word":"d3"}],"is_disturb":false,"is_text":true,"id":"1624512683708wxep60","page_id":"1623992246832rwwxwc","word":"","audio_url":"http://staging-teach.cdn.ireadabc.com/738ef124b1882d10b31d59fb2fbd7eb7.mp3"},{"options":[{"is_text":true,"word":"e1"},{"is_text":true,"word":"e2"},{"is_text":true,"word":"e3"}],"is_disturb":false,"is_text":true,"id":"1624512725657lqqj3r","page_id":"1623992246832rwwxwc","word":"eeeeeeeeeeeeeeeeeeeeeeeeeeee"},{"options":[{"is_text":true,"word":"4rt3"},{"is_text":true,"word":"435634"}],"is_disturb":true,"is_text":true,"id":"1624512754647ip8vce","page_id":"1623992246832rwwxwc"},{"options":[{"is_text":true,"word":"r1"},{"is_text":true,"word":"r2"},{"is_text":true,"word":"r3"}],"is_disturb":false,"is_text":true,"id":"16245127738549dpkjr","page_id":"1624506193914ksvus9","word":"rrrrrrrrrrrrrrrr"},{"options":[{"is_text":true,"word":"y1"},{"is_text":true,"word":"y2"},{"is_text":true,"word":"y3"}],"is_disturb":false,"is_text":true,"id":"1624512800217fvnv04","page_id":"1624506193914ksvus9","word":"yyyyyyyyyy"},{"options":[{"is_text":true,"word":"434"},{"is_text":true,"word":"43534"},{"is_text":true,"word":"43543"}],"is_disturb":false,"is_text":true,"id":"1624512822668sab0sk","page_id":"1624506193914ksvus9","word":"weewrwe"},{"options":[{"is_text":true,"word":"eeee"},{"is_text":true,"word":"ert34t"}],"is_disturb":true,"is_text":true,"id":"162451695910372kqqy","page_id":"1624506193914ksvus9","word":"werwrwe"}],"options":null,"audio_url":"http://staging-teach.cdn.ireadabc.com/f228f396d2007fc20ab07763ebeda22e.mp3"}
export const defaultData1= {
......
......@@ -55,6 +55,7 @@ cc.Class({
this.layout.spacingX = 10;
width = (1280-num*10-10) / num;
w_scale = width/273;
w_scale *= 0.8;
}
this.layout.paddingLeft *= wr;
......
import { playDragonBoneAnimation, getSpriteFrimeByUrl, playAudioByUrl,setSpriteWH } from "../script/util";
import { playDragonBoneAnimation, getSpriteFrimeByUrl, playAudioByUrl,setSpriteWH ,playAudioByUrlSync} from "../script/util";
cc.Class({
extends: cc.Component,
......@@ -32,12 +32,22 @@ cc.Class({
},
onLoad(){
this.btn_sound.node.on('click', this.playAudio.bind(this));
this.btn_sound.node.on('click',async ()=>{
await this.playAudioSync();
});
this.tips_text_bg.on('click', this.playAudio.bind(this));
this.tips_pic_bg.on('click', this.playAudio.bind(this));
this.initData();
},
async playAudioSync(){
if (this._audio && this._audio!=""){
this.speakerBlink();
await playAudioByUrlSync(this._audio);
this.speakerStopBlink();
}
},
playAudio(){
if (this._audio && this._audio!=""){
playAudioByUrl(this._audio);
......@@ -148,7 +158,18 @@ cc.Class({
item.scale *= scale;
}
}
},
speakerBlink() {
const btnSpeaker = this.btn_sound.node;
btnSpeaker.getComponent(cc.Animation).play();
},
speakerStopBlink() {
const btnSpeaker = this.btn_sound.node;
const btnSpeaker3 = btnSpeaker.getChildByName('btn_laba');
btnSpeaker.getComponent(cc.Animation).stop();
btnSpeaker.getComponent(cc.Sprite).spriteFrame = btnSpeaker3.getComponent(cc.Sprite).spriteFrame;
},
});
\ No newline at end of file
......@@ -397,4 +397,27 @@ export function onHomeworkFinish() {
} else {
console.log('onHomeworkFinish');
}
}
\ No newline at end of file
}
export function playAudioByUrlSync(audio_url) {
return new Promise((resolve, reject) => {
try {
if (!audio_url) {
resolve();
return;
}
cc.assetManager.loadRemote(audio_url, (err, audioClip) => {
if (err) {
reject(err);
return;
}
const audioId = cc.audioEngine.play(audioClip, false, 0.8);
cc.audioEngine.setFinishCallback(audioId, () => {
resolve();
});
});
} catch (e) {
reject(e);
}
});
}
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