当前位置:首页 > 精品收藏

uniapp底部midButton模板(PSD文件)

Z先生4年前 (2021-12-02)精品收藏973

uniapp底部突起按钮

效果演示:

实现方法

pages.json文件中,tabBar部分设置

"tabBar": {
        "color": "#aaaaaa",
        "selectedColor": "#666666",
        "borderStyle": "black",
        "backgroundColor": "#ffffff",
        "list": [{
            "pagePath": "pages/index/index",
            "iconPath": "static/tab-bar/home.png",
            "selectedIconPath": "/static/tab-bar/home@action.png",
            "text": "首页"
        }, {
            "pagePath": "pages/user/index",
            "iconPath": "static/tab-bar/me.png",
            "selectedIconPath": "static/tab-bar/me@action.png",
            "text": "我的"
        }],
        "midButton": {
            "width": "80px",
            "height": "80px",
            // "text": "扫一扫",
            "iconPath": "static/tab-bar/scan.png",
            "iconWidth": "80px"
            // "backgroundImage": "static/tab-bar/scan@backgroundImage.png"
        }
    },

响应方法

只能通过uni.onTabBarMidButtonTap来相应tab事件。

        scanBtn() {
            let that = this;
            uni.onTabBarMidButtonTap(function() {
                that.$message.tips('调用扫码')
                // #ifdef APP-PLUS
                uni.scanCode({
                    // onlyFromCamera: true,
                    success: function(res) {
                        console.log('条码类型:' + res.scanType);
                        console.log('条码内容:' + res.result);
                        that.$message.tips('扫码结果:' + res.result)
                    }
                });
                // #endif
            })
        }

下载地址:

midButton模板.zip

分享给朋友:

相关文章

北京时间在线API接口

淘宝:http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp苏宁:http://quan.suning.com/getSys…

右键菜单以管理员方式运行命令行

找了一堆资料终于是找到方法。然后自己手动设置了之后导出整合了一下。将以下内容复制保存为reg文件,双击导入即可。……

Windows10手动数字权利激活-需进一步测试

前提条件 确保电脑的win10系统是10586.36或14393.0以上版本,如果不是,则需要重新安装或升级。 步骤 更换三次序列号 点击更改产品密钥,输入PW48G-MNG8W-B9978-YWB…

在Windows 11中恢复动态磁贴

打开注册表编辑器 打开HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced路径 右键点击A…

将windows server2019打造成个人操作系统

组策略 WIN键R键,输入gpedit.msc,进入组策略设置。 计算机配置——Windows设置——安全设置——帐户策略——密码策略:密码必须符合复杂性要求,设置为已禁用。 ˃ 解决问题:设置帐…

Hyper-V下显卡虚拟化vGPU设置教程(3D加速)

使用Windows 10 20H2版本来部署安装Hyper-V虚拟机系统,其他版本待测试,Windows Server 2022测试不可以,2022的Hpery-V的版本为10,其他版本后面测试了更新…

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。