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

 

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

一、index.wxss或者app.wxss文件裏增長樣式session

.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}

 

二、index.wxml文件增長代碼app

<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>

 

三、index.js增長 一鍵撥號xss

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

 

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

xk_kefu.png xk_tel.png

 

 

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

相關文章
相關標籤/搜索