当前位置:网站首页>抖音实战~分享模块~生成短视频二维码
抖音实战~分享模块~生成短视频二维码
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. 抖音扫描


边栏推荐
- Installation and use of logstash
- Convex hull problem
- Determine whether a sequence is a stack pop-up sequence
- ROS的发布消息Publishers和订阅消息Subscribers
- Installation and use of filebeat
- PC end records 515 ground sweeping robot /scan data
- 【推荐收藏】这8个常用缺失值填充技巧一定要掌握
- Redis Basics
- Clion编译catkin_ws(ROS工作空间包的简称)加载CMakeLists.txt出现的问题
- JVM entry door (1)
猜你喜欢

限流设计及实现

Microservice architecture

Project practice 5: build elk log collection system

ISO documents

Refresh the strong pointer assignment problem in the HP-UX system of Sanguan

Decompilation of zero time technology smart contract security series articles

wm_ Concat() and group_ Concat() function

Take you to resolve hash conflicts and implement a simple hash table,

Feign remote call

Minimum spanning tree, shortest path, topology sorting, critical path
随机推荐
转:实事求是
Feign远程调用
项目实战六:分布式事务-Seata
Image binarization
Project practice 6: distributed transaction Seata
Solidity - 合约继承子合约包含构造函数时报错 及 一个合约调用另一合约view函数收取gas费用
商品秒杀系统
Insert string B into string A. how many insertion methods can make the new string a palindrome string
Leetcode 128 longest continuous sequence
(multi threading knowledge points that must be mastered) understand threads, create threads, common methods and properties of using threads, and the meaning of thread state and state transition
Pinda general permission system (day 1~day 2)
Minimum spanning tree, shortest path, topology sorting, critical path
Boot indicator monitoring
Selection of database paradigm and main code
stm32和电机开发(直流有刷电机和步进电机)
成功解决之idea引用Lombok的@Slf4j后无法正常使用log
To: Apple CEO Cook: great ideas come from constantly rejecting the status quo
Redis single sign on system + voting system
Eigen库计算两个向量夹角
Jsonutils tool class (based on Alibaba fastjson)