测试页面生成二维码

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. .DS_Store.
/config/dev.js /config/dev.js
.idea/ .idea/
uni_modules/

View File

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