home.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. const app = getApp();
  2. Page({
  3. /**
  4. * 页面的初始数据
  5. */
  6. data: {
  7. datum: [], //头部信息
  8. headurl: [], //个人头像
  9. authenticationnum: [], //认证信息
  10. wxauthentication: [], //我的微信
  11. memberstatus:'', //会员状态
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onShow: function (options) {
  17. var that =this;
  18. // getApp().showLoading(); //提示加载中
  19. // 头部信息
  20. let datum_url = 'my/personaldata/datum';
  21. let datum_data = {
  22. };
  23. app.postRequest(datum_url, datum_data, function (res) {
  24. if (res.code == 201) {
  25. // console.log(res.data);
  26. that.setData({
  27. datum: res.data
  28. })
  29. }
  30. })
  31. // 个人头像
  32. let headurl_url = 'my/images/headurl';
  33. let headurl_data = {
  34. };
  35. app.postRequest(headurl_url, headurl_data, function (res) {
  36. if (res.code == 201) {
  37. // console.log(res.data);
  38. that.setData({
  39. headurl: res.data
  40. })
  41. }
  42. })
  43. // 认证信息
  44. let authenticationnum_url = 'my/authentication/authenticationnum';
  45. let authenticationnum_data = {
  46. };
  47. app.postRequest(authenticationnum_url, authenticationnum_data, function (res) {
  48. if (res.code == 201) {
  49. // console.log(res.data);
  50. that.setData({
  51. authenticationnum: res.data
  52. })
  53. }
  54. })
  55. // 我的微信
  56. let wxauthentication_url = 'my/wxqrcode/wxauthentication';
  57. let wxauthentication_data = {
  58. };
  59. app.postRequest(wxauthentication_url, wxauthentication_data, function (res) {
  60. // console.log(res.data);
  61. that.setData({
  62. wxauthentication: res.data
  63. })
  64. })
  65. // 会员状态
  66. let memberstatus_url = 'pay/recharge/memberstatus';
  67. let memberstatus_data = {
  68. };
  69. app.postRequest(memberstatus_url, memberstatus_data, function (res) {
  70. if (res.code == 201) {
  71. // console.log(res.data);
  72. that.setData({
  73. memberstatus: res.data.msg
  74. })
  75. }
  76. })
  77. },
  78. })