Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(barrage): slot 模式优化 #2066

Merged
merged 189 commits into from
Jan 17, 2023
Merged
Changes from all commits
Commits
Show all changes
189 commits
Select commit Hold shift + click to select a range
bd5f92b
fix: countup优化滚动逻辑
Ymm0008 Oct 22, 2021
a5c96aa
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Nov 18, 2021
f706a7e
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Nov 26, 2021
1b99f33
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Dec 23, 2021
d4fcfe5
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Jan 5, 2022
f6534b4
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Jan 10, 2022
ba3fa50
fix: collapse 无法动态更新问题修复
Ymm0008 Jan 10, 2022
7c2c0c1
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Jan 10, 2022
1992e08
fix: 解决H5侧动态加载问题
Ymm0008 Jan 10, 2022
6b48779
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Jan 20, 2022
10529e2
docs: 文档增加调试功能(Barrage、Signature、CountUp、TextArea、Collapse)
Ymm0008 Jan 20, 2022
12754e0
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Jan 20, 2022
c01c5bf
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Feb 16, 2022
30c11e7
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Feb 17, 2022
0cf218e
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Feb 18, 2022
b0df624
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Feb 24, 2022
631e35b
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Feb 25, 2022
7109da9
Merge branch 'jdf2e:next' into next
Ymm0008 Mar 1, 2022
09adce0
feat: 折叠面板 collapse 单元测试
Ymm0008 Mar 2, 2022
bbfa553
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 2, 2022
eb87c41
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Mar 2, 2022
20d5648
fix: countUp 单元测试
Ymm0008 Mar 9, 2022
bb298c8
feat: countUp 单元测试
Ymm0008 Mar 9, 2022
694aa7b
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 9, 2022
730df91
feat: barrage 单元测试
Ymm0008 Mar 10, 2022
cc76a9e
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 10, 2022
f86ab3d
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 16, 2022
70a8a1f
fix: 签名组件单元测试
Ymm0008 Mar 16, 2022
bf142bb
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 16, 2022
1b0b8ab
feat: textarea 单元测试
Ymm0008 Mar 17, 2022
d0dbf7e
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 17, 2022
7a91b7f
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 18, 2022
3635542
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 21, 2022
804eff1
feat: collapse 标题多行展示,无内容不下拉,图标位置配置
Ymm0008 Mar 22, 2022
1acd4a2
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 22, 2022
af59840
feat: textarea 自动撑开,collapse 组件能力
Ymm0008 Mar 24, 2022
7fcca7a
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 24, 2022
90bc68f
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 25, 2022
1a5d899
fix: collapse 单元测试优化
Ymm0008 Mar 25, 2022
faecc5d
fix: textarea 单元测试优化
Ymm0008 Mar 25, 2022
198fe38
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Mar 31, 2022
d252591
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 1, 2022
1a0bc24
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 6, 2022
a6e6b34
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 7, 2022
a11541b
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 8, 2022
e2dd353
fix: 修改input参数,maxNum 改为 maxLength,文档修改等
Ymm0008 Apr 8, 2022
633273c
fix: maxlength 值
Ymm0008 Apr 8, 2022
9427cd1
Merge branch 'next' into next
richard1015 Apr 8, 2022
c57e2c4
fix: layout增加点击事件,骨架屏增加组合形式demo
Ymm0008 Apr 11, 2022
c82e78b
Merge branch 'jdf2e:next' into next
Ymm0008 Apr 11, 2022
1852e54
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Apr 11, 2022
1ac6f33
fix: textarea autosize 问题优化
Ymm0008 Apr 14, 2022
69c8d66
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 14, 2022
89c5edd
fix: textarea 自适应
Ymm0008 Apr 14, 2022
4694065
fix: textarea 自适应
Ymm0008 Apr 14, 2022
076e404
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 15, 2022
dcecf0b
Merge branch 'jdf2e:next' into next
Ymm0008 Apr 19, 2022
3a9d3c3
fix: textarea rows
Ymm0008 Apr 19, 2022
a05b09b
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Apr 19, 2022
a101629
Merge branch 'jdf2e:next' into next
Ymm0008 Apr 21, 2022
214a3b4
upd: notify 增加组件调用方式
Ymm0008 Apr 21, 2022
3982ce3
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Apr 21, 2022
8cfa137
fix: demo 修改
Ymm0008 Apr 22, 2022
53f9746
Merge branch 'next' of https://github.com/jdf2e/nutui into next
Ymm0008 Apr 22, 2022
0fbeb0a
Merge branch 'jdf2e:next' into next
Ymm0008 Apr 24, 2022
c5be488
feat: 新增collapse组件自定义内容(不折叠)功能
Ymm0008 Apr 24, 2022
beb767f
fix: notify 单元测试优化
Ymm0008 Apr 25, 2022
748f756
Merge branch 'jdf2e:next' into next
Ymm0008 Apr 25, 2022
d1da68e
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Apr 25, 2022
5c98281
fix: merge
Ymm0008 Apr 25, 2022
68f8aea
Merge branch 'jdf2e:next' into next
Ymm0008 May 6, 2022
96356c9
Merge branch 'jdf2e:next' into next
Ymm0008 May 9, 2022
d48cd13
Merge branch 'jdf2e:next' into next
Ymm0008 May 13, 2022
7452a2f
Merge branch 'jdf2e:next' into next
Ymm0008 May 18, 2022
34a6552
feat: searchbar 组件能力补充
Ymm0008 May 18, 2022
f534aa4
Merge branch 'jdf2e:next' into next
Ymm0008 May 20, 2022
b7ffe18
feat: collapse,layout 组件国际化
Ymm0008 May 20, 2022
9b4a8c4
Merge branch 'jdf2e:next' into next
Ymm0008 May 26, 2022
7690840
upd: countup、barrage、signature、Skeleton组件国际化
Ymm0008 May 26, 2022
19a9893
fix: demo及文档修改,组件优化
Ymm0008 May 26, 2022
4fa876f
feat: textarea 增加autofocus、disabled等属性,增加点击区域事件
Ymm0008 May 26, 2022
4df66fd
fix: 解决 flexwrap 问题
Ymm0008 May 26, 2022
1ff858c
fix: 合并
Ymm0008 May 30, 2022
e43d038
Merge branch 'jdf2e:next' into next
Ymm0008 Jun 6, 2022
978eec5
fix: 文档修改
Ymm0008 Jun 6, 2022
3faa962
fix: 文档修改
Ymm0008 Jun 6, 2022
db7faff
Merge branch 'jdf2e:next' into next
Ymm0008 Jun 8, 2022
6601a41
Merge branch 'jdf2e:next' into next
Ymm0008 Jun 10, 2022
3b03f1e
Merge branch 'jdf2e:next' into next
Ymm0008 Jun 17, 2022
ff48e33
fix: 优化
Ymm0008 Jun 17, 2022
d5b46af
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Jun 17, 2022
fde5253
Merge branch 'jdf2e:next' into next
Ymm0008 Jun 21, 2022
356ab65
fix: collaspe 数据更新支持外部调用
Ymm0008 Jun 21, 2022
84ad471
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Jun 21, 2022
0f82b2c
Merge branch 'jdf2e:next' into next
Ymm0008 Jun 21, 2022
c14c2af
fix: demo
Ymm0008 Jun 21, 2022
9708235
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Jun 21, 2022
9b7666a
upd: next
Ymm0008 Jun 30, 2022
f482702
Merge branch 'jdf2e:next' into next
Ymm0008 Jul 8, 2022
836161c
feat: 修复折叠面板手风琴模式
Ymm0008 Jul 8, 2022
ffe00ed
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Jul 8, 2022
8f5b7b8
Merge branch 'jdf2e:next' into next
Ymm0008 Jul 11, 2022
4d3707b
fix: 修复notify标签式展示报错问题及class类名问题
Ymm0008 Jul 11, 2022
aab6c5a
Merge branch 'jdf2e:next' into next
Ymm0008 Jul 13, 2022
ec2f6db
fix: 解决签名组件生产环境下 getContext 报错问题
Ymm0008 Jul 13, 2022
c6ce1ba
fix: 适配textarea小程序自适应高度功能
Ymm0008 Jul 13, 2022
fdf8037
Merge branch 'jdf2e:next' into next
Ymm0008 Jul 28, 2022
377d488
Merge branch 'jdf2e:next' into next
Ymm0008 Jul 28, 2022
c75fa78
fix: 折叠面板优化
Ymm0008 Jul 28, 2022
a6b3796
feat: 组件支持暗黑模式
Ymm0008 Jul 29, 2022
42f1227
Merge branch 'jdf2e:next' into next
Ymm0008 Jul 29, 2022
3e4599d
Merge branch 'jdf2e:next' into next
Ymm0008 Aug 1, 2022
302a735
Merge branch 'jdf2e:next' into next
Ymm0008 Aug 1, 2022
01b5501
feat(signature): signature 组件增加签名开始,结束,进行中回调函数
Ymm0008 Aug 1, 2022
fe88fff
Merge branch 'jdf2e:next' into next
Ymm0008 Aug 1, 2022
ecdb39f
docs: 文档修改
Ymm0008 Aug 1, 2022
8261166
Merge branch 'jdf2e:next' into next
Ymm0008 Aug 1, 2022
7c0b262
Merge branch 'jdf2e:next' into next
Ymm0008 Aug 8, 2022
ed1463b
Merge branch 'jdf2e:next' into next
Ymm0008 Aug 11, 2022
7899c13
fix: textarea 适配支付宝小程序
Ymm0008 Aug 12, 2022
1273e74
feat: searchbar 新增自定义清除图标功能
Ymm0008 Sep 1, 2022
e2ae9ae
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 1, 2022
a21a38f
feat: 新增聚焦自定义样式
Ymm0008 Sep 2, 2022
912d0b1
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 2, 2022
1ef2f01
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 8, 2022
2a7883e
fix: ts 问题修正,demo 同步。单元测试排错
Ymm0008 Sep 8, 2022
3476665
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 8, 2022
d7236a0
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 8, 2022
fcbeb40
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 14, 2022
df0060a
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 21, 2022
c3b5a1f
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 22, 2022
bef98c4
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 27, 2022
031f3fd
feat: barrage 增加slot模式,demo及文档完善
Ymm0008 Sep 27, 2022
5296f7e
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Sep 27, 2022
76dee52
fix: 弹幕兼容
Ymm0008 Sep 27, 2022
1f1ff44
fix: barrage 优化
Ymm0008 Sep 27, 2022
414c3aa
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 27, 2022
f06d47e
feat: searchbar 新增自定义清除图标功能
Ymm0008 Sep 29, 2022
0f3947c
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Sep 29, 2022
49c7e7e
Merge branch 'jdf2e:next' into next
Ymm0008 Sep 30, 2022
fc2d478
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 14, 2022
befeeee
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 21, 2022
c75bd7e
fix: barrage 样式报错,H5环境 slot 插槽适配
Ymm0008 Oct 21, 2022
dd15049
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Oct 21, 2022
1c64566
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 21, 2022
5070d4a
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 26, 2022
82c231a
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 27, 2022
dc80f08
fix: 签名组件taro环境适配
Ymm0008 Oct 27, 2022
0ad5412
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Oct 27, 2022
615bb4a
fix: signature canvas实例
Ymm0008 Oct 28, 2022
939587f
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 28, 2022
7acd4d2
Merge branch 'jdf2e:next' into next
Ymm0008 Oct 28, 2022
44eb526
feat: github issue 链接更改
Ymm0008 Oct 28, 2022
b26e988
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 2, 2022
f624c0f
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 3, 2022
65334e7
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 4, 2022
4008ea8
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 4, 2022
2ec6d8e
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 7, 2022
10b55fa
fix: collapse 折叠面板加载问题处理
Ymm0008 Nov 7, 2022
b3d9487
fix: 折叠面板动态加载
Ymm0008 Nov 8, 2022
d679fc9
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 9, 2022
8f86711
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 11, 2022
5424887
fix(signature): 解决签名组件taro环境适配问题
Ymm0008 Nov 11, 2022
f5e79c1
fix: 样式
Ymm0008 Nov 11, 2022
7531bbf
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 15, 2022
90a131f
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 18, 2022
5b586f0
fix: 签名组件文档,demo 展示
Ymm0008 Nov 18, 2022
36cdd02
docs: 文档
Ymm0008 Nov 18, 2022
ffdfc27
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Nov 18, 2022
7d7bf3c
Merge branch 'jdf2e:next' into next
Ymm0008 Nov 22, 2022
a8e60a2
fix: textarea 渲染问题处理
Ymm0008 Nov 24, 2022
53165f1
Merge branch 'jdf2e:next' into next
Ymm0008 Dec 2, 2022
8b39b2d
fix: collapse 单元测试
Ymm0008 Dec 2, 2022
545f625
Merge branch 'jdf2e:next' into next
Ymm0008 Dec 2, 2022
ed884a6
docs: 签名组件文档
Ymm0008 Dec 2, 2022
ea565f7
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Dec 2, 2022
e8d06ed
Merge branch 'jdf2e:next' into next
Ymm0008 Dec 13, 2022
48799ab
Merge branch 'jdf2e:next' into next
Ymm0008 Dec 15, 2022
51482bc
Merge branch 'jdf2e:next' into next
Ymm0008 Dec 19, 2022
d22282c
Merge branch 'jdf2e:next' into next
Ymm0008 Dec 27, 2022
fc928bb
fix: barrage
Ymm0008 Dec 28, 2022
8205471
fix: barrage 小程序不展示问题处理
Ymm0008 Dec 29, 2022
4947340
Merge branch 'jdf2e:next' into next
Ymm0008 Jan 13, 2023
403d86f
Merge branch 'jdf2e:next' into next
Ymm0008 Jan 16, 2023
a50df4b
Merge branch 'jdf2e:next' into next
Ymm0008 Jan 16, 2023
bc02d0a
fix: signature,collapse组件问题处理
Ymm0008 Jan 16, 2023
cce424a
fix: barrage 优化
Ymm0008 Jan 17, 2023
6f4f763
Merge branch 'jdf2e:next' into next
Ymm0008 Jan 17, 2023
14a9df8
Merge branch 'next' of https://github.com/Ymm0008/nutui into next
Ymm0008 Jan 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 65 additions & 45 deletions src/packages/__VUE/barrage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</div>
</template>
<script lang="ts">
import { computed, onMounted, onUnmounted, onDeactivated, ref, watch, nextTick, useSlots } from 'vue';
import { computed, onMounted, onUnmounted, ref, watch, nextTick, useSlots } from 'vue';
import { createComponent } from '@/packages/utils/create';
const { componentName, create } = createComponent('barrage');

