address.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // customized/pages/address/address.js
  2. let app = getApp();
  3. let host = app.globalData.servsers; // 请求的url
  4. Page({
  5. /**
  6. * 页面的初始数据
  7. */
  8. data: {
  9. },
  10. /**
  11. * 生命周期函数--监听页面加载
  12. */
  13. onLoad: function (options) {
  14. },
  15. /**
  16. * 生命周期函数--监听页面初次渲染完成
  17. */
  18. onReady: function () {
  19. },
  20. /**
  21. * 生命周期函数--监听页面显示
  22. */
  23. onShow: function () {
  24. this.getaddress()
  25. },
  26. /**
  27. * 生命周期函数--监听页面隐藏
  28. */
  29. onHide: function () {
  30. },
  31. /**
  32. * 生命周期函数--监听页面卸载
  33. */
  34. onUnload: function () {
  35. },
  36. /**
  37. * 页面相关事件处理函数--监听用户下拉动作
  38. */
  39. onPullDownRefresh: function () {
  40. },
  41. /**
  42. * 页面上拉触底事件的处理函数
  43. */
  44. getaddress(){
  45. wx.request({
  46. url: host + '/adressview',
  47. header: {
  48. 'content-type': 'application/x-www-form-urlencoded'
  49. },
  50. data: {
  51. userId: 'oovpNwjlsY6xx8ceCebFa1dOLd9E' //app.globalData.user_id,
  52. },
  53. success(res){
  54. console.log(res,"address")
  55. }
  56. })
  57. }
  58. })