Kaynağa Gözat

feat: test weixin api promise

wangyuan 2 yıl önce
ebeveyn
işleme
7c9313a7e2
2 değiştirilmiş dosya ile 10 ekleme ve 0 silme
  1. 9 0
      pages/aatest/test.js
  2. 1 0
      pages/aatest/test.wxml

+ 9 - 0
pages/aatest/test.js

@@ -9,6 +9,15 @@ Page({
     headImg: '',
     nickname: ''
   },
+  handleToast () {
+    wx.showToast({
+      title: '测试Toast',
+      icon: 'success'
+    }).then(res => {
+      console.log('success t', res);
+    })
+  },
+
   submit () {
     console.log(this.data.headImg, this.data.nickname);
   },

+ 1 - 0
pages/aatest/test.wxml

@@ -6,5 +6,6 @@
     <image src="{{headImg}}"></image>
     <input type="nickname" model:value="{{nickname}}" class="weui-input" placeholder="请输入昵称"/>
     <button bindtap="submit">提交</button>
+    <button bindtap="handleToast">Toast Promise</button>
   </view>
 </view>