微信小程序
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

112 linhas
2.0 KiB

  1. // pages/user/region/region.js
  2. import * as UTIL from '../../../utils/util.js';
  3. import * as EVN_CONFIG from '../../../env/env.js';
  4. const app = getApp();
  5. Page({
  6. /**
  7. * 页面的初始数据
  8. */
  9. data: {
  10. isIPX: app.globalData.isIPX,
  11. activeNames: ['1'],
  12. nowDress:''
  13. },
  14. /**
  15. * 生命周期函数--监听页面加载
  16. */
  17. onLoad(options) {
  18. },
  19. onChange(event) {
  20. this.setData({
  21. activeNames: event.detail,
  22. });
  23. },
  24. back:function(){
  25. wx.navigateBack({
  26. delta: 1
  27. })
  28. },
  29. getLocation(){
  30. // var location = UTIL.getLocationFromWX();
  31. console.log(app.globalData.setInfo.latitude);
  32. },
  33. goChangeUrl(e){
  34. const url = e.currentTarget.dataset.url;
  35. const name = e.currentTarget.dataset.name;
  36. const parentname = e.currentTarget.dataset.parentname;
  37. wx.setStorageSync('dressCode', url);
  38. wx.setStorageSync('dressName', parentname+'-'+name);
  39. getApp().globalData.APIURL = url
  40. wx.reLaunch({
  41. url: '../login/login',
  42. })
  43. },
  44. /**
  45. * 生命周期函数--监听页面初次渲染完成
  46. */
  47. onReady() {
  48. },
  49. /**
  50. * 生命周期函数--监听页面显示
  51. */
  52. onShow() {
  53. var that = this ;
  54. let url = 'https://www.nongshen.net/static/wechat/area.json';
  55. wx.request({
  56. url: url, //接口地址
  57. data:{
  58. date:new Date().getTime()
  59. },
  60. header: {
  61. 'content-type': 'application/json' // 默认值
  62. },
  63. success (res) {
  64. console.log(res);
  65. that.setData({
  66. list : res.data,
  67. nowDress: wx.getStorageSync('dressName')
  68. })
  69. }
  70. })
  71. },
  72. /**
  73. * 生命周期函数--监听页面隐藏
  74. */
  75. onHide() {
  76. },
  77. /**
  78. * 生命周期函数--监听页面卸载
  79. */
  80. onUnload() {
  81. },
  82. /**
  83. * 页面相关事件处理函数--监听用户下拉动作
  84. */
  85. onPullDownRefresh() {
  86. },
  87. /**
  88. * 页面上拉触底事件的处理函数
  89. */
  90. onReachBottom() {
  91. },
  92. /**
  93. * 用户点击右上角分享
  94. */
  95. onShareAppMessage() {
  96. }
  97. })