no message

cyl/master
jscyl13849007907 1 week ago
parent f2ca6d240d
commit 0fa526768a

@ -324,9 +324,7 @@ export default {
let notice = uni.getStorageSync("miniApp-info").notice; let notice = uni.getStorageSync("miniApp-info").notice;
var reg = /[\r\n]/g; var reg = /[\r\n]/g;
notice = notice.replace(reg, ""); notice = notice.replace(reg, "");
that.noticList = []; that.noticList = [notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice,notice];
// that.noticList = notice;
that.noticList.push(notice);
that.showNotic = "play"; that.showNotic = "play";
} }
console.log("that.noticList", that.noticList); console.log("that.noticList", that.noticList);
@ -384,9 +382,7 @@ export default {
let notice = uni.getStorageSync("miniApp-info").notice; let notice = uni.getStorageSync("miniApp-info").notice;
var reg = /[\r\n]/g; var reg = /[\r\n]/g;
notice = notice.replace(reg, ""); notice = notice.replace(reg, "");
that.noticList = []; that.noticList = [notice, notice];
// that.noticList = notice;
that.noticList.push(notice);
that.showNotic = "play"; that.showNotic = "play";
} }
console.log("that.noticList", that.noticList); console.log("that.noticList", that.noticList);

@ -118,14 +118,21 @@ export default {
boxWidth: 0, // boxWidth: 0, //
animationDuration: '10s', // animationDuration: '10s', //
animationPlayState: 'paused', // animationPlayState: 'paused', //
showText: '' // showText: '', //
originalText: '' //
}; };
}, },
watch: { watch: {
list: { list: {
immediate: true, immediate: true,
handler(val) { handler(val) {
this.showText = val.join(''); if (val.length > 0) {
this.originalText = val.join(' ');
this.showText = this.originalText + ' ' + val[0];
} else {
this.originalText = '';
this.showText = '';
}
this.$nextTick(() => { this.$nextTick(() => {
this.initSize(); this.initSize();
}); });
@ -181,11 +188,24 @@ export default {
resolve(); resolve();
}); });
}); });
let boxQuery = new Promise((resolve, reject) => {
uni.createSelectorQuery()
.in(this)
.select(`#u-notice-box`)
.boundingClientRect()
.exec(ret => {
this.boxWidth = ret[0].width;
resolve();
});
});
query.push(textQuery); query.push(textQuery);
query.push(boxQuery);
Promise.all(query).then(() => { Promise.all(query).then(() => {
// t=s/v(=/)#u-notice-box.u-notice-contentpadding-left: 100% // t=s/v(=/)
// #u-notice-box // = - padding-left: 100%
this.animationDuration = `${this.textWidth / uni.upx2px(this.speed)}s`; let originalContentWidth = this.textWidth - this.boxWidth;
// = /
this.animationDuration = `${originalContentWidth / uni.upx2px(this.speed)}s`;
// APP(HX2.4.6IOS13) // APP(HX2.4.6IOS13)
this.animationPlayState = 'paused'; this.animationPlayState = 'paused';
setTimeout(() => { setTimeout(() => {

Loading…
Cancel
Save