Commit 01ad3cbe authored by 李维's avatar 李维

修改页面布局、更新素材

parent 415d5e24
......@@ -5,7 +5,7 @@ import {
import { MyCocosSceneComponent_NJ_usercenter } from "../script/MyCocosSceneComponent_NJ_usercenter";
const { ccclass, property } = cc._decorator;
const AUTH_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicGhvbmUiOiIxNTUwMDAwMDAwMSIsInNpZ24iOiI0NDQxOWNlZi1mMzk2LTQ3YzgtYmFkNC1kZjkyMTBkMWZlYjkiLCJ1bmlfc2lnbiI6bnVsbCwiaWF0IjoxNjc1OTk2NjUwLCJleHAiOjE2Nzg1ODg2NTB9._9CqQo0OvagRxNqZVZjnu0t0NkW-_jSzoaL1UtcyoCk"
const AUTH_TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwicGhvbmUiOiIxNTUwMDAwMDAwMSIsInNpZ24iOiJjM2VjMDdkNC0wODlmLTQwYWMtOWI3MC04ZDhjOTAwZGQwNzAiLCJ1bmlfc2lnbiI6bnVsbCwiaWF0IjoxNjc2NDIzOTUwLCJleHAiOjE2NzkwMTU5NTB9.MnEgThik1V32RmPuUl7-3xy9XtLwqnYiCQfHPLtIaDc"
@ccclass
export default class SceneComponent extends MyCocosSceneComponent_NJ_usercenter {
......
......@@ -324,6 +324,27 @@ export default class NewClass extends cc.Component {
op_video_ques
} = resObj.data;
// 测试数据
// const {
// learntimes,
// recordcount,
// kn_letters,
// kn_words,
// kn_sentences,
// OP05,
// OP_06_3,
// op_video_ques
// } = {
// "learntimes": 8,
// "recordcount": 10,
// "kn_letters": "",
// "kn_words": "",
// "kn_sentences": "",
// "OP05": null,
// "op_video_ques": "{\"result\":[{\"type\":\"sound\",\"word\":\"black\",\"audio_url\":\"https://teach.cdn.ireadabc.com/a9395c62dfbecefbc4491cb23715e96a.mp3\",\"score\":0,\"title\":\"你知道什么颜色最吸热吗?\",\"pic1_url\":\"https://teach.cdn.ireadabc.com/3ee1562dd283ece5db305ca404cfd895.png\"},{\"type\":\"sound\",\"word\":\"blanket\",\"audio_url\":\"https://teach.cdn.ireadabc.com/7645406a91405f3af15ac002b57714a9.mp3\",\"score\":0,\"title\":\"What do we need to take with us?\",\"pic1_url\":\"https://teach.cdn.ireadabc.com/4f0c08e1c1b09f119d6c634f5799155b.png\"},{\"type\":\"choice\",\"is_right\":false,\"title\":\"帮助cool cat提出问题\",\"pic1_url\":\"https://teach.cdn.ireadabc.com/63066103de63416da6eee62ed563328c.png\",\"ques\":\"水把毯子弄湿了,告诉乘务人员\",\"pic2_url\":\"https://teach.cdn.ireadabc.com/d8639d7d9d4aee92202485fae75984ea.png\"}]}",
// "OP_06_3": null
// };
cc.find("Canvas/reportdetail/view/content/userdetail_scollpage/learnshow/itembg/recordbg/recordcount").getComponent(cc.Label).string = recordcount;
cc.find("Canvas/reportdetail/view/content/userdetail_scollpage/learnshow/itembg/learnbg/learntime").getComponent(cc.Label).string = learntimes;
......@@ -343,11 +364,9 @@ export default class NewClass extends cc.Component {
const part2Title = cc.find("part2_title", resultQWQDNode);
const part2Row = cc.find("part2_row", resultQWQDNode);
const part2Node = cc.find("item", part2Row);
const splitLine = cc.find("letter_split_line", resultQWQDNode);
part1Title.active = false;
part2Title.active = false;
splitLine.active = false;
let countPart1 = 0;
let countPart2 = 0;
......@@ -366,8 +385,8 @@ export default class NewClass extends cc.Component {
itemClone.height = 250;
getSpriteFrimeByUrl(item.pic1_url, (spriteFrame) => {
picNode.getComponent(cc.Sprite).spriteFrame = spriteFrame;
const sx = 300 / picNode.width;
const sy = 150 / picNode.height;
const sx = 240 / picNode.width;
const sy = 128 / picNode.height;
picNode.scale = Math.min(sx, sy);
});
}
......@@ -392,6 +411,7 @@ export default class NewClass extends cc.Component {
const subTitleNode = cc.find("subtitle", itemClone);
const pic1Node = cc.find("pic1", itemClone);
const pic2Node = cc.find("pic2", itemClone);
const audioNode = cc.find("audio/icon", itemClone);
titleNode.getComponent(cc.Label).string = item.title;
subTitleNode.getComponent(cc.Label).string = item.ques;
......@@ -399,8 +419,8 @@ export default class NewClass extends cc.Component {
itemClone.height = 250;
getSpriteFrimeByUrl(item.pic1_url, (spriteFrame) => {
pic1Node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
const sx = 300 / pic1Node.width;
const sy = 150 / pic1Node.height;
const sx = 240 / pic1Node.width;
const sy = 128 / pic1Node.height;
pic1Node.scale = Math.min(sx, sy);
});
}
......@@ -408,14 +428,19 @@ export default class NewClass extends cc.Component {
itemClone.height = 250;
getSpriteFrimeByUrl(item.pic2_url, (spriteFrame) => {
pic2Node.getComponent(cc.Sprite).spriteFrame = spriteFrame;
const sx = 300 / pic2Node.width;
const sy = 150 / pic2Node.height;
const sx = 240 / pic2Node.width;
const sy = 128 / pic2Node.height;
pic2Node.scale = Math.min(sx, sy);
// pic2Node.scale = 110 / pic2Node.width;
});
pic2Node.active = true;
audioNode.active = false;
}
if(item.audio_url) {
pic2Node.attr({audio_url: item.audio_url});
audioNode.attr({audio_url: item.audio_url});
pic2Node.active = false;
audioNode.active = true;
}
if(item.score>=80) {
......@@ -440,10 +465,6 @@ export default class NewClass extends cc.Component {
part2Title.active = true;
}
if(countPart1>0 && countPart2>0) {
splitLine.active = true;
}
resultQWQDPage.active = true;
// 设置页面高度
......@@ -476,7 +497,6 @@ export default class NewClass extends cc.Component {
if (kn_letters) {
cc.find("letter_title", resultNode).active = true;
cc.find("letter_row", resultNode).active = true;
cc.find("letter_split_line", resultNode).active = true;
const letterRow = cc.find("letter_row", resultNode);
const letterNode = cc.find("item", letterRow);
......@@ -506,7 +526,6 @@ export default class NewClass extends cc.Component {
} else {
cc.find("letter_title", resultNode).active = false;
cc.find("letter_row", resultNode).active = false;
cc.find("letter_split_line", resultNode).active = false;
}
if (kn_words) {
......@@ -663,8 +682,11 @@ export default class NewClass extends cc.Component {
// this.showTips("录音不存在");
return;
}
playAudioByUrl(node.audio_url, () => {
const script = node.getComponent("playIconAni_NJ_usercenter");
script.play();
playAudioByUrl(node.audio_url, () => {
script.stop();
})
}
......
// Learn cc.Class:
// - https://docs.cocos.com/creator/manual/en/scripting/class.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
cc.Class({
extends: cc.Component,
properties: {
// foo: {
// // ATTRIBUTES:
// default: null, // The default value will be used only when the component attaching
// // to a node for the first time
// type: cc.SpriteFrame, // optional, default is typeof default
// serializable: true, // optional, default is true
// },
// bar: {
// get () {
// return this._bar;
// },
// set (value) {
// this._bar = value;
// }
// },
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
playTween: null,
start () {
},
play() {
this.playTween = cc.tween(this.node)
.by(0.5, { scale: 0.1 })
.by(0.5, { scale: -0.1 })
.union()
.repeatForever()
.start()
},
stop() {
this.playTween.stop();
}
// update (dt) {},
});
{
"ver": "1.0.8",
"uuid": "be9da4e5-62c7-4499-916d-79e82fe49aa0",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "86e1b83f-8002-46d6-9563-76ccb05e5b55",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 110,
"height": 107,
"platformSettings": {},
"subMetas": {
"icon_voice_correctchoice": {
"ver": "1.0.4",
"uuid": "cf12bf70-e36b-4c9f-aab8-339438847798",
"rawTextureUuid": "86e1b83f-8002-46d6-9563-76ccb05e5b55",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 110,
"height": 107,
"rawWidth": 110,
"rawHeight": 107,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "898feeb0-ad2f-42b4-9e5c-691b7e248815",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 110,
"height": 54,
"platformSettings": {},
"subMetas": {
"img_task_faild": {
"ver": "1.0.4",
"uuid": "80196d4b-362a-45bc-9376-daa9618f142a",
"rawTextureUuid": "898feeb0-ad2f-42b4-9e5c-691b7e248815",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 110,
"height": 54,
"rawWidth": 110,
"rawHeight": 54,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "0e64e6de-4d7b-47f5-961c-230e6be66c95",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 110,
"height": 54,
"platformSettings": {},
"subMetas": {
"img_task_success": {
"ver": "1.0.4",
"uuid": "2846d885-9765-4c36-bcfa-84b6974cc4d2",
"rawTextureUuid": "0e64e6de-4d7b-47f5-961c-230e6be66c95",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 110,
"height": 54,
"rawWidth": 110,
"rawHeight": 54,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "aa07f234-c4d4-44ec-86ba-e192c02cbe18",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 746,
"height": 220,
"platformSettings": {},
"subMetas": {
"qwqd_item_bg_746_220": {
"ver": "1.0.4",
"uuid": "9d900d40-4a42-4ebd-9c21-f238d9b3b091",
"rawTextureUuid": "aa07f234-c4d4-44ec-86ba-e192c02cbe18",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 746,
"height": 220,
"rawWidth": 746,
"rawHeight": 220,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "d4e3dc5a-5145-428d-a8f2-7107c59a3ffc",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 746,
"height": 240,
"platformSettings": {},
"subMetas": {
"qwqd_item_bg_746_240": {
"ver": "1.0.4",
"uuid": "33c16faf-d4db-4819-8c6f-58f88420d59d",
"rawTextureUuid": "d4e3dc5a-5145-428d-a8f2-7107c59a3ffc",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 746,
"height": 240,
"rawWidth": 746,
"rawHeight": 240,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ 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