帮你贷的小程序

getIt.js 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. goApply () {
  16. var id = this.data.preid, from = this.data.from, appid = '';
  17. if (from == 'card') {
  18. appid = 'X_' + id
  19. }else{
  20. console.log(from);
  21. appid = 'Y_' + id;
  22. wx.request({
  23. url: app.globalData.HOST + '/user/wx/known',
  24. method: "POST",
  25. data: Object.assign({}, app.globalData.common, {id: id}),
  26. success: function (res) {
  27. },
  28. complete: function () {
  29. }
  30. });
  31. }
  32. this.setData({hiddenThis: false, appid: appid})
  33. },
  34. onReady: function () {
  35. },
  36. onShow: function () {
  37. },
  38. onHide: function () {
  39. this.setData({hiddenThis: true})
  40. },
  41. onUnload: function () {
  42. }
  43. })