简体   繁体   English

离子滑动时间计数

[英]Ionic Slide Time Counting

I am developing a mobile application with ionic and angular.我正在使用离子和 angular 开发移动应用程序。 And also I used ionic slides for it.我也使用了离子载玻片。 User can read the things that I included in the slides.用户可以阅读我在幻灯片中包含的内容。 Now I want to estimate the time it takes for the user to read the slides one by one.现在我想估计用户一张一张地阅读幻灯片所需的时间。 This table shows the final output that I want.此表显示了我想要的最终 output。

Slide Number幻灯片编号 the time it took the user to read the slide用户阅读幻灯片所花费的时间
1 1 10s 10s
2 2 4s 4s
3 3 5s 5s
1 1 12s ( 10s + 2s ) 12s ( 10s + 2s )

When the user reads the previously read slide again, the time should be added to the previous reading time.当用户再次阅读之前阅读的幻灯片时,应该将时间添加到之前的阅读时间中。

Can someone help to implement this or send me a related reference for this?有人可以帮助实现这一点或向我发送相关参考吗?

What steps have you taken to try and implement this yourself?您采取了哪些步骤来尝试自己实施? And if you did take some steps, what results/errors did you get?如果您确实采取了一些步骤,您会得到什么结果/错误?

If you're assuming that the slide has been read once the user slides to the next, then you can capture the time in milliseconds (A1) as soon as the first slide is displayed in view, then subtract that from the time (B1) at which the next one is loaded (B1-A1) [use some of the events on https://ionicframework.com/docs/api/slides to watch for the slide change], then store it in your var (C1, C2, etc.) - for example: C1 as slide1readingTime, C2 as slide2readingTime etc. and increase that value by (Bn-An) each time the same slide has been swiped (Cn += (Bn-An) ).如果您假设用户滑动到下一张幻灯片时已阅读该幻灯片,那么您可以在第一张幻灯片显示在视图中时捕获以毫秒为单位的时间 (A1),然后从时间中减去该时间 (B1)加载下一个 (B1-A1) [使用https://ionicframework.com/docs/api/slides上的一些事件来观察幻灯片的变化],然后将其存储在您的 var (C1, C2等) - 例如:C1 作为 slide1readingTime,C2 作为 slide2readingTime 等,并在每次刷过同一张幻灯片时将该值增加 (Bn-An) (Cn += (Bn-An) )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM