index.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. const _Http = getApp().globalData.http;
  2. Component({
  3. properties: {
  4. list: Array
  5. },
  6. methods: {
  7. toDetail(e) {
  8. const {
  9. id
  10. } = e.currentTarget.dataset;
  11. wx.redirectTo({
  12. url: `/packageA/offers/detail?sa_quotedpriceid=${id}`,
  13. })
  14. },
  15. copyItem(e) {
  16. const {
  17. billno,
  18. sa_quotedpriceid
  19. } = e.currentTarget.dataset.item;
  20. wx.showModal({
  21. title: '提示',
  22. content: `是否确认复制“${billno}”`,
  23. complete: ({
  24. confirm
  25. }) => {
  26. if (confirm) _Http.basic({
  27. "id": 20221209094103,
  28. "content": {
  29. sa_quotedpriceid
  30. },
  31. }).then(res => {
  32. wx.showToast({
  33. title: res.msg == '成功' ? '复制成功' : res.msg,
  34. icon: "none"
  35. });
  36. setTimeout(() => {
  37. wx.redirectTo({
  38. url: `/packageA/offers/detail?sa_quotedpriceid=${res.data.sa_quotedpriceid}`,
  39. })
  40. let page = getCurrentPages().find(v => v.__route__ == 'packageA/offers/index');
  41. if (page) page.getList(true);
  42. }, 300)
  43. })
  44. }
  45. })
  46. },
  47. }
  48. })