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

uniapp底部midButton模板(PSD文件)

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

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

分享给朋友:

相关文章

Google浏览器(Chrome)开启Flash最根本的方法

Google浏览器(Chrome)开启Flash最根本的方法

Flash逐渐已经成为被抛弃的对象,个人又习惯用Google浏览器,很多网站还是有一些Flash支持,每次都要手动启用,十分不方便,z先生(f6n.net)经过多次测试寻找,终于觅得此良方,分享给大家…

硬货:微信一些自定义链接

1、通过微信公众号的微信号,获取公众号二维码https://open.weixin.qq.com/qr/code?username=公众号的微信号2、直接打开微信公众号关注页面https://mp.w…

在Windows 11中恢复动态磁贴

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

Windows 2022激活

Windows 2022激活

使用KMS激活方式 设置激活服务器 以管理员身份运行powershell或cmd,输入以下命令 slmgr -skms kms.0t.net.cn 输入激活序列号 Windows2022 桌面版不支持…

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

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

发表评论

访客

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