示例:

插件地址:suspensionButton 悬浮按钮 - DCloud 插件市场



使用方式:

import pxSuspenButton from '@/components/px-suspen-button/index'
components: { pxSuspenButton },
- :centerIcon="centerIcon"
- :bgColor="bgColor"
- :size="size"
- :turn="turn"
- :left="left"
- :top="top"
- :opacity="opacity"
- @click="clickWindow">
- export default {
- data () {
- return {
- centerIcon: 'xxxxx.png', //悬浮按钮自定义图片
- bgColor: 'transparent',
- size: 160, //悬浮按钮大小
- turn: false, //点击中心按钮是否展开扇形子菜单,false:禁止展开
- left: '80%', //悬浮按钮离屏幕左边距离
- top: '76%', //悬浮按钮离屏幕顶部距离
- opacity: 1, //悬浮按钮透明度
- }
我这里只做了点击按钮跳转到指定页面的操作,可根据具体需求进行二次修改
- clickWindow(){
- let type = 'realName'
- uni.navigateTo({
- url: `../operationGuide/operationGuide?type=${type}`
- })
- },