Skip to content

feat: ✨ Swiper 轮播组件支持展示视频和设置轮播项标题#663

Merged
Moonofweisheng merged 3 commits intomasterfrom
feature/swiper-video
Oct 15, 2024
Merged

feat: ✨ Swiper 轮播组件支持展示视频和设置轮播项标题#663
Moonofweisheng merged 3 commits intomasterfrom
feature/swiper-video

Conversation

@Moonofweisheng
Copy link
Copy Markdown
Owner

@Moonofweisheng Moonofweisheng commented Oct 15, 2024

Closes: #459

🤔 这个 PR 的性质是?(至少选择一个)

  • 日常 bug 修复
  • 新特性提交
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • CI/CD 改进
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 代码重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

提供支持在h5、微信和钉钉小程序端的视频轮播功能,APP需要NVUE才可以支持。
提供基于配置的轮播项标题功能

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充

Summary by CodeRabbit

  • 新特性

    • 更新了Swiper组件文档,新增视频支持和自定义标题样式。
    • Swiper组件新增视频轮播、手动播放和停止自动播放功能。
    • 新增多个属性以控制视频播放行为,如autoplayVideostopPreviousVideo
  • 文档

    • Swiper组件文档进行了重大更新,包含新示例和详细描述。
  • 样式

    • 新增样式变量以增强Swiper组件的自定义选项。

@vercel
Copy link
Copy Markdown

vercel bot commented Oct 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wot-design-uni ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 15, 2024 11:45am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Oct 15, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

本次更改主要集中在wd-swiper组件的功能增强和文档更新。文档中新增了对视频资源的支持,扩展了组件的功能,包括视频自动播放、手动播放和在视频播放时停止轮播的功能。组件的属性和类型也进行了更新,新增了多个与视频播放相关的属性。同时,样式文件中添加了新的样式变量,以增强自定义选项。这些更改旨在提升组件的多媒体处理能力和用户体验。

Changes

文件路径 更改摘要
docs/component/swiper.md 更新文档,简化标题,扩展描述,新增视频轮播相关内容,更新属性表,增加新属性和示例代码。
src/pages/swiper/Index.vue 添加视频轮播示例,更新valueKeytext-key,调整模板结构,新增videoListcurrent10变量。
src/uni_modules/wot-design-uni/components/common/abstracts/variable.scss 新增样式变量$-swiper-item-text-color$-swiper-item-text-fs,增强样式自定义选项。
src/uni_modules/wot-design-uni/components/wd-swiper/index.scss 更新样式,新增文本样式块,修改image元素的混合函数以支持视频。
src/uni_modules/wot-design-uni/components/wd-swiper/types.ts 新增类型和多个属性,更新SwiperList接口,扩展swiperProps对象以支持视频播放管理。
src/uni_modules/wot-design-uni/components/wd-swiper/wd-swiper.vue 增加新属性和变量,更新模板以支持视频元素,调整逻辑以处理视频播放状态和用户交互。

Assessment against linked issues

Objective Addressed Explanation
提供swiper-item插槽 本次更改未涉及插槽的支持。

Possibly related PRs

Suggested reviewers

  • 810505339

🐰 在轮播中跳跃,视频也能播放,
新属性与样式,让内容更精彩!
自定义的色彩,随心所欲展现,
兔子欢呼,Swiper更强大! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify
Copy link
Copy Markdown

netlify bot commented Oct 15, 2024

Deploy Preview for wot-design-uni ready!

Name Link
🔨 Latest commit be0f4b1
🔍 Latest deploy log https://app.netlify.com/sites/wot-design-uni/deploys/670e55d3385f070007c2fcbf
😎 Deploy Preview https://deploy-preview-663--wot-design-uni.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Moonofweisheng Moonofweisheng merged commit a50c0be into master Oct 15, 2024
@oknixus
Copy link
Copy Markdown
Contributor

oknixus commented Oct 28, 2024

customTextStyle="bottom: 0"样式无效,被top:24rpx覆盖掉了,即使加了!important也不行;
只能继续使用top: 90%好在可以用百分比;

下面这种使用了customTextClass的也是无效的

customTextClass="swiper-title"

.swiper-title {
    top: 90%;
}

@Moonofweisheng Moonofweisheng deleted the feature/swiper-video branch October 28, 2024 08:54
@Moonofweisheng
Copy link
Copy Markdown
Owner Author

customTextStyle="bottom: 0"样式无效,被top:24rpx覆盖掉了,即使加了!important也不行; 只能继续使用top: 90%好在可以用百分比;

下面这种使用了customTextClass的也是无效的

customTextClass="swiper-title"

.swiper-title {
    top: 90%;
}

重置一下不就行

customTextStyle="bottom: 0"样式无效,被top:24rpx覆盖掉了,即使加了!important也不行; 只能继续使用top: 90%好在可以用百分比;

下面这种使用了customTextClass的也是无效的

customTextClass="swiper-title"

.swiper-title {
    top: 90%;
}
    top: unset;
    right: unset;
    bottom: 0;

@Moonofweisheng
Copy link
Copy Markdown
Owner Author

customTextStyle="bottom: 0"样式无效,被top:24rpx覆盖掉了,即使加了!important也不行; 只能继续使用top: 90%好在可以用百分比;

下面这种使用了customTextClass的也是无效的

customTextClass="swiper-title"

.swiper-title {
    top: 90%;
}

customClass不会用的话,要去看常见问题。

@oknixus
Copy link
Copy Markdown
Contributor

oknixus commented Oct 28, 2024

customTextStyle="bottom: 0"样式无效,被top:24rpx覆盖掉了,即使加了!important也不行; 只能继续使用top: 90%好在可以用百分比;
下面这种使用了customTextClass的也是无效的

customTextClass="swiper-title"

.swiper-title {
    top: 90%;
}

customClass不会用的话,要去看常见问题。

感谢!
请问,如果把indicate放在右下角,把文字设置成bottom: 0,这个时候,可能会出现文字与indicate重叠的问题,不知道是否支持省略重叠文字并以...显示

@oknixus
Copy link
Copy Markdown
Contributor

oknixus commented Oct 28, 2024

感谢指点,在常见问题中,找到了外部样式相关的内容;
bottom: 0是无效的,查了CSS的资料,top和bottom并存时,top优先级大于bottom,left与right并存时,left优先级大于right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[新功能需求] Swiper 不支持插槽吗?

2 participants