当前位置:网站首页>抖音实战~分享模块~复制短视频链接
抖音实战~分享模块~复制短视频链接
2022-06-26 18:49:00 【gblfy】
文章目录
一、可见范围
保存到相册、复制链接、二维码 都是前端完成的
1. 自己发布短视频
自己发布的短视频会有“保存到相册、复制链接、二维码、转为私密”
2. 其他人发布短视频
其他人发布短视频,自己只能看到“保存到相册、复制链接、二维码”
二、源码分析
2.1. 底部窗口popup
<view>
<!-- 底部窗口popup -->
<uni-popup ref="comment" type="comment">
<uni-popup-comments :thisVlogerId="thisVlogerId" :thisVlogId="thisVlogId"></uni-popup-comments>
</uni-popup>
<uni-popup ref="share" background-color="#fff" type="share">
<uni-popup-share :thisVlogerId="thisVlogerId" :thisVlogId="thisVlogId" :vlogUrl="thisVlog.url"
:isPrivate="thisVlog.isPrivate"></uni-popup-share>
</uni-popup>
</view>
2.2. 实现组件uni-popup 弹出层
插件链接:https://ext.dcloud.net.cn/plugin?id=329
组件案例:
2.3. 插件涉及组件
插件包括4种组件:“uni-popup-comments、uni-popup-dialog、uni-popup-message、uni-popup-share”
2.4. 组件改造
uni-popup-share
2.5. 关键的api
官网api:
uni.setClipboardData(OBJECT)
涉及关键的api:uni.setClipboardData(OBJECT)
- 示例:
uni.setClipboardData({
data: 'hello',
success: function () {
console.log('success');
}
});
- 调整后
copyLink() {
uni.setClipboardData({
data: this.vlogUrl,
success:()=>{
uni.showToast({
//提示
title:'复制成功'
})
}
});
},
- 复制后链接:
在浏览器可以在线播放的
https://vkceyugu.cdn.bspapp.com/VKCEYUGU-912ebac0-be4a-440a-be59-c5bdba836d9c/76c6e411-0309-4ace-8ac4-f8c1a6fdba68.mp4
三、作品鉴赏
3.1. 自己发布视频
3.2. 复制链接
边栏推荐
猜你喜欢
The successfully resolved idea cannot use the log normally after referencing Lombok's @slf4j
Project practice 5: build elk log collection system
Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
Unit test of boot
[kubernetes] kubernetes principle analysis and practical application (under update)
The cross compilation environment appears So link file not found problem
【推荐收藏】这8个常用缺失值填充技巧一定要掌握
Redis single sign on system + voting system
成功解决之idea引用Lombok的@Slf4j后无法正常使用log
wm_concat()和group_concat()函数
随机推荐
The cross compilation environment appears So link file not found problem
SSO微服务工程中用户行为日志的记录
問題解决:虛擬機無法複制粘貼文件
Boot的单元测试
图像二值化处理
微服务架构
Using cache in vuex to solve the problem of data loss in refreshing state
Résumé des points de connaissance
Request method 'POST' not supported
ROS的发布消息Publishers和订阅消息Subscribers
Micro service single sign on system (SSO)
爬取豆瓣读书Top250,导入sqlist数据库(或excel表格)中
Redis single sign on system + voting system
Vscode 基础必备 常用插件
Redis单点登陆系统+投票系统
Interview key points that must be mastered index and affairs (with B-tree and b+ tree)
Pinda general permission system (day 3~day 4)
Eigen库计算两个向量夹角
Pinda general permission system (day 1~day 2)
Yujun product methodology