网友真实露脸自拍10p,成人国产精品秘?久久久按摩,国产精品久久久久久无码不卡,成人免费区一区二区三区

小程序模板網

微信小程序刪除處理

發布時間:2017-12-25 11:38 所屬欄目:小程序開發教程

沒有 confrim 那怎么實現這個效果呢 ?

 
 
 

沒有 confrim 那怎么實現這個效果呢 
可以使用小程序里的模態框 
代碼:

wxml:

 

		
  1. <a class="reply" wx:if="{{comment.uid==comment.login_uid}}" bindtap="del" data-cid="{{comment.c_id}}">刪除</a>

js:

 

		
  1. del:function(e){
  2. var that = this;
  3. wx.showModal({
  4. title: '提示',
  5. content: '確定要刪除嗎?',
  6. success: function (sm) {
  7. if (sm.confirm) {
  8. // 用戶點擊了確定 可以調用刪除方法了
  9. wx.request({
  10. url: 'https://m.*****.com/index.php/Home/Xiaoxxf/home_comment_del?c_id=' + e.currentTarget.dataset.cid, //刪除房間評論
  11. data: '',
  12. header: {
  13. 'Content-Type': 'application/json'
  14. },
  15. method: 'GET',
  16. success: function (res) {
  17. console.log(res);
  18. wx.showToast({
  19. title: res.data, //數據返回提示,查看后臺PHP
  20. icon: 'success',
  21. duration: 2000
  22. })
  23. /* 獲取房間評論信息 -xzz 0714*/
  24. getList(that);
  25. },
  26. fail: function (res) { },
  27. complete: function (res) { },
  28. })
  29. } else if (sm.cancel) {
  30. }
  31. }
  32. })
  33. }

效果:

這樣就實現js的confirm效果了。



易優小程序(企業版)+靈活api+前后代碼開源 碼云倉庫:starfork
本文地址:http://www.xiuhaier.com/wxmini/doc/course/18241.html 復制鏈接 如需定制請聯系易優客服咨詢:800182392 點擊咨詢
QQ在線咨詢
AI智能客服 ×