Commit 7b5a6164 authored by Li MingZhe's avatar Li MingZhe

fix: 按钮功能对调 去掉文本前后去空格功能

parent 82c6070f
...@@ -369,10 +369,10 @@ cc.Class({ ...@@ -369,10 +369,10 @@ cc.Class({
_tmpSentence.length = 0; _tmpSentence.length = 0;
} }
timePoint = hl.time; timePoint = hl.time;
_tmpSentence.push(`<color=${this.lrcPlayedColor.toHEX()}>${hl.data.trim()}</color>`) _tmpSentence.push(`<color=${this.lrcPlayedColor.toHEX()}>${hl.data}</color>`)
} else { } else {
hl.sentenceTimePhaseIndex = this.sentenceTimePhaseIndex - 1; hl.sentenceTimePhaseIndex = this.sentenceTimePhaseIndex - 1;
_tmpSentence.push(`<color=${this.lrcPlayedColor.toHEX()}>${hl.data.trim()}</color>`) _tmpSentence.push(`<color=${this.lrcPlayedColor.toHEX()}>${hl.data}</color>`)
} }
if (timePoint) { if (timePoint) {
hl.timePoint = timePoint; hl.timePoint = timePoint;
...@@ -588,7 +588,7 @@ cc.Class({ ...@@ -588,7 +588,7 @@ cc.Class({
if (sentenceIndexObj.sentence === s || !sentenceIndexObj.sentence ) { if (sentenceIndexObj.sentence === s || !sentenceIndexObj.sentence ) {
sentenceIndexObj.sentenceIndex++; sentenceIndexObj.sentenceIndex++;
if (this._lrcData[sentenceIndexObj.sentenceIndex]) { if (this._lrcData[sentenceIndexObj.sentenceIndex]) {
sentenceIndexObj.sentence = this._lrcData[sentenceIndexObj.sentenceIndex].data.trim(); sentenceIndexObj.sentence = this._lrcData[sentenceIndexObj.sentenceIndex].data;
} }
return; return;
} }
...@@ -723,33 +723,33 @@ cc.Class({ ...@@ -723,33 +723,33 @@ cc.Class({
} }
const playedColor = this.getPlayedColor(); const playedColor = this.getPlayedColor();
let played = this._playedContent.map((line, idx) => { let played = this._playedContent.map((line, idx) => {
let words = `<color=${playedColor} param="${line.sentenceTimePhaseIndex}">${line.data.trim()}</color>`; let words = `<color=${playedColor} param="${line.sentenceTimePhaseIndex}">${line.data}</color>`;
// let words = `<color=${this.lrcPlayedColor.toHEX()} click="clickPlay" param="${line.sentenceTimePhaseIndex}">${line.data.trim()}</color>`; // let words = `<color=${this.lrcPlayedColor.toHEX()} click="clickPlay" param="${line.sentenceTimePhaseIndex}">${line.data}</color>`;
if (line.newLine) { if (line.newLine) {
words = `${words.trim()}${LINE_BEAKER}`; words = `${words}${LINE_BEAKER}`;
} }
return words; return words;
}) })
const playingColor = this.getPlayingColor(); const playingColor = this.getPlayingColor();
let playing = this._playingContent.map((line, idx) => { let playing = this._playingContent.map((line, idx) => {
let words = `<color=${playingColor} param="${line.sentenceTimePhaseIndex}">${line.data.trim()}</color>`; let words = `<color=${playingColor} param="${line.sentenceTimePhaseIndex}">${line.data}</color>`;
// let words = `<color=${this.lrcPlayingColor.toHEX()} click="clickPlay" param="${line.sentenceTimePhaseIndex}">${line.data.trim()}</color>`; // let words = `<color=${this.lrcPlayingColor.toHEX()} click="clickPlay" param="${line.sentenceTimePhaseIndex}">${line.data}</color>`;
if (line.newLine) { if (line.newLine) {
words = `${words.trim()}${LINE_BEAKER}`; words = `${words}${LINE_BEAKER}`;
} }
return words; return words;
}) })
// if (playing.startsWith(LINE_BEAKER)) { // if (playing.startsWith(LINE_BEAKER)) {
// playing = playing.substr(LINE_BEAKER.length); // playing = playing.substr(LINE_BEAKER.length);
// } // }
// if (!playing.trim()) { // if (!playing) {
// playing = `${playing} ` // playing = `${playing} `
// } // }
let remained = this._remainContent.map((line, idx) => { let remained = this._remainContent.map((line, idx) => {
let words = `<color=${this.lrcBgColor.toHEX()} param="${line.sentenceTimePhaseIndex}">${line.data.trim()}</color>`; let words = `<color=${this.lrcBgColor.toHEX()} param="${line.sentenceTimePhaseIndex}">${line.data}</color>`;
if (line.newLine) { if (line.newLine) {
words = `${words.trim()}${LINE_BEAKER}`; words = `${words}${LINE_BEAKER}`;
} }
return words; return words;
}) })
...@@ -777,7 +777,7 @@ cc.Class({ ...@@ -777,7 +777,7 @@ cc.Class({
setTitleText(lineArr) { setTitleText(lineArr) {
if (lineArr[0]) { if (lineArr[0]) {
// `<color=${this.lrcBgColor.toHEX()} param="${line.sentenceTimePhaseIndex}">${line.data.trim()}</color>` // `<color=${this.lrcBgColor.toHEX()} param="${line.sentenceTimePhaseIndex}">${line.data}</color>`
lineArr[0] = lineArr[0].replace(/b0445e/, "f24443") lineArr[0] = lineArr[0].replace(/b0445e/, "f24443")
lineArr[0] = `<size=50>${lineArr[0]}<br/></size>` lineArr[0] = `<size=50>${lineArr[0]}<br/></size>`
......
...@@ -331,7 +331,7 @@ cc.Class({ ...@@ -331,7 +331,7 @@ cc.Class({
this.musicBtn.btnOn.active = true; this.musicBtn.btnOn.active = true;
this.singBtn.btnOn.active = false; this.singBtn.btnOn.active = false;
this.setItemsPlayMode('mode1'); this.setItemsPlayMode('mode3');
} else { } else {
this.isMusicType = false; this.isMusicType = false;
...@@ -339,7 +339,7 @@ cc.Class({ ...@@ -339,7 +339,7 @@ cc.Class({
this.musicBtn.btnOn.active = false; this.musicBtn.btnOn.active = false;
this.singBtn.btnOn.active = true; this.singBtn.btnOn.active = true;
this.setItemsPlayMode('mode3'); this.setItemsPlayMode('mode1');
} }
}, },
......
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