index.js 901 B

12345678910111213141516171819202122232425262728293031323334
  1. Component({
  2. properties: {
  3. list: Array,
  4. deleteItem: Function
  5. },
  6. options: {
  7. addGlobalClass: true
  8. },
  9. methods: {
  10. handleItem(e) {
  11. const {
  12. item,
  13. name
  14. } = e.target.dataset,
  15. that = this;
  16. if (!item) return;
  17. if (name == 'edit') {
  18. wx.navigateTo({
  19. url: '/packageA/setclient/modules/bankcard/update?data=' + JSON.stringify(item)
  20. })
  21. } else {
  22. wx.showModal({
  23. title: `提示`,
  24. content: '是否确定删除?',
  25. complete: ({
  26. confirm
  27. }) => {
  28. if (confirm) that.triggerEvent("deleteItem", item)
  29. }
  30. })
  31. }
  32. }
  33. }
  34. })