qiyemore.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. // pages/qiyemore/qiyemore.js
  2. import http from '../../base/httputil'
  3. const app = getApp()
  4. Page({
  5. onLoad() {
  6. this.getLocation()
  7. },
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. host: app.globalData.host,
  13. longitude: Number,
  14. form: {
  15. longitude: Number,
  16. latitude: Number,
  17. businessName: null,
  18. orgCode: null,
  19. qrCode:null,
  20. officeAddress: null,
  21. businessAddress: null,
  22. supervisor: null,
  23. tradeDept: null,
  24. deptId: null,
  25. mainPerson: null,
  26. mainPersonPhone: null,
  27. headSecurity: null,
  28. headSecurityPhone: null
  29. }
  30. },
  31. //-------------------------------表单数据绑定方法---------------------------------------
  32. get_businessName(e) {
  33. this.data.form.businessName = e.detail.value
  34. },
  35. get_orgCode(e) {
  36. this.data.form.orgCode = e.detail.value
  37. },
  38. get_qrCode(e) {
  39. this.data.form.qrCode = e.detail.value
  40. },
  41. get_officeAddress(e) {
  42. this.data.form.officeAddress = e.detail.value
  43. },
  44. get_businessAddress(e) {
  45. this.data.form.businessAddress = e.detail.value
  46. },
  47. get_supervisor(e) {
  48. this.data.form.supervisor = e.detail.value
  49. },
  50. get_tradeDept(e) {
  51. this.data.form.tradeDept = e.detail.value
  52. },
  53. get_mainPerson(e) {
  54. this.data.form.mainPerson = e.detail.value
  55. },
  56. get_mainPersonPhone(e) {
  57. this.data.form.mainPersonPhone = e.detail.value
  58. },
  59. get_headSecurity(e) {
  60. this.data.form.headSecurity = e.detail.value
  61. },
  62. headSecurityPhone(e) {
  63. this.data.form.headSecurityPhone = e.detail.value
  64. },
  65. //----------------------------------------------------------------------------
  66. addEnterprise(e) {
  67. let obj = new Object()
  68. obj.latitude = this.data.form.latitude
  69. obj.longitude = this.data.form.longitude
  70. obj.businessName = this.data.form.businessName
  71. obj.orgCode = this.data.form.orgCode
  72. obj.officeAddress = this.data.form.officeAddress
  73. obj.businessAddress = this.data.form.businessAddress
  74. obj.supervisor = this.data.form.supervisor
  75. obj.tradeDept = this.data.form.tradeDept
  76. obj.mainPerson = this.data.form.mainPerson
  77. obj.mainPersonPhone = this.data.form.mainPersonPhone
  78. obj.headSecurity = this.data.form.headSecurity
  79. obj.headSecurityPhone = this.data.form.headSecurityPhone
  80. http.post("/system/AppEnterpriseController/addEnterprise", obj, this.addEnterpriseSuccess)
  81. },
  82. addEnterpriseSuccess(e) {
  83. wx.showToast({
  84. title: e.msg,
  85. icon: "none"
  86. })
  87. if(e.code == 200){
  88. // wx.navigateTo({
  89. // url: '../qiye/qiye',
  90. // })
  91. wx.navigateBack()
  92. }
  93. },
  94. getLocation() {
  95. let that = this
  96. wx.getLocation({
  97. type: 'wgs84', //返回可以用于wx.openLocation的经纬度
  98. success: function (res) {
  99. that.setData({
  100. form: {
  101. longitude: res.longitude,
  102. latitude: res.latitude
  103. }
  104. })
  105. },
  106. })
  107. },
  108. /**
  109. * 生命周期函数--监听页面加载
  110. */
  111. onLoad(options) {
  112. },
  113. /**
  114. * 生命周期函数--监听页面初次渲染完成
  115. */
  116. onReady() {
  117. },
  118. /**
  119. * 生命周期函数--监听页面显示
  120. */
  121. onShow() {
  122. },
  123. /**
  124. * 生命周期函数--监听页面隐藏
  125. */
  126. onHide() {
  127. },
  128. /**
  129. * 生命周期函数--监听页面卸载
  130. */
  131. onUnload() {
  132. },
  133. /**
  134. * 页面相关事件处理函数--监听用户下拉动作
  135. */
  136. onPullDownRefresh() {
  137. },
  138. /**
  139. * 页面上拉触底事件的处理函数
  140. */
  141. onReachBottom() {
  142. },
  143. /**
  144. * 用户点击右上角分享
  145. */
  146. onShareAppMessage() {
  147. }
  148. })