index.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. // pages/myloanprojuctDetail/index.js
  2. const app = getApp()
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. nvabarData: {
  9. showCapsule: 0, //是否显示左上角图标,消息中心 1表示显示 0表示不显示
  10. showBack: 1, //返回
  11. title: '我的申请', //导航栏 中间的标题
  12. // 此页面 页面内容距最顶部的距离
  13. height: app.globalData.height * 2 + 20,
  14. },
  15. jgproid:'',//产品ID
  16. //jgproidname:'',
  17. jgproidAll:{},
  18. ecode:'',
  19. ecodename:'',
  20. cneedidcneedid:'',
  21. clamneedDetail: {},
  22. compname: '',
  23. compcode: '',
  24. cpjlname:'',
  25. cpjlpho:'',
  26. sxhowlong:'',
  27. sxcpname:'',
  28. sxcplilue:'',
  29. credit_money:'',
  30. remarks:'',
  31. },
  32. call(e) {
  33. console.log(e.currentTarget.dataset.phone, "dayin")
  34. wx.makePhoneCall({
  35. phoneNumber: e.currentTarget.dataset.phone,
  36. })
  37. },
  38. /**
  39. * 生命周期函数--监听页面加载
  40. */
  41. onLoad: function (options) {
  42. this.setData({ // 设置页面列表的内容
  43. cneedid: options.cneedid,
  44. cpjlname: options.cpjlname,
  45. cpjlpho: options.cpjlpho
  46. })
  47. },
  48. /**
  49. * 生命周期函数--监听页面显示
  50. */
  51. onShow: function () {
  52. this.getclamneed(),
  53. this.getcompnews(),
  54. this.shouxindata()
  55. },
  56. getclamneed() {//需求信息
  57. wx.request({
  58. method: "GET",
  59. url: app.globalData.publicUrl + 'api/financial/claimneed/' + this.data.cneedid,
  60. success: (res) => {
  61. //console.log("需求信息+=============================="+JSON.stringify(res))
  62. console.log(res.data.data,"sssssss");
  63. if (res.data.errcode == 0) {
  64. this.setData({
  65. clamneedDetail: res.data.data,
  66. ecode:res.data.data.ensure_id,
  67. jgproid: res.data.data.jg_pro_id
  68. })
  69. wx.request({
  70. method: "get",
  71. url: app.globalData.publicUrl + 'api/financial/dictionary',
  72. data: {
  73. "code": this.data.ecode
  74. },
  75. success: (res) => {
  76. if (res.data.errcode == 0) {
  77. this.setData({
  78. ecodename: res.data.data[0].name
  79. })
  80. }
  81. wx.request({
  82. method: "get",
  83. url: app.globalData.publicUrl + 'api/financial/financeclaims/' + this.data.jgproid,
  84. success: (res) => {
  85. console.log(res.data.data,"99999999999999999");
  86. if (res.data.errcode == 0) {
  87. this.setData({
  88. //jgproidname: res.data.data.name,
  89. jgproidAll : res.data.data
  90. })
  91. }
  92. }
  93. })
  94. }
  95. })
  96. }
  97. }
  98. })
  99. },
  100. getcompnews() {//企业信息
  101. let fiduid = wx.getStorageSync('user')._id;
  102. wx.request({
  103. method: "get",
  104. url: app.globalData.publicUrl + 'api/financial/companyidentify',
  105. data: {
  106. uid: fiduid
  107. },
  108. success: (res) => {
  109. //console.log("企业信息================================================"+JSON.stringify(res))
  110. if (res.data.errcode == 0) {
  111. this.setData({
  112. compname: res.data.data[0].company_name,
  113. compcode: res.data.data[0].reg_num
  114. })
  115. }
  116. }
  117. })
  118. },
  119. shouxindata: function () {
  120. wx.request({
  121. method: "post",
  122. url: app.globalData.publicUrl + 'api/financial/claimneed/one',
  123. data: { id: this.data.cneedid},
  124. success: (e) => {
  125. console.log(JSON.stringify(e)+"888888888888888")
  126. if (e.data.errcode == 0) {
  127. if (e.data.data[0].sxcplilue){
  128. this.setData({
  129. sxcplilue: e.data.data[0].sxcplilue,
  130. })
  131. }
  132. if (e.data.data[0].sxcpname) {
  133. this.setData({
  134. sxcpname: e.data.data[0].sxcpname,
  135. })
  136. }
  137. if (e.data.data[0].sxhowlong) {
  138. this.setData({
  139. sxhowlong: e.data.data[0].sxhowlong,
  140. })
  141. }
  142. if (e.data.data[0].credit_money) {
  143. this.setData({
  144. credit_money: e.data.data[0].credit_money,
  145. })
  146. }
  147. }
  148. }
  149. })
  150. },
  151. })