WeChat ミニ プログラム API インタラクション フィードバック


wx.showToast(OBJECT)

WeChat アプレットはメッセージ プロンプト ボックスを表示します

OBJECT パラメーターの説明:

QQ截图20170208131632.png

サンプル コード:

wx.showToast({
  title: '成功',
  icon: 'success',
  duration: 2000
})

wx.hideToast()

メッセージ プロンプト ボックスを非表示にする

wx.showToast({
  title: '加载中',
  icon: 'loading',
  duration: 10000
})

setTimeout(function(){
  wx.hideToast()
},2000)

wx。 showModal ( OBJECT)

WeChat アプレットはモーダル ポップアップ ウィンドウを表示します

OBJECT パラメーターの説明:

QQ截图20170208131651.png

サンプル コード:

wx.showModal({
  title: '提示',
  content: '这是一个模态弹窗',
  success: function(res) {
    if (res.confirm) {
      console.log('用户点击确定')
    }
  }
})

wx.showActionSheet(OBJECT)

WeChat アプレットは操作メニューを表示します

OBJECT パラメーターの説明:

QQ截图20170208131711.png

成功の戻りパラメータの説明:

QQ截图20170208131723.png

サンプルコード:

wx.showActionSheet({
  itemList: ['A', 'B', 'C'],
  success: function(res) {
    if (!res.cancel) {
      console.log(res.tapIndex)
    }
  }
})

バグとヒント

  1. bugAndroid 6.3.30、wx.showModalによって返される確認は常にtrueです。