WeChatアプレットはカスタマーサービスボタンを非表示にし、リマインダーカードを画像に置き換えて追加することにより、いつでも閉じることができます。

clipboard.png

図に示すように、このケースの右下隅にあるカスタマーサービスボタンと青いグラデーションプロンプトカードはいつでも閉じることができます。

WeChatの担当者がカスタマーサービスのボタンラベルを提供しました
<contact-button type="default-dark" size="100"></contact-button>

このラベルのスタイルは変更できません。変更する画像を変更したい場合は、どうすればよいですか?私の写真のスタイルのように。
私の顧客サービスコントロールは完全なビューで中央の位置に配置されるため、最初に位置ごとに中央の位置に配置し、サイズを最大化します。

次に、透明度を0に設定し、完全な円のビューの画像の背景を設定します。画像は、表示するアイコンです

キューカード

プロンプトカードはビューです。ビューには、非表示イベントをバインドするための×があります。bindtap = "onChangeShowState"は、ビューを非表示にするために使用されます

index.wxml

<!-- 提示卡片 -->
<view class="bright789_view_hide{{showView?'bright789_view_show':''}}">
  <view class="bright789-text">
      <view bindtap="onChangeShowState" class="close">×</view>
      <view class="text">有疑问可以点这里咨询哦</view>
  </view>
</view>
<!-- 悬浮按钮 -->
<view class="zixun"><contact-button type="default-dark" size="100" class="kf"></contact-button></view>

index.wxss

.zixun{
  width: 55px;
  height: 55px;
  background: url(http://wxpad.cn/yunpan/cdn/imgsrc/1530949769.png)no-repeat;
  position: fixed;
  bottom: 35px;
  right: 35px;
  border-radius: 50%;
  box-shadow: 0 0 5px #ddd;
  text-align: center;
  font-size: 14px;
  color: #333;
}

.zixun .kf{
  position: relative;
  top: 0px;
  left: 0px;
  margin:15px auto;
  opacity: 0;
}

.bright789-text{
  position: fixed;
  bottom: 100px;
  right: 65px;
  width: 200px;
  height: 45px;
  background-image: linear-gradient(to left, #4481eb 0%, #04befe 100%);
  border-bottom-left-radius: 50px;
  border-top-left-radius: 50px;
  border-top-right-radius: 50px;
  z-index: 99999999;
  box-shadow: 0 0 10px #eee;
  line-height: 40px;
  text-indent: 15px;
}

.bright789-text .close{
  font-size: 1.5em;
  color: #fff;
}


.bright789-text .text{
  font-size: 13px;
  color: #fff;
  margin-top: -38px;
  margin-left: 20px;
}

.bright789_view_hide{
    display: none;
}

index.js

//index.js
//获取应用实例
const app = getApp()
Page({
  data: {
    showView: true
  },

onLoad: function (options) {
  // 生命周期函数--监听页面加载
  showView: (options.showView == "true" ? true : false)
},
onChangeShowState: function () {
  var that = this;
  that.setData({
    showView: (!that.data.showView)
  })
 }
})

よし、製作完了!

clipboard.png

著者:暴落

おすすめ

転載: www.cnblogs.com/jlfw/p/12707523.html