baodeng_xcx/pages/index/index.vue

258 lines
6.0 KiB
Vue
Raw Normal View History

2023-11-27 09:57:03 +08:00
<template>
2024-01-27 16:37:52 +08:00
<view class="page">
2025-08-19 17:02:49 +08:00
<u-navbar :is-back="false" title=" " :border-bottom="false" back-icon-color="000" :background="bgc"
2025-05-19 18:02:41 +08:00
title-color='#fff' title-size='36' height='44' id="navbar">
2024-01-27 16:37:52 +08:00
</u-navbar>
2025-08-19 17:02:49 +08:00
<image class="bj" src="https://api.ccttiot.com/smartmeter/img/static/uofu8p6fV4G4FF2Z9mgI" mode=""></image>
<!-- <view class="jilu neon-button" @click="btnbd(2)">
2025-06-06 11:14:06 +08:00
拼桌
</view>
2025-06-19 17:41:39 +08:00
<view class="jilu neon-button" style="top: 500rpx;" @click="btnbd(3)">
点单
2025-08-19 17:02:49 +08:00
</view> -->
<!-- <view class="jilu neon-button" style="top: 500rpx;" @click="btnqu">
取号
</view> -->
<view class="jilu neon-button" style="width: 82rpx;height: 82rpx;" @click="btnbd(4)">
<image src="https://api.ccttiot.com/smartmeter/img/static/umq8VInMClfdTFJcrcdL" mode=""></image>
2025-06-19 17:41:39 +08:00
</view>
2025-08-19 17:02:49 +08:00
<!-- <view class="jilu neon-button" style="top: 700rpx;" @click="btnbd(5)">
充值
2025-07-03 14:20:19 +08:00
</view>
2025-05-19 18:02:41 +08:00
<view class="boxpic">
2025-06-06 11:14:06 +08:00
<image class="bd" @click="btnbd(1)" src="https://api.ccttiot.com/smartmeter/img/static/uQdax0INyCWNnNqWXerD"
2025-05-19 18:02:41 +08:00
mode=""></image>
2025-08-19 17:02:49 +08:00
</view> -->
<view class="caozuo">
<image @click="btnbd(1)" src="https://api.ccttiot.com/smartmeter/img/static/uEqBcBUMOPqyoXsULOp6" mode=""></image>
<image @click="btnbd(2)" src="https://api.ccttiot.com/smartmeter/img/static/up59WN8jtClAX8e7VaBa" mode=""></image>
2025-05-19 18:02:41 +08:00
</view>
2023-11-27 09:57:03 +08:00
</view>
</template>
<script>
2025-05-14 15:14:12 +08:00
var xBlufi = require("@/components/blufi/xBlufi.js")
2023-11-27 09:57:03 +08:00
export default {
data() {
return {
2025-05-19 18:02:41 +08:00
bgc: {
2025-08-19 17:02:49 +08:00
backgroundColor: " ",
2025-09-09 11:25:47 +08:00
kazuoid:'',
q:''
2025-05-19 18:02:41 +08:00
},
2025-05-14 15:14:12 +08:00
}
2025-05-19 18:02:41 +08:00
},
2025-05-14 15:14:12 +08:00
onLoad(option) {
2025-05-19 18:02:41 +08:00
if (uni.getStorageSync('type')) {
2025-05-14 15:14:12 +08:00
uni.removeStorageSync('type')
2025-05-19 18:02:41 +08:00
} else {
2025-05-14 15:14:12 +08:00
xBlufi.initXBlufi(1)
2024-03-13 10:54:22 +08:00
}
2025-09-09 11:25:47 +08:00
if (option.q) { //判断是否直接扫码进入 解析携带参数
this.q = option.q
const getQueryParam = (url, paramName) => {
const regex = new RegExp(`[?&]${paramName}=([^&]*)`)
const results = regex.exec(url)
return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null
}
const sceneValue = option.q
const decodedValue = decodeURIComponent(sceneValue)
this.kazuoid = getQueryParam(decodedValue, 'k')
console.log(this.kazuoid,option.q);
if (!this.kazuoid) { //判断是否解析成功 有无id
uni.showModal({
title: '提示',
content: '无效的二维码',
confirmText: '知道了',
showCancel: false,
success: (res) => {
if (res.confirm) {}
}
})
return
}
uni.showLoading({
title: '绑定中...',
mask: true
})
// 有id的话 一进入直接就进行绑定操作
this.$u.get(`/app/booth/getBoothDetail/${this.kazuoid}`).then(res => {
uni.hideLoading()
if (res.code == 200) {
} else {
uni.showModal({
title: '提示',
content: res.msg,
confirmText: '知道了',
showCancel: false,
success: (res) => {
if (res.confirm) {}
}
})
}
}).catch(() => {
uni.hideLoading()
uni.showModal({
title: '提示',
content: '绑定失败,请重试',
confirmText: '知道了',
showCancel: false,
success: (res) => {
if (res.confirm) {}
}
})
})
}
2024-03-13 10:54:22 +08:00
},
2025-05-14 15:14:12 +08:00
onShow() {
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
2023-11-27 09:57:03 +08:00
},
methods: {
2025-08-19 17:02:49 +08:00
btnqu(){
uni.navigateTo({
url:'/page_shanghu/paidui/index'
})
},
2025-05-19 18:02:41 +08:00
// 点击提示暂无功能
btnwu() {
uni.showToast({
title: '当前功能暂未开放',
icon: 'none',
duration: 2000
})
},
// 点击跳转到爆灯
2025-06-06 11:14:06 +08:00
btnbd(num) {
2025-05-19 18:02:41 +08:00
this.$u.get(`/getInfo`).then(res => {
if (res.code == 200) {
2025-08-19 17:02:49 +08:00
if(num == 1){ //跳转爆灯
2025-09-09 11:25:47 +08:00
console.log(11111);
2025-06-06 11:14:06 +08:00
uni.navigateTo({
2025-09-09 11:25:47 +08:00
url: '/pages/myorder/index?q=' + this.q
2025-06-06 11:14:06 +08:00
})
2025-08-19 17:02:49 +08:00
}else if(num == 2){ //跳转拼桌
2025-06-06 11:14:06 +08:00
uni.navigateTo({
url:'/page_user/pingzhuo/index'
})
2025-08-19 17:02:49 +08:00
}else if(num == 3){ //跳转点单
2025-06-19 17:41:39 +08:00
uni.navigateTo({
url:'/page_user/diandan/index'
})
2025-08-19 17:02:49 +08:00
}else if(num == 4){ //跳转VR
2025-07-03 14:20:19 +08:00
uni.navigateTo({
url:'/page_user/vr'
})
2025-08-19 17:02:49 +08:00
}else if(num == 5){ //跳转充值
uni.navigateTo({
url:'/page_user/chongzhi/index'
})
2025-06-06 11:14:06 +08:00
}
2025-05-19 18:02:41 +08:00
} else if (res.code == 401) {
uni.showModal({
title: '提示',
content: '你还未登录,是否去登录?',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定')
uni.reLaunch({
url: '/pages/login/login'
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
2025-05-14 15:14:12 +08:00
})
2025-05-19 18:02:41 +08:00
}
})
},
2023-11-27 09:57:03 +08:00
}
}
</script>
2024-01-27 16:37:52 +08:00
<style lang="scss">
2024-03-13 10:54:22 +08:00
page {
2025-05-14 15:14:12 +08:00
background: #fff;
border-radius: 0rpx 0rpx 0rpx 0rpx;
2024-03-13 10:54:22 +08:00
}
2025-08-19 17:02:49 +08:00
.caozuo{
width: 100%;
height: 206rpx;
display: flex;
align-items: center;
justify-content: space-between;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 100rpx;
image{
width: 312rpx;
height: 206rpx;
}
padding: 0 48rpx;
box-sizing: border-box;
}
2025-05-19 18:02:41 +08:00
/deep/ .u-line-1 {
2025-05-14 15:14:12 +08:00
padding-bottom: 14rpx;
}
2025-06-06 11:14:06 +08:00
.neon-button {
position: relative;
background: linear-gradient(90deg, #FF00FF, #00FFFF);
background-size: 200% 100%;
animation: neonGradient 3s linear infinite;
border-radius: 50rpx;
box-shadow: 0 0 10rpx rgba(255, 0, 255, 0.5),
0 0 20rpx rgba(0, 255, 255, 0.5);
transition: all 0.3s ease;
&:active {
transform: scale(0.95);
box-shadow: 0 0 5rpx rgba(255, 0, 255, 0.3),
0 0 10rpx rgba(0, 255, 255, 0.3);
}
}
.jilu {
position: fixed;
2025-08-19 17:02:49 +08:00
right: 30rpx;
top: 220rpx;
// padding-top: 10rpx;
2025-06-06 11:14:06 +08:00
box-sizing: border-box;
}
2025-05-19 18:02:41 +08:00
.boxpic {
width: 500rpx;
2025-05-14 15:14:12 +08:00
margin: auto;
margin-top: 460rpx;
2025-05-19 18:02:41 +08:00
.bdpic {
2025-05-14 15:14:12 +08:00
width: 580rpx;
margin: auto;
2024-03-13 10:54:22 +08:00
display: flex;
2025-05-14 15:14:12 +08:00
justify-content: space-between;
margin-top: 14rpx;
2025-05-19 18:02:41 +08:00
image {
2025-05-14 15:14:12 +08:00
width: 274rpx;
height: 138rpx;
2024-03-13 10:54:22 +08:00
}
2025-08-19 17:02:49 +08:00
2024-03-13 10:54:22 +08:00
}
2025-05-19 18:02:41 +08:00
.bd {
width: 500rpx;
height: 200rpx;
margin-top: 500rpx;
2024-03-25 19:46:07 +08:00
}
}
2025-05-19 18:02:41 +08:00
.bj {
width: 760rpx;
height: 110vh;
2025-05-14 15:14:12 +08:00
position: fixed;
top: 0;
2025-05-19 18:02:41 +08:00
left: -10rpx;
2025-05-14 15:14:12 +08:00
z-index: -1;
2024-01-27 16:37:52 +08:00
}
2024-03-13 10:54:22 +08:00
</style>