details.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. detailsData: []
  5. },
  6. onLoad(options) {
  7. _Http.basic({
  8. "classname": "system.message.Message",
  9. "method": "readMessage",
  10. "content": {
  11. "messageid": options.id
  12. }
  13. }).then(res => {
  14. if (res.msg != '成功') return wx.showToast({
  15. title: res.msg,
  16. icon: "none"
  17. })
  18. this.setData({
  19. detailsData: res.data
  20. })
  21. })
  22. },
  23. async toDetails() {
  24. const {
  25. objectname,
  26. objectid
  27. } = this.data.detailsData;
  28. /* const res = await _Http.basic({
  29. "classname": "saletool.common.auth",
  30. "method": "isAuth",
  31. "content": {
  32. objectid,
  33. objectname
  34. }
  35. });
  36. if (res.msg != '成功' || res.data[0].isAuth != 1) return wx.showToast({
  37. title: '暂无权限进入应用',
  38. icon: "none"
  39. }); */
  40. switch (objectname) {
  41. case 'sat_courseware':
  42. wx.navigateTo({
  43. url: `/pages/college/index`,
  44. })
  45. break;
  46. case 'sat_sharematerial':
  47. wx.navigateTo({
  48. url: `/pages/promotional/index`,
  49. })
  50. break;
  51. case 'sat_notice':
  52. wx.navigateTo({
  53. url: `/pages/annunciate/index`,
  54. })
  55. break;
  56. case 'sat_submitedit':
  57. wx.navigateTo({
  58. url: `/pages/submission/index`,
  59. })
  60. break;
  61. case 'sat_orderclue':
  62. wx.navigateTo({
  63. url: `/packageA/saleClue/index`,
  64. })
  65. break;
  66. case 'sys_attachment':
  67. let item = {
  68. attachmentid: objectid,
  69. document: '营销物料'
  70. }
  71. wx.navigateTo({
  72. url: '/pages/tabbar/smartStore/folder?item=' + JSON.stringify(item),
  73. })
  74. break;
  75. default:
  76. console.log(objectname)
  77. wx.showToast({
  78. title: '当前应用暂不支持跳转',
  79. icon: "none"
  80. })
  81. break;
  82. }
  83. },
  84. onShareAppMessage(res) { }
  85. })