微信小程序客服分享悬浮按钮代码

作者头像
首页 🧮综合教程 正文

image.png

以下代码可用于在微信小程序中的客服咨询与用户分享操作。按钮通过设置 plain='true' 来使其显示为简单的图标按钮,按钮的位置和样式通过 CSS 进行了详细的定制,确保在不同屏幕大小和设备上都能良好显示和使用,以下为参考代码。

代码实现

样式一,无文字有图片

    <button plain='true' open-type="contact" class="contact">
      <image mode='aspectFill' src='../../images/my/kefuwechat.png' class='cs-image'></image>
    </button>
    <button plain='true' open-type="share" class="share">
      <image mode='aspectFill' src='../../images/my/share.png' class='cs-image'></image>
    </button>
.cs-image {
  width: 80rpx;
  height: 80rpx;
}
.contact[plain],
.share[plain] {
  display: flex;
  margin-right: 20rpx;
  right: 0;
  position: fixed;
  padding: 0;
  border: none;
  width: 80rpx;
  height: 80rpx;
}
.contact[plain] {
  bottom: 18%;
}
.share[plain] {
  bottom: 10%;
}

样式二,无图片有文字

<button  open-type="contact" class="bt-view" hoverClass="btn-hover"> <text class="text-df margin-left-xs">客服管理</text></button>
<button open-type="share" class="bt2-view" hoverClass="btn-hover"> <text class="text-df margin-left-xs">分享朋友</text></button>
.bt-view,
.bt2-view {
  align-items: center;
  background: #1c91ff;
  border: 1rpx solid #96969686;
  border-bottom-left-radius: 500rpx;
  border-top-left-radius: 500rpx;
  box-shadow: 0 5rpx 20rpx rgba(34, 34, 34, .5);
  color: #fff;
  display: flex;
  filter: drop-shadow(rgba(102, 102, 102, .2) 5px 5px 11px);
  font-weight: 700;
  height: 70rpx !important;
  letter-spacing: 2rpx;
  padding: 10rpx 5rpx 10rpx 20rpx;
  position: fixed;
  right: 0rpx;
  z-index: 999;
}

.bt-view {
  bottom: 230rpx;
}

.bt2-view {
  bottom: 130rpx;
}
本站资源仅供学习交流使用请勿商业运营,严禁使用模板&源码从事违法,侵权等非法活动!如链接失效内容有误,请到评论反馈。

免费声明

  1. 本网站的文章内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长QQ:304906607进行删除处理。
  2. 文章采用: 《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)。
  3. 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
  4. 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
  5. 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
  6. 本站永久网址:https://www.aybk.cn
PHP怎么实现微信小程序内容安全识别接口?
« 上一篇 07-13
情侣小窝 Like_Girl源码V5.1.1
下一篇 » 07-13

发表评论

请先登录后才能发表评论

没有更多评论了

个人信息

HI好朋友 ! 请登录
开通会员,享受下载全站资源特权。
百度一下

随便看看

大家都在看

2025年 乙巳年 蛇年
13 : 36 : 00
公历日期
9月26日
农历日期
八月初五
星期
星期五
下午好
金秋时节,愿您收获满满
距离国庆节还有5天
登陆
还没有账号?立即注册
点击按钮进行验证
忘记密码?
登陆
忘记密码
已经有账号?马上登陆
获取验证码
重新获取(60s)
点击按钮进行验证
重置密码
注册
已经有账号?马上登陆
获取验证码
重新获取(60s)
点击按钮进行验证
立即注册