Commit 29feead2 authored by yu's avatar yu

1

parent be749228
......@@ -83,6 +83,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
@property(cc.Node)
card_box: cc.Node = null;
@property(cc.Node)
card_boximg: cc.Node = null;
@property(cc.Node)
card_img: cc.Node = null;
@property(cc.Node)
card_txt: cc.Node = null;
......@@ -163,11 +165,19 @@ export default class SceneComponent extends MyCocosSceneComponent {
let ques = Game.getIns().getList();
ques.forEach((q) => {
if(q.type == "img"){
let itemBox = cc.instantiate(this.card_boximg);
itemBox.parent = this.layout_box;
pg.view.setNetImg( cc.find("img", itemBox), q.image, { w: 190, h: 140 });
itemBox.data = q;
this.wordItams.push(itemBox);
}else{
let itemBox = cc.instantiate(this.card_box);
itemBox.parent = this.layout_box;
cc.find("desc", itemBox).getComponent(cc.Label).string = q.text;
itemBox.data = q;
this.wordItams.push(itemBox);
}
});
let qe = Game.getIns().getCardInfo();
qe.forEach((op) => {
......
......@@ -50,12 +50,16 @@ export class Item {
public pointsArr;
public text: string;
public isClick: boolean;
public type;
public image;
constructor(data, page) {
this.audio = data.audio;
this.text = data.text;
this.bgItem = data.bgItem;
this.hotZoneItemArr = data.hotZoneItemArr;
this.page = page;
this.type = data.type;
this.image = data.image || "";
this.optionList = data.options.map((o, idx) => {
return new Option(o, this.page);
......@@ -147,7 +151,7 @@ export default class Game {
public dispelCount;
public aniEnter;
public startAudio: string;
public time:number;
public time: number;
// public questionText: string;
public init(data) {
// this.question = { text: data.questionText, audio: data.questionTextAudio };
......
......@@ -22,11 +22,12 @@ export const defaultData = {
"right": false
}
],
"type": "",
"type": "img",
"text": "fruit",
"questionAudio": "",
"contentMain": "",
"contentArr": []
"contentArr": [],
"image": "http://staging-teach.cdn.ireadabc.com/a190861baa166812cc6c35faef0cfdcf.png"
}, {
"options": [{
"type": "txt",
......@@ -44,7 +45,7 @@ export const defaultData = {
"right": false
}
],
"type": "",
"type": "txt",
"text": "animal",
"questionAudio": "",
"contentMain": "",
......@@ -66,7 +67,7 @@ export const defaultData = {
"right": false
}
],
"type": "",
"type": "txt",
"text": "vegetable",
"questionAudio": "",
"contentMain": "",
......@@ -78,5 +79,8 @@ export const defaultData = {
"audioName": "",
"time": 60,
"title": "sn04-分类",
"opleng": 6
"opleng": 6,
"word_count": "0",
"sentence_count": "0",
"zi_count": "0"
}
{
"ver": "2.3.5",
"uuid": "5221020d-32e1-4d9e-a581-c1ce24770c86",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 408,
"height": 290,
"platformSettings": {},
"subMetas": {
"bg_bar_img": {
"ver": "1.0.4",
"uuid": "ef68c786-f2d4-4766-9ca2-2aa31d1968fa",
"rawTextureUuid": "5221020d-32e1-4d9e-a581-c1ce24770c86",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 408,
"height": 290,
"rawWidth": 408,
"rawHeight": 290,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
......@@ -95,7 +95,22 @@
<div class="border-solid" style="min-width: 1000px;">
<div class="word-type-title">
分类{{i+1}}
<div class=" option-text">
<div style="margin-top: 20px;">
<div class="word-type-option-title">
选项类型:
</div>
<div style="margin-top: 5px;">
<nz-radio-group [(ngModel)]="question.type" (ngModelChange)="ngChange()">
<label nz-radio nzValue="img">
<span [style]="{color:question.type=='img' ? '#169BD5':'#000'}">图片</span>
</label>
<label nz-radio nzValue="txt">
<span [style]="{color:question.type=='txt' ? '#169BD5':'#000'}">文字</span>
</label>
</nz-radio-group>
</div>
</div>
<div *ngIf="question.type=='txt'" class=" option-text">
<div class="word-input-title">
<span style="color:red;margin-left:-15px">* </span>
<span>分类文本: </span>
......@@ -103,7 +118,18 @@
<input type="text" class="input-place-red" nz-input [(ngModel)]="question.text" placeholder=""
(blur)="save()">
</div>
<div class="option-img">
<div *ngIf="question.type=='img'">
<div class="word-input-title">
图片:
</div>
<div style="width: 300px;">
<app-upload-image-with-preview [picUrl]="question.image"
(imageUploaded)="onImageUploadSuccess($event, 'image', question)">
</app-upload-image-with-preview>
</div>
</div>
</div>
<div class="word-type-option-title" style="margin-top:20px;">
选项内容:
</div>
......@@ -129,7 +155,7 @@
选项类型:
</div>
<div style="margin-top: 5px;">
<nz-radio-group [(ngModel)]="option.type" (ngModelChange)="ngChange(i,j)">
<nz-radio-group [(ngModel)]="option.type" (ngModelChange)="ngChange()">
<label nz-radio nzValue="img">
<span [style]="{color:option.type=='img' ? '#169BD5':'#000'}">图片</span>
</label>
......
......@@ -27,7 +27,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
// tipSwitch: 1,//提示功能开关
// startAudio: "",
// audioName: "",
title: "sn04-分类",
title: "分类",
time: 60,
opleng: 0,
word_count: '0',
......@@ -102,20 +102,20 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
addquestion() {
this.item.questions.push({
options: [],
type: "",
type: "txt",
text: "",
questionAudio: "",
// wordAudio: "",
// wordAudioName: "",
// audioName: "",
// questImg: "",
image: "",
contentMain: "",
contentArr: [],
});
this.updateOpleng();
this.save();
}
ngChange(i, j) {
ngChange() {
this.updateOpleng();
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