以下代码可用于在微信小程序中的客服咨询与用户分享操作。按钮通过设置 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;
}
本站资源仅供学习交流使用请勿商业运营,严禁使用模板&源码从事违法,侵权等非法活动!如链接失效内容有误,请到评论反馈。
免费声明
- 本网站的文章内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长QQ:304906607进行删除处理。
- 文章采用: 《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)。
- 本站资源大多存储在云盘,如发现链接失效,请联系我们我们会第一时间更新。
- 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
- 本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
- 本站永久网址:https://www.aybk.cn
PHP怎么实现微信小程序内容安全识别接口?
« 上一篇
07-13
情侣小窝 Like_Girl源码V5.1.1
下一篇 »
07-13

发表评论
请先登录后才能发表评论