直播平台发现组件、艺人动态展示、点击切换艺人

直播平台发现组件使用步骤:

1. 查找插件

进入插件市场:打开 HBuilderX 编辑器,点击菜单栏中的 "插件" -> "插件市场",或者直接访问uni-app 插件市场官网 。 搜索插件:在插件市场的搜索框中输入关键词,查找本插件,比如搜索 "小程序对接视频号" 。 筛选插件:筛选出小程序对接视频号插件。

2. 安装插件

方式一:在 HBuilderX 中安装 在插件市场找到目标插件后,点击进入插件详情页。 点击 "使用 HBuilderX 导入插件" 按钮(如果是免费插件,直接导入;如果是付费插件,需要先购买 )本插件是免费免费的喽。 选择要导入插件的 uni-app 项目,确认导入。导入成功后,插件会被放置在项目的 uni_modules 目录下。 方式二:通过命令行安装(适用于发布到 npm 的插件) 打开命令行工具,进入你的 uni-app 项目根目录。 执行 npm install 插件名称 命令,例如 npm install my-uniapp-plugin 。安装完成后,同样可以在项目的 uni_modules 目录下找到该插件。

3. 引入插件

ini 复制代码
```javascript
<liveStreamDiscoverVue 
:centerAvatar="centerAvatar"
:centerName="centerName"
:circleItems="circleItems" 
:bottomNavs="bottomNavs" />
```

4 在测试项目中加入数据,可以根据需要从后台获取,增加动画处理函数。

javascript 复制代码
const centerAvatar = ref('/static/discover/1.png');
const centerName = ref('柳欢欢');

const circleItems = ref([{
            type: 'avatar',
            src: '/static/discover/2.png',
            name: 'Jimly',
            active: false,
            x: 0,
            y: -210,
            yOffset: 0
        },
        {
            type: 'avatar',
            src: '/static/discover/3.png',
            name: '李妮娜',
            active: false,
            x: -130,
            y: -80,
            yOffset: 0
        },
        {
            type: 'avatar',
            src: '/static/discover/4.png',
            name: '王朵朵',
            active: false,
            x: 130,
            y: -120,
            yOffset: 0
        },
        {
            type: 'tag',
            text: '年轻',
            count: '12345人',
            active: false,
            x: -160,
            y: 50,
            yOffset: 0
        },
        {
            type: 'tag',
            text: '天然萌',
            count: '12345人',
            active: false,
            x: 160,
            y: 60,
            yOffset: 0
        },
        {
            type: 'tag',
            text: '可爱',
            count: '12345人',
            active: false,
            x: -80,
            y: 90,
            yOffset: 0
        },
        {
            type: 'tag',
            text: '大胸',
            count: '12345人',
            active: false,
            x: 80,
            y: 80,
            yOffset: 0
        },
        {
            type: 'avatar',
            src: '/static/discover/5.png',
            name: '肖媚媚',
            active: false,
            x: -130,
            y: 200,
            yOffset: 0
        },
        {
            type: 'avatar',
            src: '/static/discover/6.png',
            name: 'KaiTi',
            active: false,
            x: 120,
            y: 200,
            yOffset: 0
        },
    ]);

    const bottomNavs = ref([{
            text: '现场',
            icon: '/static/discover/live.png',
            activeIcon: '/static/discover/live_.png'
        },
        {
            text: '艺人',
            icon: '/static/discover/artist.png',
            activeIcon: '/static/discover/artist_.png'
        },
        {
            text: '发现',
            icon: '/static/discover/discover.png',
            activeIcon: '/static/discover/discover_.png'
        },
        {
            text: '我的',
            icon: '/static/discover/my.png',
            activeIcon: '/static/discover/my_.png'
        },
    ]);

    // 动画相关
    const animateCircleItems = () => {
        setInterval(() => {
           circleItems.value.forEach((item, index) => {
            const yOffset = Math.sin((Date.now() / 1000 + index) * 2) * 10; // 计算上下移动的偏移量,可调整参数改变动画效果
            item.yOffset = yOffset;
           });
          }, 16);
    };
    animateCircleItems();
相关推荐
QQ1__8115175158 小时前
Spring boot名城小区物业管理系统信息管理系统源码-SpringBoot后端+Vue前端+MySQL【可直接运行】
前端·vue.js·spring boot
钛态8 小时前
前端微前端架构:大项目的救命稻草还是自找麻烦?
前端·vue·react·web
一粒黑子8 小时前
【实战解析】阿里开源 PageAgent:纯前端 GUI Agent,一行JS让网页支持自然语言操控
前端·javascript·开源
独角鲸网络安全实验室8 小时前
2026微信小程序抓包全解析:从实操落地到合规风控,解锁前端调试新范式
前端·微信小程序·小程序·抓包·系统代理绕过·https证书严格校验·进程隔离
紫微AI8 小时前
前端文本测量成了卡死一切创新的最后瓶颈,pretext实现突破了
前端·人工智能·typescript
GISer_Jing8 小时前
AI前端(From豆包)
前端·aigc·ai编程
IT枫斗者8 小时前
前端部署后如何判断“页面是不是最新”?一套可落地的版本检测方案(适配 Vite/Vue/React/任意 SPA)
前端·javascript·vue.js·react.js·架构·bug
测试修炼手册8 小时前
[测试技术] 深入理解 JSON Web Token (JWT)
前端·json
AI老李8 小时前
2026 年 Web 前端开发的 8 个趋势!
前端
里欧跑得慢8 小时前
15. Web可访问性最佳实践:让每个用户都能平等访问
前端·css·flutter·web