微信小程序增加懸浮在線客服


 

例如在index首頁增加客服代碼及一鍵撥打電話

1、index.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}

 

2、index.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>

 

3、index.js增加 一鍵撥號

calling: function () {
      wx.makePhoneCall({
        phoneNumber: '10086', 
      })
    },

 

4、把兩個圖標放在image目錄下

xk_kefu.png xk_tel.png

 

 

內容參考:http://www.xkmov.net/jiaocheng/xiaochengxu/s294.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM