index.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. // pages/interaction/interaction.js
  2. const app = getApp(),
  3. {
  4. globalData: {
  5. util: {
  6. regeneratorRuntime,
  7. api: {
  8. caseDetail
  9. },
  10. request: {
  11. get
  12. }
  13. }
  14. }
  15. } = app;
  16. Page({
  17. /**
  18. * 页面的初始数据
  19. */
  20. data: {
  21. },
  22. assess:function(e){
  23. wx.navigateTo({
  24. url: e.currentTarget.dataset.url,
  25. success: function(res) {},
  26. fail: function(res) {},
  27. complete: function(res) {},
  28. })
  29. },
  30. wuliu: function () {
  31. wx.navigateTo({
  32. url: 'webView/webView?takePostno=' + this.data.detailData.preExpress.takePostno + '&postUnitname=' + this.data.detailData.preExpress.postUnitno,
  33. success: function (res) { },
  34. fail: function (res) { },
  35. complete: function (res) { },
  36. })
  37. },
  38. tousu:function(e){
  39. wx.setStorageSync('unid', this.data.detailData.preService.unid)
  40. wx.setStorageSync('tousu', 'tousu')
  41. wx.switchTab({
  42. url: e.currentTarget.dataset.url,
  43. })
  44. },
  45. /**
  46. * 生命周期函数--监听页面加载
  47. */
  48. async onLoad() {
  49. let that = this;
  50. let options = this.options.projid;
  51. let detailData = await get(caseDetail, {
  52. projId: options
  53. });
  54. that.data.detailData=detailData
  55. let fileArr = detailData.preApasinfo.preAttrList, imgArr = [], imgs = [];
  56. fileArr.forEach(function (item, index) {
  57. let img = item.fileUrl;
  58. imgs = String(img).split(",");
  59. if (imgs.length > 0 && imgs[0] != 'null') {
  60. imgArr.push({'url':imgs,'ind':index});
  61. detailData.preApasinfo.preAttrList[index].fileUrl = imgArr[index]
  62. }
  63. })
  64. that.setData({
  65. detailData: detailData,
  66. imgArr
  67. })
  68. },
  69. preview:function(e){
  70. wx.previewImage({
  71. current: e.currentTarget.dataset.url[e.currentTarget.dataset.index],
  72. urls: e.currentTarget.dataset.url,
  73. })
  74. },
  75. /**
  76. * 生命周期函数--监听页面初次渲染完成
  77. */
  78. onReady: function () {
  79. },
  80. /**
  81. * 生命周期函数--监听页面显示
  82. */
  83. async onShow() {
  84. },
  85. /**
  86. * 生命周期函数--监听页面隐藏
  87. */
  88. onHide: function () {
  89. },
  90. /**
  91. * 生命周期函数--监听页面卸载
  92. */
  93. onUnload: function () {
  94. },
  95. /**
  96. * 页面相关事件处理函数--监听用户下拉动作
  97. */
  98. onPullDownRefresh: function () {
  99. },
  100. /**
  101. * 页面上拉触底事件的处理函数
  102. */
  103. onReachBottom: function () {
  104. },
  105. /**
  106. * 用户点击右上角分享
  107. */
  108. onShareAppMessage: function () {
  109. }
  110. })