提交 499112b4 authored 作者: 常超凡's avatar 常超凡
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
"pages/fenggu/success/success", "pages/fenggu/success/success",
"pages/fenggu/example/example", "pages/fenggu/example/example",
"pages/result/result", "pages/result/result",
"pages/video/video" "pages/video/video",
"pages/beiyinmei/beiyinmei"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
......
// pages/beiyinmei/beiyinmei.js
import qrcode, {
height
} from '../../utils/llqrcodefrankyin.js'
Page({
/**
* 页面的初始数据
*/
data: {
canvas: {
height: 100,
width: 100
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
let flag = true
this.cameraContext = wx.createCameraContext()
const listener = this.cameraContext.onCameraFrame((frame) => {
if (flag) {
flag = false
const data = new Uint8ClampedArray(frame.data);
const d = qrcode.decodefrank(frame.width, frame.height, data)
console.log(d);
if (d) {
wx.showToast({
title:'通过'
})
const base64 = wx.arrayBufferToBase64(frame.data)
wx.request({
url:'https://www.7856.work:4433/api/Bym_classfily_post/',
method:'POST',
data:{
device_id:'50',
base:base64
},
success(res){
console.log(res);
},
fail(e){
console.log(e);
}
})
} else {
flag = true
}
}
})
listener.start()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--pages/beiyinmei/beiyinmei.wxml-->
<view style="height: 100vh;width: 100vw;position: relative;z-index: 99;">
<camera device-position="back" frame-size="small" flash="off" binderror="error" style="width: 100%; height: 100%;" mode="normal">
<view class="prompt">
<image src="/assets/imgs/拍照框.png" style="width: 60%;" mode="widthFix" />
<text>请把二维码放置拍照框内</text>
</view>
</camera>
</view>
/* pages/beiyinmei/beiyinmei.wxss */
.prompt {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #fff;
}
.prompt text {
margin-top: 50px;
}
\ No newline at end of file
...@@ -26,6 +26,24 @@ Page({ ...@@ -26,6 +26,24 @@ Page({
wx.reLaunch({ wx.reLaunch({
url: '/pages/index/index', url: '/pages/index/index',
}) })
this.getVideoUrl()
},
// 获取视频地址
getVideoUrl(){
wx.request({
url: 'https://tjfnew.china315net.com/ajax/video_url.ashx?videoid=80aaac4de1d171eea06f6732b78e0102&json=1',
method:'GET',
success:(res) => {
const {statusCode,data} = res
if (statusCode == 200) {
const {CoverURL,playUrl} = data
this.setData({
src:playUrl
})
}
console.log(res);
},
})
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
"minifyWXML": true, "minifyWXML": true,
"showES6CompileOption": false, "showES6CompileOption": false,
"useCompilerPlugins": false, "useCompilerPlugins": false,
"condition": false "condition": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.25.3", "libVersion": "2.25.3",
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/beiyinmei/beiyinmei",
"pathName": "pages/beiyinmei/beiyinmei",
"query": "",
"launchMode": "default",
"scene": null
},
{ {
"name": "pages/video/video", "name": "pages/video/video",
"pathName": "pages/video/video", "pathName": "pages/video/video",
......
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论