index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. Component({
  2. properties: {
  3. list: {
  4. type: Array
  5. },
  6. deleteItem: {
  7. type: Function
  8. },
  9. disabled: {
  10. type: Boolean
  11. }
  12. },
  13. options: {
  14. addGlobalClass: true
  15. },
  16. lifetimes: {
  17. attached: function () {
  18. getApp().globalData.Language.getLanguagePackage(this)
  19. }
  20. },
  21. methods: {
  22. handleItem(e) {
  23. const {
  24. item,
  25. name
  26. } = e.target.dataset,
  27. that = this;
  28. if (!item) return;
  29. if (name == 'edit') {
  30. wx.navigateTo({
  31. url: '/packageA/setclient/modules/bankcard/update?data=' + JSON.stringify(item)
  32. })
  33. } else {
  34. wx.showModal({
  35. title: getApp().globalData.Language.getMapText('提示'),
  36. content: getApp().globalData.Language.getMapText('是否确定删除') + '?',
  37. cancelText: getApp().globalData.Language.getMapText('取消'),
  38. confirmText: getApp().globalData.Language.getMapText('确定'),
  39. complete: ({
  40. confirm
  41. }) => {
  42. if (confirm) that.triggerEvent("deleteItem", item)
  43. }
  44. })
  45. }
  46. }
  47. }
  48. })