篮球扫码入场

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
// import QRCode from './qrcode';
import drawQrcode from './weapp.qrcode.js';
const app = getApp();
import {
getCurrentPageUrl
} from './../../utils/util.js'
let id = ''
// let qrcode = new QRCode('canvas', {
// text: "123456",
// width: 120,
// height: 120,
// colorDark: '#000000',
// colorLight: '#ffffff',
// correctLevel: QRCode.correctLevel.H
// });
Page({
/**
@@ -32,19 +42,7 @@ Page({
id = options.scene;
}
wx.showLoading({
title: '加载中...',
mask: true,
})
app.$api.venueDetail({
venueId: id
}).then(res => {
this.setData({
venues: res.venues
})
}, err => {
});
this.initPage()
},
/**
@@ -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() {
wx.openLocation({
@@ -158,7 +173,41 @@ Page({
venueId: id
}).then(res => {
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 => {
console.log(err);
@@ -176,6 +225,7 @@ Page({
this.setData({
flg: 100
})
this.initPage()
},
// 关闭购买vip弹框