帮你贷的小程序

getIt.js 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. const app = getApp();
  2. Page({
  3. data: {
  4. phone_number:'18888888888',
  5. from: '',
  6. preid: '',
  7. hiddenThis: true,
  8. appid: 0
  9. },
  10. onLoad: function (options) {
  11. var that = this, tel = options.tel, preid = options.preid || 0, from = options.from;
  12. // console.log(tel);
  13. that.setData({phone_number: tel, preid: preid, from: from})
  14. },
  15. //FormId
  16. formSubmit (e) {
  17. var formId = e.detail.formId;
  18. this.getFromid(formId);
  19. },
  20. getFromid (formId) {
  21. wx.request({
  22. url: app.globalData.HOST + '/user/wx/getFromid',
  23. method: "POST",
  24. data: Object.assign({}, app.globalData.common, { from_id: formId }),
  25. success: function (res) {
  26. },
  27. complete: function () {
  28. }
  29. });
  30. },
  31. goApply () {
  32. var id = this.data.preid, from = this.data.from, appid = '';
  33. if (from == 'card') {
  34. appid = 'X_' + id
  35. }else{
  36. console.log(from);
  37. appid = 'Y_' + id;
  38. wx.request({
  39. url: app.globalData.HOST + '/user/wx/known',
  40. method: "POST",
  41. data: Object.assign({}, app.globalData.common, {id: id}),
  42. success: function (res) {
  43. },
  44. complete: function () {
  45. }
  46. });
  47. }
  48. this.setData({hiddenThis: false, appid: appid})
  49. },
  50. onReady: function () {
  51. },
  52. onShow: function () {
  53. },
  54. onHide: function () {
  55. this.setData({hiddenThis: true})
  56. },
  57. onUnload: function () {
  58. }
  59. })