测试页面生成二维码

This commit is contained in:
WindowBird 2025-08-15 17:35:58 +08:00
parent dcacef8b92
commit ed980fd261
4 changed files with 130 additions and 41 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ unpackage/
.DS_Store.
/config/dev.js
.idea/
uni_modules/

View File

@ -215,6 +215,13 @@
{
"navigationStyle": "custom"
}
},
{
"path" : "pages/basePage/test",
"style" :
{
"navigationStyle": "custom"
}
}
],
"subPackages": [

67
pages/basePage/test.vue Normal file
View File

@ -0,0 +1,67 @@
<template>
<view class="page">
<view :style="{ backgroundColor: CommonEnum.BASE_COLOR }" class="header">
<uv-qrcode
ref="qrcode"
:options="options"
:value="value"
canvas-id="qrcode"
size="300rpx"
></uv-qrcode>
</view>
</view>
</template>
<script>
import UvQrcode from "../../uni_modules/uv-qrcode/components/uv-qrcode/uv-qrcode.vue";
export default {
components: { UvQrcode },
data() {
return {
value: "sb",
options: {
useDynamicSize: false,
errorCorrectLevel: "Q",
margin: 10,
areaColor: "#fff",
// logo
},
};
},
onLoad() {
//
this.$nextTick(() => {
this.$refs.qrcode.remake({
success: () => {
console.log("生成成功");
},
fail: (err) => {
console.log(err);
},
});
});
},
methods: {
//
},
};
</script>
<style lang="scss" scoped>
.page {
background: #f5f0e7;
}
.header {
width: 100%;
//min-height: 100vh;//
display: flex;
align-items: flex-start;
flex-direction: column;
padding: 200rpx 200rpx;
padding-bottom: 40rpx;
}
</style>

View File

@ -11,7 +11,9 @@
],
"repository": "https://gitee.com/liangei/lime-echart",
"engines": {
"HBuilderX": "^3.6.4"
"HBuilderX": "^3.6.4",
"uni-app": "^3.1.0",
"uni-app-x": "^3.1.0"
},
"dcloudext": {
"sale": {
@ -31,53 +33,65 @@
"permissions": "无"
},
"npmurl": "",
"type": "component-vue"
"type": "component-vue",
"darkmode": "-",
"i18n": "-",
"widescreen": "-"
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
"tcb": "",
"aliyun": ""
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y",
"app-uvue": "y"
"uni-app": {
"vue": {
"vue2": "-",
"vue3": "-"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
"web": {
"safari": "-",
"chrome": "-"
},
"H5-pc": {
"Chrome": "u",
"IE": "u",
"Edge": "u",
"Firefox": "u",
"Safari": "u"
"app": {
"vue": "-",
"nvue": "-",
"android": "-",
"ios": "-",
"harmony": "-"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "u",
"快手": "u",
"飞书": "u",
"京东": "u"
"mp": {
"weixin": "-",
"alipay": "-",
"toutiao": "-",
"baidu": "-",
"kuaishou": "-",
"jd": "-",
"harmony": "-",
"qq": "-",
"lark": "-"
},
"快应用": {
"华为": "u",
"联盟": "u"
"quickapp": {
"huawei": "-",
"union": "-"
}
},
"Vue": {
"vue2": "y",
"vue3": "y"
"uni-app-x": {
"web": {
"safari": "-",
"chrome": "-"
},
"app": {
"android": "-",
"ios": "-",
"harmony": "-"
},
"mp": {
"weixin": "-"
}
}
}
}