eventDetail.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. // pages/actDetail/actDetail.js
  2. const app = getApp()
  3. var host = app.globalData.host;
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. info: {},
  10. uid: '',
  11. zk1: 0,
  12. zk2: 0,
  13. sex_array: ['男', '女'],
  14. sex: -1,
  15. job_array: ['非中科院单位','中科院单位'],
  16. job: 0,
  17. show: 1,
  18. list:[],
  19. index:[0,0,0],
  20. page:0
  21. },
  22. /**
  23. * 生命周期函数--监听页面加载
  24. */
  25. onLoad: function (options) {
  26. options.id=1;
  27. var that = this;
  28. wx.showNavigationBarLoading()
  29. var that = this;
  30. wx.request({
  31. url: host + '/api/detail',
  32. method: 'GET',
  33. data: {
  34. type: 'conference',
  35. id: options.id
  36. },
  37. success: function (res) {
  38. wx.hideNavigationBarLoading();
  39. that.setData({
  40. info: res.data.data
  41. })
  42. },
  43. fail: function () {
  44. wx.hideLoading();
  45. wx.showToast({
  46. title: '服务器开小差啦!',
  47. icon: 'none'
  48. })
  49. }
  50. })
  51. //中科院单位
  52. wx.request({
  53. url: host + '/api/organization/list',
  54. method: 'GET',
  55. success: function (res) {
  56. wx.hideNavigationBarLoading();
  57. var list=[];
  58. list[0] = res.data.data;
  59. list[1] = list[0][0].children;
  60. list[2] = list[1][0].children;
  61. that.setData({
  62. list: list
  63. })
  64. },
  65. })
  66. },
  67. bindMultiPickerColumnChange:function(e){
  68. console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
  69. var list = this.data.list, i = e.detail.value, j = e.detail.column;
  70. var index=this.data.index;
  71. index[j] = i
  72. if (e.detail.column == 0){
  73. list[1] = list[i][0].children;
  74. list[2] = list[1][0].children;
  75. index[1]=0;
  76. index[2]=0;
  77. }
  78. if (e.detail.column == 1) {
  79. list[1] = list[i][0].children;
  80. list[2] = list[1][0].children;
  81. index[2] = 0;
  82. }
  83. this.setData({
  84. list: list,
  85. index: index
  86. })
  87. },
  88. bindPickerChange:function(e){
  89. this.setData({
  90. job: e.detail.value
  91. })
  92. },
  93. close:function(){
  94. this.setData({
  95. show: 0
  96. })
  97. },
  98. open: function () {
  99. this.setData({
  100. show: 1
  101. })
  102. },
  103. submit: function (e) {
  104. console.log(e.detail.value)
  105. var form = e.detail.value;
  106. var list = this.data.list, index=this.data.index;
  107. form.organizer_unit = list[0][index[0]].value+list[1][index[1]].value+list[2][index[2]].value
  108. wx.request({
  109. url: host + '/api/user/signup',
  110. method:'POST',
  111. data: e.detail.value,
  112. success:(res=>{
  113. console.log(res)
  114. if(res.data.code == 0){
  115. wx.showToast({
  116. title: '提交成功',
  117. })
  118. }
  119. })
  120. })
  121. // this.setData({
  122. // show: 0
  123. // })
  124. },
  125. zk1: function () {
  126. this.setData({
  127. zk1: 1
  128. })
  129. },
  130. sq1: function () {
  131. this.setData({
  132. zk1: 0
  133. })
  134. },
  135. zk2: function () {
  136. this.setData({
  137. zk2: 1
  138. })
  139. },
  140. sq2: function () {
  141. this.setData({
  142. zk2: 0
  143. })
  144. },
  145. /**
  146. * 生命周期函数--监听页面初次渲染完成
  147. */
  148. onReady: function () {
  149. },
  150. /**
  151. * 生命周期函数--监听页面显示
  152. */
  153. onShow: function () {
  154. },
  155. /**
  156. * 生命周期函数--监听页面隐藏
  157. */
  158. onHide: function () {
  159. },
  160. /**
  161. * 生命周期函数--监听页面卸载
  162. */
  163. onUnload: function () {
  164. },
  165. /**
  166. * 页面相关事件处理函数--监听用户下拉动作
  167. */
  168. onPullDownRefresh: function () {
  169. },
  170. /**
  171. * 页面上拉触底事件的处理函数
  172. */
  173. onReachBottom: function () {
  174. },
  175. /**
  176. * 用户点击右上角分享
  177. */
  178. onShareAppMessage: function () {
  179. }
  180. })