Expand Down Expand Up @@ -40,9 +40,7 @@ export default create({
default: true
}
},
emits: ['click'],

setup(props, { slots }) {
setup(props) {
const classTime = new Date().getTime();
const slotDefault = !!useSlots().default;

Expand All @@ -65,36 +63,60 @@ export default create({
const danmuCWidth = ref(0);

onMounted(() => {
init();
if (slotDefault) {
document.addEventListener('visibilitychange', function () {
if (document.visibilityState === 'hidden') {
clearTime();
index.value = 0;
eleSlot('hidden');
} else if (document.visibilityState === 'visible') {
init();
}
});
}
});

onUnmounted(() => {
danmuList.value = [];
clearTime();
});

const init = () => {
danmuCWidth.value = dmBody.value.offsetWidth;
if (slotDefault) {
const list = document.getElementsByClassName('slotBody' + classTime);
let childrens = list?.[0]?.children || [];
const dmList: any[] = [];
if (childrens) {
Array.from(childrens).forEach((item: any) => {
item.style.opacity = '0';
dmList.push(item);
});
}
danmuList.value = dmList;
eleSlot('init');
}
setTimeout(() => {
dmBody.value?.style.setProperty('--move-distance', `-${danmuCWidth.value}px`);
run();
}, 300);
});
};

onUnmounted(() => {
danmuList.value = [];
clearInterval(timer);
timer = 0;
});
const eleSlot = (flag?: string) => {
const list = document.getElementsByClassName('slotBody' + classTime);
let childrens = list?.[0]?.children || [];
const dmList: any[] = [];
if (childrens) {
Array.from(childrens).forEach((item: any) => {
if (flag == 'init') {
item.style.opacity = '0';
dmList.push(item);
} else {
item.classList = '';
item.style = {};
}
});
}
if (flag == 'init') {
danmuList.value = dmList;
}
};

onDeactivated(() => {
danmuList.value = [];
clearInterval(timer);
const clearTime = () => {
clearTimeout(timer);
timer = 0;
});
};

watch(
() => props.danmu,
Expand All @@ -115,20 +137,18 @@ export default create({
};

const run = () => {
clearInterval(timer);
timer = 0;
clearTime();
timer = setTimeout(() => {
play();
run();
}, props.frequency);
};
// const distance = ref('0');
const play = () => {
if (!props.loop && index.value >= danmuList.value.length) {
return;
}
const _index = props.loop ? index.value % danmuList.value.length : index.value;
let el = document.createElement(`view`);

if (slotDefault && typeof danmuList.value[_index] == 'object') {
el = danmuList.value[_index];
el?.classList?.add('dmitem');
Expand All @@ -137,10 +157,9 @@ export default create({
el.classList.add('dmitem');
dmContainer.value.appendChild(el);
}

// let el = document.createElement(`div`);
// el.innerHTML = danmuList.value[_index] as string;
// el.classList.add('dmitem');
// el.classList.add('nut-barrage__item');
// dmContainer.value.appendChild(el);
nextTick(() => {
const height = el.offsetHeight;
Expand All @@ -152,25 +171,26 @@ export default create({
const width = el.offsetWidth;
el.style.width = width + 20 + 'px';
}

// el.style.left = "-"+(_index % rows.value) + 'px';
// el.style.left = '-' + (_index % rows.value) + 'px';
// el.style.setProperty('--move-distance', `-${danmuCWidth.value}px`);
// document.documentElement.style.setProperty('--move-distance', `-${danmuCWidth.value}px`);
// distance.value = '-' + (speeds / 1000) * 150 + '%';
el.dataset.index = `${_index}`;
if (slotDefault) {
index.value++;
el.addEventListener('animationend', () => {
if (el?.classList?.contains('move')) {
el.classList.remove('move');
}
});
} else {
el.addEventListener('animationend', () => {
// el.dataset.index = `${_index}`;

el.addEventListener('animationend', () => {
if (slotDefault) {
el.classList.remove('move');
} else {
dmContainer.value.removeChild(el);
});
index.value++;
}
});
index.value++;
if (index.value >= danmuList.value.length) {
index.value = 0;
}
el.removeEventListener('animationend', () => {
// 回调
});
run();
});
};
return { classTime, classes, danmuList, dmBody, dmContainer, add };
Expand Down