C端小程序
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

108 righe
2.0 KiB

  1. var app = getApp();
  2. const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px'
  3. const extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}
  4. const Http = require("../../utils/HttpBasics");
  5. const config = require("../../config/config.js");
  6. Page({
  7. /**
  8. * 页面的初始数据
  9. */
  10. data: {
  11. navigationBarHeight,
  12. list:[],
  13. pageNum:1,
  14. },
  15. goAdd(e) {
  16. let url = '/pages/siteAdd/siteAdd'
  17. wx.navigateTo({
  18. url: url,
  19. })
  20. console.log(url)
  21. },
  22. gitLsit(){
  23. Http.get({
  24. url: config.api.siteList,
  25. data:{
  26. pageNum: this.data.pageNum,
  27. pageSize:1000,
  28. }
  29. }).then(res=>{
  30. let tempLsit = res.data.list
  31. tempLsit.map(item=>{
  32. let regionSty = ""
  33. if (JSON.parse(item.region)[0] == JSON.parse(item.region)[1]){
  34. regionSty = JSON.parse(item.region)[1] + JSON.parse(item.region)[2]
  35. }else{
  36. regionSty = JSON.parse(item.region)[0]+JSON.parse(item.region)[1] + JSON.parse(item.region)[2]
  37. }
  38. item.regionSty = regionSty
  39. })
  40. console.log(tempLsit)
  41. this.setData({
  42. list: tempLsit
  43. })
  44. })
  45. },
  46. dutu(e){
  47. wx.navigateTo({
  48. url: `/pages/siteAdd/siteAdd?id=${e.currentTarget.dataset.id}`,
  49. })
  50. },
  51. /**
  52. * 生命周期函数--监听页面加载
  53. */
  54. onLoad: function (options) {
  55. },
  56. /**
  57. * 生命周期函数--监听页面初次渲染完成
  58. */
  59. onReady: function () {
  60. },
  61. /**
  62. * 生命周期函数--监听页面显示
  63. */
  64. onShow: function () {
  65. this.gitLsit()
  66. },
  67. /**
  68. * 生命周期函数--监听页面隐藏
  69. */
  70. onHide: function () {
  71. },
  72. /**
  73. * 生命周期函数--监听页面卸载
  74. */
  75. onUnload: function () {
  76. },
  77. /**
  78. * 页面相关事件处理函数--监听用户下拉动作
  79. */
  80. onPullDownRefresh: function () {
  81. },
  82. /**
  83. * 页面上拉触底事件的处理函数
  84. */
  85. onReachBottom: function () {
  86. },
  87. /**
  88. * 用户点击右上角分享
  89. */
  90. onShareAppMessage: function () {
  91. }
  92. })