qiyemore.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. saoyisao(){
  67. wx.scanCode({
  68. onlyFromCamera: true,
  69. success: (res) => {
  70. console.log("$$$",res);
  71. //this.data.form.qrCode=res.result
  72. this.setData({
  73. form: {
  74. qrCode: res.result
  75. }
  76. })
  77. },
  78. fail: (res) => {
  79. wx.showToast({
  80. title: '扫描失败请手动输入',
  81. icon:'none'
  82. })
  83. }
  84. })
  85. },
  86. addEnterprise(e) {
  87. console.log("###1",this.data.form.qrCode)
  88. let obj = new Object()
  89. obj.latitude = this.data.form.latitude
  90. obj.longitude = this.data.form.longitude
  91. obj.businessName = this.data.form.businessName
  92. obj.orgCode = this.data.form.orgCode
  93. obj.officeAddress = this.data.form.officeAddress
  94. obj.businessAddress = this.data.form.businessAddress
  95. obj.supervisor = this.data.form.supervisor
  96. obj.tradeDept = this.data.form.tradeDept
  97. obj.mainPerson = this.data.form.mainPerson
  98. obj.mainPersonPhone = this.data.form.mainPersonPhone
  99. obj.headSecurity = this.data.form.headSecurity
  100. obj.headSecurityPhone = this.data.form.headSecurityPhone
  101. http.post("/system/AppEnterpriseController/addEnterprise", obj, this.addEnterpriseSuccess)
  102. },
  103. addEnterpriseSuccess(e) {
  104. wx.showToast({
  105. title: e.msg,
  106. icon: "none"
  107. })
  108. if(e.code == 200){
  109. // wx.navigateTo({
  110. // url: '../qiye/qiye',
  111. // })
  112. wx.navigateBack()
  113. }
  114. },
  115. getLocation() {
  116. let that = this
  117. wx.getLocation({
  118. type: 'wgs84', //返回可以用于wx.openLocation的经纬度
  119. success: function (res) {
  120. that.setData({
  121. form: {
  122. longitude: res.longitude,
  123. latitude: res.latitude
  124. }
  125. })
  126. },
  127. })
  128. },
  129. /**
  130. * 生命周期函数--监听页面加载
  131. */
  132. onLoad(options) {
  133. },
  134. /**
  135. * 生命周期函数--监听页面初次渲染完成
  136. */
  137. onReady() {
  138. },
  139. /**
  140. * 生命周期函数--监听页面显示
  141. */
  142. onShow() {
  143. },
  144. /**
  145. * 生命周期函数--监听页面隐藏
  146. */
  147. onHide() {
  148. },
  149. /**
  150. * 生命周期函数--监听页面卸载
  151. */
  152. onUnload() {
  153. },
  154. /**
  155. * 页面相关事件处理函数--监听用户下拉动作
  156. */
  157. onPullDownRefresh() {
  158. },
  159. /**
  160. * 页面上拉触底事件的处理函数
  161. */
  162. onReachBottom() {
  163. },
  164. /**
  165. * 用户点击右上角分享
  166. */
  167. onShareAppMessage() {
  168. }
  169. })