篮球扫码入场

This commit is contained in:
2023-09-05 09:40:28 +08:00
parent eeacf3ec10
commit 39776422e4
8 changed files with 1407 additions and 34 deletions

View File

@@ -1,9 +1,19 @@
// pages/basketballGym/index.js // pages/basketballGym/index.js
// import QRCode from './qrcode';
import drawQrcode from './weapp.qrcode.js';
const app = getApp(); const app = getApp();
import { import {
getCurrentPageUrl getCurrentPageUrl
} from './../../utils/util.js' } from './../../utils/util.js'
let id = '' let id = ''
// let qrcode = new QRCode('canvas', {
// text: "123456",
// width: 120,
// height: 120,
// colorDark: '#000000',
// colorLight: '#ffffff',
// correctLevel: QRCode.correctLevel.H
// });
Page({ Page({
/** /**
@@ -32,19 +42,7 @@ Page({
id = options.scene; id = options.scene;
} }
wx.showLoading({ this.initPage()
title: '加载中...',
mask: true,
})
app.$api.venueDetail({
venueId: id
}).then(res => {
this.setData({
venues: res.venues
})
}, err => {
});
}, },
/** /**
@@ -105,6 +103,23 @@ Page({
} }
}, },
initPage() {
wx.showLoading({
title: '加载中...',
mask: true,
})
app.$api.venueDetail({
venueId: id
}).then(res => {
console.log(res);
this.setData({
venues: res.venues
})
}, err => {
});
},
// 打开导航, // 打开导航,
opnGPS() { opnGPS() {
wx.openLocation({ wx.openLocation({
@@ -158,7 +173,41 @@ Page({
venueId: id venueId: id
}).then(res => { }).then(res => {
this.setData({ this.setData({
flg: res.flg flg: res.join.flg
})
drawQrcode({
width: 180,
height: 180,
x: 10,
y: 10,
canvasId: 'myQrcode',
// ctx: wx.createCanvasContext('myQrcode'),
typeNumber: 10,
text: res.join.barcode
})
}, err => {
console.log(err);
})
},
// 我要出场
out() {
app.$api.venueOut({
venueId: id
}).then(res => {
this.setData({
flg: res.out.flg
})
drawQrcode({
width: 180,
height: 180,
x: 10,
y: 10,
canvasId: 'myQrcode',
// ctx: wx.createCanvasContext('myQrcode'),
typeNumber: 10,
text: res.out.barcode
}) })
}, err => { }, err => {
console.log(err); console.log(err);
@@ -176,6 +225,7 @@ Page({
this.setData({ this.setData({
flg: 100 flg: 100
}) })
this.initPage()
}, },
// 关闭购买vip弹框 // 关闭购买vip弹框

View File

@@ -70,7 +70,8 @@
</view> </view>
</view> </view>
<view class='footer-btn' bindtap='enter'>我要场</view> <view class='footer-btn' wx:if="{{venues.enterFlag=='0'}}" bindtap='out'>我要场</view>
<view class='footer-btn' wx:else bindtap='enter'>我要进场</view>
</view> </view>
<view class='in-step-popup' catchtouchmove='unMove' wx:if="{{flg == 0}}"> <view class='in-step-popup' catchtouchmove='unMove' wx:if="{{flg == 0}}">
@@ -78,28 +79,22 @@
<view class='top'> <view class='top'>
<view class='title'> <view class='title'>
<image src='../../images/24@3x.png'></image> <image src='../../images/24@3x.png'></image>
<text>进场步骤</text> <text>请出示二维码</text>
</view> </view>
<image src='../../images/23@3x.png' bindtap='closeInStep'></image> <image src='../../images/23@3x.png' bindtap='closeInStep'></image>
</view> </view>
<view class='center'> <view class='center'>
<view class='item'> <view class='item'>
<view class='step'>第一步</view> <view class='step'>扫码开门</view>
<view class='message'>进入您所在的智能门禁人脸识别区域</view> <view class='barcode'>
<canvas class="barcode-canvas" style="width: 200px; height: 200px;" canvas-id="myQrcode"></canvas>
<!-- <canvas type="2d" class='title' canvas-id="myQrcode" style="width: 400rpx; height: 400rpx"></canvas>-->
</view>
</view> </view>
<image src='../../images/22@3x.png'></image> <image src='../../images/22@3x.png'></image>
<view class='item'> <view class='item'>
<view class='step'>第二步</view> <view class='message'>如有问题,请联系管理员</view>
<view class='message'>贴近门禁摄像头进行人脸识别</view>
</view> </view>
<image src='../../images/22@3x.png'></image>
<view class='item'>
<view class='step'>第三步</view>
<view class='message'>识别成功门锁打开请在5秒钟内进门</view>
</view>
</view>
<view class='bottom'>
说明: 余额充足情况下,可直接进行人脸识别进场,无需再次使用手机。
</view> </view>
</view> </view>
</view> </view>
@@ -124,6 +119,23 @@
</view> </view>
</view> </view>
<view class='in-step-popup' catchtouchmove='unMove' wx:if="{{flg == 999}}">
<view class='small-body body'>
<view class='top'>
<view class='title'>
<image src='../../images/24@3x.png'></image>
<text>门禁异常</text>
</view>
<image src='../../images/23@3x.png' bindtap='closeInStep'></image>
</view>
<view class='center'>
<view class='item'>
<view class='step'>门禁已掉线,请联系管理员</view>
</view>
</view>
</view>
</view>
<view class='unclick-mask' wx:if="{{showUnclickMask}}"></view> <view class='unclick-mask' wx:if="{{showUnclickMask}}"></view>
<view class='card-mask' catchtouchmove='unMove' wx:if="{{showCardMask}}" bindtap='cancelCardMask'> <view class='card-mask' catchtouchmove='unMove' wx:if="{{showCardMask}}" bindtap='cancelCardMask'>
@@ -138,7 +150,7 @@
<confirm-dialog title="提示" message="余额不足,请先充值余额" confirmBtnTitle="充值" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{flg == 2}}"></confirm-dialog> <confirm-dialog title="提示" message="余额不足,请先充值余额" confirmBtnTitle="充值" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{flg == 2}}"></confirm-dialog>
<confirm-dialog title="提示" message="请先上传照片,以供人脸识别入场" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{flg == 1}}"></confirm-dialog> <!--<confirm-dialog title="提示" message="请先上传照片,以供人脸识别入场" bindcancelselect="cancelDeleteDialog" bindconfirmselect="confirmDeleteDialog" wx:if="{{flg == 1}}"></confirm-dialog>-->
<confirm-dialog title="提示" message="请先绑定微信" confirmBtnTitle="绑定" isUserInfo="{{true}}" bindcancelselect="cancelWXDialog" bindgetuserinfo="getUserInfo" wx:if="{{isWxLogin}}"></confirm-dialog> <confirm-dialog title="提示" message="请先绑定微信" confirmBtnTitle="绑定" isUserInfo="{{true}}" bindcancelselect="cancelWXDialog" bindgetuserinfo="getUserInfo" wx:if="{{isWxLogin}}"></confirm-dialog>

View File

@@ -166,6 +166,13 @@
border-radius: 10rpx; border-radius: 10rpx;
} }
.in-step-popup .small-body {
width: 600rpx;
height: 222rpx;
background: #252330;
border-radius: 10rpx;
}
.in-step-popup .body .top { .in-step-popup .body .top {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -223,6 +230,19 @@
text-align: center; text-align: center;
} }
.in-step-popup .body .center .item .barcode {
width: 450rpx;
background: #fff;
position: relative;
}
.barcode-canvas {
width: 366rpx;
margin: 0 auto;
padding-top: 40rpx;
border-top: 2rpx solid #F4F5F7;
}
.in-step-popup .body .bottom { .in-step-popup .body .bottom {
margin: 40rpx 20rpx 0 20rpx; margin: 40rpx 20rpx 0 20rpx;
font-size: 26rpx; font-size: 26rpx;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -5,7 +5,7 @@
<view class='cell' wx:for="{{list}}" wx:key="{{index}}"> <view class='cell' wx:for="{{list}}" wx:key="{{index}}">
<view class='left'> <view class='left'>
<!-- <view class='title'>{{item.venueLesson.name}}</view> --> <!-- <view class='title'>{{item.venueLesson.name}}</view> -->
<view class='title' wx:if="{{item.type == 1}}">{{item.venue.name}}进场</view> <view class='title' wx:if="{{item.type == 1}}">{{item.venue.name}}扫码订单</view>
<view class='title' wx:if="{{item.type == 2}}">购买{{item.venue.name}}{{item.cardType}}</view> <view class='title' wx:if="{{item.type == 2}}">购买{{item.venue.name}}{{item.cardType}}</view>
<view class='title' wx:if="{{item.type == 3}}">预约{{item.venueLesson.name}}</view> <view class='title' wx:if="{{item.type == 3}}">预约{{item.venueLesson.name}}</view>
<view class='title' wx:if="{{item.type == 4}}">充值</view> <view class='title' wx:if="{{item.type == 4}}">充值</view>

View File

@@ -37,7 +37,8 @@
"userConfirmedBundleSwitch": false, "userConfirmedBundleSwitch": false,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [], "packNpmRelationList": [],
"minifyWXSS": true "minifyWXSS": true,
"condition": false
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.17.0", "libVersion": "2.17.0",

View File

@@ -267,7 +267,7 @@ export default {
}, },
// 场馆列表详情 // 场馆列表详情
venueDetail(params) { venueDetail(params) {
return fetchPost('/venue/detail', params, false); return fetchPost('/venue/detail', params, true);
}, },
// 预约课程时间显示 // 预约课程时间显示
venueLessonShow(params) { venueLessonShow(params) {
@@ -297,6 +297,10 @@ export default {
venueJoin(params) { venueJoin(params) {
return fetchGet('/venue/join', params, true); return fetchGet('/venue/join', params, true);
}, },
// 篮球馆我要出场
venueOut(params) {
return fetchGet('/venue/out', params, true);
},
/** /**
* 个人中心 * 个人中心