123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- "use strict";
- const common_vendor = require("../../../common/vendor.js");
- const _sfc_main = {
- data() {
- return {
- ifShow: true,
- val: "二维码",
- // 要生成的二维码值
- size: 200,
- // 二维码大小
- unit: "upx",
- // 单位
- background: "#b4e9e2",
- // 背景色
- foreground: "#309286",
- // 前景色
- pdground: "#32dbc6",
- // 角标色
- icon: "",
- // 二维码图标
- iconsize: 40,
- // 二维码图标大小
- lv: 3,
- // 二维码容错级别 , 一般不用设置,默认就行
- onval: false,
- // val值变化时自动重新生成二维码
- loadMake: true,
- // 组件加载完成后自动生成二维码
- src: ""
- // 二维码生成后的图片地址或base64
- };
- },
- methods: {
- sliderchange(e) {
- this.size = e.detail.value;
- },
- creatQrcode() {
- this.$refs.qrcode._makeCode();
- },
- saveQrcode() {
- this.$refs.qrcode._saveCode();
- },
- qrR(res) {
- this.src = res;
- },
- clearQrcode() {
- this.$refs.qrcode._clearCode();
- this.val = "";
- },
- ifQrcode() {
- this.ifShow = !this.ifShow;
- },
- selectIcon() {
- let that = this;
- common_vendor.index.chooseImage({
- count: 1,
- //默认9
- sizeType: ["original", "compressed"],
- //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album"],
- //从相册选择
- success: function(res) {
- that.icon = res.tempFilePaths[0];
- setTimeout(() => {
- that.creatQrcode();
- }, 100);
- }
- });
- }
- }
- };
- if (!Array) {
- const _easycom_geek_qrcode2 = common_vendor.resolveComponent("geek-qrcode");
- _easycom_geek_qrcode2();
- }
- const _easycom_geek_qrcode = () => "../../../components/geek-xd/components/geek-qrcode/geek-qrcode.js";
- if (!Math) {
- _easycom_geek_qrcode();
- }
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
- return common_vendor.e({
- a: $data.ifShow
- }, $data.ifShow ? {
- b: common_vendor.sr("qrcode", "25c1dd0f-0"),
- c: common_vendor.o($options.qrR),
- d: common_vendor.p({
- cid: "qrcode1",
- val: $data.val,
- size: $data.size,
- unit: $data.unit,
- background: $data.background,
- foreground: $data.foreground,
- pdground: $data.pdground,
- icon: $data.icon,
- iconSize: $data.iconsize,
- lv: $data.lv,
- onval: $data.onval,
- loadMake: $data.loadMake,
- usingComponents: true
- })
- } : {}, {
- e: $data.ifShow
- }, $data.ifShow ? {
- f: common_vendor.sr("qrcode2", "25c1dd0f-1"),
- g: common_vendor.o($options.qrR),
- h: common_vendor.p({
- cid: "qrcode2",
- val: "第二个二维码",
- size: $data.size,
- onval: $data.onval,
- loadMake: $data.loadMake,
- usingComponents: true
- })
- } : {}, {
- i: $data.val,
- j: common_vendor.o(($event) => $data.val = $event.detail.value),
- k: $data.size,
- l: common_vendor.o((...args) => $options.sliderchange && $options.sliderchange(...args)),
- m: common_vendor.o((...args) => $options.selectIcon && $options.selectIcon(...args)),
- n: common_vendor.o((...args) => $options.creatQrcode && $options.creatQrcode(...args)),
- o: common_vendor.o((...args) => $options.saveQrcode && $options.saveQrcode(...args)),
- p: common_vendor.o((...args) => $options.clearQrcode && $options.clearQrcode(...args)),
- q: common_vendor.o((...args) => $options.ifQrcode && $options.ifQrcode(...args))
- });
- }
- const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "C:/Users/Administrator/Desktop/srcaaa/pages_geek/pages/code/index.vue"]]);
- wx.createPage(MiniProgramPage);
|