测试页面生成二维码1.0

This commit is contained in:
WindowBird 2025-08-15 17:45:56 +08:00
parent ed980fd261
commit 41bc4cce96

View File

@ -1,10 +1,10 @@
<template>
<view class="page">
<view :style="{ backgroundColor: CommonEnum.BASE_COLOR }" class="header">
<view class="qrcode-container">
<uv-qrcode
ref="qrcode"
:options="options"
:value="value"
:options="options"
canvas-id="qrcode"
size="300rpx"
></uv-qrcode>
@ -19,49 +19,42 @@ export default {
components: { UvQrcode },
data() {
return {
value: "sb",
value: "测试二维码内容",
options: {
useDynamicSize: false,
errorCorrectLevel: "Q",
margin: 10,
areaColor: "#fff",
// logo
},
areaColor: "#fff"
}
};
},
onLoad() {
//
this.$nextTick(() => {
this.$refs.qrcode.remake({
success: () => {
console.log("生成成功");
console.log("二维码生成成功");
},
fail: (err) => {
console.log(err);
},
console.error("二维码生成失败:", err);
}
});
});
},
methods: {
//
},
}
};
</script>
<style lang="scss" scoped>
.page {
background: #f5f0e7;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.header {
width: 100%;
//min-height: 100vh;//
display: flex;
align-items: flex-start;
flex-direction: column;
padding: 200rpx 200rpx;
padding-bottom: 40rpx;
.qrcode-container {
padding: 40rpx;
background: white;
border-radius: 20rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
}
</style>