例如在 index 首页增加客服代码及一键拨打电话
1index.wxss 或者 app.wxss 文件里增加样式
- .img - plus - style {
- height: 70rpx;
- width: 70rpx;
- position: fixed;
- bottom: 220rpx;
- right: 30rpx;
- opacity: 0.7
- }.img - plus - style1 {
- height: 70rpx;
- width: 70rpx;
- position: fixed;
- bottom: 130rpx;
- right: 30rpx;
- opacity: 0.7
- }.zindex100 {z - index: 100}.yc {
- opacity: 0
- }
2index.wxml 文件增加代码
- <view>
- <contact-button type="default-dark" size="20" session-from="weapp" class="img-plus-style zindex100 yc">
- </contact-button>
- <image src="../../image/xk_kefu.png" class="img-plus-style"></image>
- <image src="../../image/xk_tel.png" class="img-plus-style1" bindtap="calling"></image>
- </view>
3index.js 增加 一键拨号
- calling: function () {
- wx.makePhoneCall({
- phoneNumber: '10086',
- })
- },
4 把两个图标放在 image 目录下
来源: https://blog.csdn.net/rolan1993/article/details/79709553