微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
2.7 KiB

  1. // pages/project/project.js
  2. import * as UTIL from '../../utils/util.js';
  3. import * as API from '../../utils/API.js';
  4. let EVN_CONFIG = require('../../env/env');
  5. const app = getApp();
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. isIPX: app.globalData.isIPX,
  12. name:"",
  13. value:'',
  14. pageNums:1,
  15. showUpload:false,
  16. uploadOptions:[],
  17. voteTypeOptions:[],
  18. fileList:[],
  19. itemId:"",
  20. itemIndex:"",
  21. list:[],
  22. fileEvent:{},
  23. projectList:[]
  24. },
  25. /**
  26. * 生命周期函数--监听页面加载
  27. */
  28. onLoad(options) {
  29. var _this = this;
  30. let qu = wx.createSelectorQuery()
  31. qu.select("#top_view").boundingClientRect()
  32. qu.exec(res => {
  33. _this.setData({
  34. scrollHeight:wx.getSystemInfoSync().windowHeight-res[0].height-res[0].top
  35. })
  36. })
  37. },
  38. goDetail(e){
  39. console.log('aaaaaaaaa');
  40. wx.navigateTo({
  41. url: 'detail/detail?id='+e.currentTarget.dataset.id,
  42. })
  43. },
  44. /**
  45. * 生命周期函数--监听页面初次渲染完成
  46. */
  47. onReady() {
  48. this.onShow();
  49. },
  50. goSearch(e){
  51. this.setData({name:e.detail})
  52. this.onShow();
  53. },
  54. back:function(){
  55. wx.navigateBack({
  56. delta: 1
  57. })
  58. },
  59. /**
  60. * 生命周期函数--监听页面显示
  61. */
  62. onShow() {
  63. var that = this;
  64. //获取附件字典
  65. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'vote_status', {method:'GET'}, {
  66. success: (res) => {
  67. this.setData({
  68. voteStatusOptions:res.data,
  69. })
  70. UTIL.httpRequest(API.URL_GET_GETDICTTYPE + 'vote_type', {method:'GET'}, {
  71. success: (res) => {
  72. this.setData({
  73. voteTypeOptions:res.data,
  74. })
  75. let params= {
  76. itemName:this.data.name,
  77. method:'GET'
  78. }
  79. UTIL.httpRequest(API.URL_GET_VOTELIST, params,{
  80. success: (response) => {
  81. if (response.code == API.SUCCESS_CODE) {
  82. response.rows.map(rr=>{
  83. rr.voteStatusText = UTIL.getTransform(rr.voteStatus,that.data.voteStatusOptions);
  84. rr.voteTypeText = UTIL.getTransform(rr.voteType,that.data.voteTypeOptions);
  85. })
  86. that.setData({
  87. projectList:response.rows
  88. })
  89. }
  90. }
  91. })
  92. }
  93. })
  94. }
  95. })
  96. },
  97. /**
  98. * 生命周期函数--监听页面隐藏
  99. */
  100. onHide() {
  101. },
  102. /**
  103. * 生命周期函数--监听页面卸载
  104. */
  105. onUnload() {
  106. },
  107. /**
  108. * 页面相关事件处理函数--监听用户下拉动作
  109. */
  110. onPullDownRefresh() {
  111. },
  112. /**
  113. * 页面上拉触底事件的处理函数
  114. */
  115. onReachBottom() {
  116. },
  117. /**
  118. * 用户点击右上角分享
  119. */
  120. onShareAppMessage() {
  121. }
  122. })