当前位置:网站首页>抖音实战~分享模块~生成短视频二维码
抖音实战~分享模块~生成短视频二维码
2022-06-26 18:52: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. 实现组件uQRCode
插件链接:https://ext.dcloud.net.cn/plugin?id=1287
组件案例:
2.3. 插件涉及组件

2.4. 组件改造
uQRCode基于uqrcode.js实现
gotoQRCode() {
uni.navigateTo({
url: "/pages/qrcode/qrcode?vlogId=" + this.thisVlogId
})
},
onReady() {
var vlogId = this.vlogId;
var content = {
type: "vlog",
content: vlogId
};
var contentStr = JSON.stringify(content);
uQRCode.make({
canvasId: 'qrcode',
componentInstance: this,
size: 170,
margin: 10,
text: contentStr,
backgroundColor: '#ffffff',
foregroundColor: '#0f0827',
fileType: 'png',
errorCorrectLevel: uQRCode.errorCorrectLevel.H
})
.then(res => {
})
},
2.5. 实现原理
- 1.其实生成短视频二维码就是短视频的发布ID
- 2.当微信扫描只会显示二维码生成的type和content文字内容,是因为没有对文字进行其他的操作。
- 3.咱们抖音app当你扫描二维码时,做了以下几件事:
- 3.1. 第一件事和微信扫描一样解析二维码后面的文字信息
- 3.2. 获取短视频发布ID后,调用了后端短视频详情的api接口
- 3.3.调用完接口后,有对短视频详情进行了短视频信息转视频的处理(其实就是预览短视频而已),和搜索页面实现的原理是一样的。
后期会补充实现原理流程图,为大家详细揭晓
三、作品鉴赏
3.1. 生成短视频二维码

3.2. 微信扫描

3.3. 抖音扫描


边栏推荐
- Successfully solved the problem of garbled microservice @value obtaining configuration file
- Eigen库计算两个向量夹角
- sqlite数据库的系统表sqlite_master
- 转:实事求是
- Project practice 6: distributed transaction Seata
- [MySQL series] collection of common working SQL (continuous update)
- 【Kubernetes】Kubernetes 原理剖析与实战应用(更新中)
- Image binarization
- Preliminary analysis of serial port printing and stack for arm bare board debugging
- 为什么我不推荐去SAP培训机构参加培训?
猜你喜欢

Current limiting design and Implementation

Leetcode 128 longest continuous sequence

【推荐收藏】这8个常用缺失值填充技巧一定要掌握

项目实战四:用户登录及token访问验证(reids+jwt)

When does the mobile phone video roll off?

Solidity - 合约继承子合约包含构造函数时报错 及 一个合约调用另一合约view函数收取gas费用

手机影像内卷几时休?

VCD video disc

Micro service single sign on system (SSO)

LeetCode 238 除自身以外数组的乘积
随机推荐
Numpy's Matplotlib
LeetCode 128最长连续序列
JSONUtils工具类(基于alibaba fastjson)
微服务架构
Example of using QPushButton style (and method of adding drop-down menu to button SetMenu)
Project practice 6: distributed transaction Seata
元宇宙链游开发案例版 NFT元宇宙链游系统开发技术分析
Boyun, standing at the forefront of China's container industry
深度学习之Numpy篇
ros::spinOnce()和ros::spin()的使用和区别
Comparing the size relationship between two objects turns out to be so fancy
刷新三观的HP-UX系统中的强指针赋值出core问题
项目实战六:分布式事务-Seata
Union, intersection and difference operations in SQL
Interview key points that must be mastered index and affairs (with B-tree and b+ tree)
Solidity - 合约继承子合约包含构造函数时报错 及 一个合约调用另一合约view函数收取gas费用
CLion断点单步调试
wm_concat()和group_concat()函数
Logstash安装及使用
CD-CompactDisk