192 lines
3.6 KiB
Vue
192 lines
3.6 KiB
Vue
<template>
|
||
<div class="container">
|
||
<view class="title-back">
|
||
<view class="left-father" @click="goBack">
|
||
<image class="back-img" src="https://www.focusnu.com/media/directive/index/left.png" />
|
||
</view>
|
||
</view>
|
||
<!-- <view class="white-content"> -->
|
||
<!-- <image class="big-bgc" src="https://www.focusnu.com/media/directive/index/saoyisao/kuai.png" /> -->
|
||
<view class="big-img" @click="onScan">
|
||
<image style="width: 100%;height: 100%;"
|
||
src="https://www.focusnu.com/media/directive/index/saoyisao/kuai.png" />
|
||
<view class="big-img-third">
|
||
<view class="big-img-second">
|
||
<image style="width: 70%;height: 70%;"
|
||
src="https://www.focusnu.com/media/directive/index/saoyisao/sao.png" />
|
||
</view>
|
||
</view>
|
||
<view class="big-font">
|
||
点击扫描区域二维码
|
||
</view>
|
||
</view>
|
||
|
||
<!-- </view> -->
|
||
</div>
|
||
</template>
|
||
|
||
<script setup>
|
||
import {
|
||
ref,
|
||
reactive
|
||
} from 'vue'
|
||
import {
|
||
onLoad,
|
||
onShow
|
||
} from '@dcloudio/uni-app';
|
||
import {
|
||
base_url
|
||
} from '@/request/index.js';
|
||
|
||
|
||
const goBack = () => {
|
||
uni.navigateBack()
|
||
}
|
||
async function onScan() {
|
||
// try {
|
||
// uni.scanCode 支持 Promise 风格(HBuilderX 编译后支持)
|
||
const res = await uni.scanCode();
|
||
console.log('scan result', res.result);
|
||
result.value = res.result;
|
||
uni.showToast({
|
||
title: res.result,
|
||
icon: 'none'
|
||
});
|
||
// } catch (err) {
|
||
// console.error('scan error', err);
|
||
// uni.showToast({
|
||
// title: '扫码被取消或失败',
|
||
// icon: 'none'
|
||
// });
|
||
// }
|
||
}
|
||
onLoad(() => {
|
||
|
||
|
||
})
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.container {
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-height: 100vh;
|
||
width: 100%;
|
||
background-color: #F7F7F7;
|
||
position: relative;
|
||
|
||
.title-back {
|
||
margin-top: 100rpx;
|
||
width: 100%;
|
||
height: 100rpx;
|
||
display: flex;
|
||
justify-content: space-between;
|
||
align-items: center;
|
||
}
|
||
|
||
.left-father {
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
.back-img {
|
||
width: 45rpx;
|
||
height: 40rpx;
|
||
margin-left: 40rpx;
|
||
margin-right: 15rpx;
|
||
}
|
||
}
|
||
|
||
.white-content {
|
||
width: 96%;
|
||
margin-left: 2%;
|
||
height: 600rpx;
|
||
border-radius: 50rpx;
|
||
background-color: #fff;
|
||
position: relative;
|
||
}
|
||
}
|
||
|
||
.big-bgc {
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
width: 1800rpx;
|
||
height: 900rpx;
|
||
|
||
}
|
||
|
||
.big-img {
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
width: 250rpx;
|
||
height: 250rpx;
|
||
|
||
&::before {
|
||
content: "";
|
||
position: absolute;
|
||
top: 0;
|
||
left: 0;
|
||
width: 100%;
|
||
animation: scanMove 1.3s ease-in-out infinite;
|
||
z-index: 1001;
|
||
height: 80rpx; // 尾巴长度
|
||
background: linear-gradient(to top,
|
||
rgba(5, 170, 254, 0.6),
|
||
rgba(5, 170, 254, 0.1),
|
||
transparent);
|
||
will-change: transform;
|
||
}
|
||
|
||
.big-img-third {
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
width: 90%;
|
||
height: 90%;
|
||
border-radius: 50rpx;
|
||
background-color: #F1F5FD;
|
||
|
||
.big-img-second {
|
||
position: absolute;
|
||
top: 50%;
|
||
left: 50%;
|
||
transform: translate(-50%, -50%);
|
||
width: 80%;
|
||
height: 80%;
|
||
border-radius: 50rpx;
|
||
background-color: #E0EAFA;
|
||
display: flex;
|
||
justify-content: center;
|
||
align-items: center;
|
||
}
|
||
}
|
||
}
|
||
|
||
.big-font {
|
||
position: absolute;
|
||
color: #888A8B;
|
||
left: 50%;
|
||
transform: translateX(-50%);
|
||
bottom: -150rpx;
|
||
font-size: 32rpx;
|
||
width: 600rpx;
|
||
// width: ;
|
||
display: flex;
|
||
justify-content: center;
|
||
}
|
||
|
||
// 扫描动画关键帧
|
||
@keyframes scanMove {
|
||
0% {
|
||
top: -10%;
|
||
}
|
||
|
||
100% {
|
||
top: 75%;
|
||
}
|
||
}
|
||
</style> |