小程序模板网

微信小程序实用组件:城市切换



js:
 

					
  1. var city = require('../../utils/city.js');
  2.  
  3.  
  4. Page({
  5. data: {
  6. searchLetter: [],
  7. showLetter: "",
  8. winHeight: 0,
  9. tHeight:0,
  10. bHeight:0,
  11. startPageY:0,
  12. cityList:[],
  13. isShowLetter:false,
  14. scrollTop:0,
  15. city:""
  16. },
  17. onLoad: function (options) {
  18. // 生命周期函数--监听页面加载
  19. var searchLetter = city.searchLetter;
  20. var cityList=city.cityList();
  21. // console.log(cityInfo);
  22.  
  23. var sysInfo = wx.getSystemInfoSync();
  24. console.log(sysInfo);
  25. var winHeight = sysInfo.windowHeight;
  26.  
  27. //添加要匹配的字母范围值
  28. //1、更加屏幕高度设置子元素的高度
  29. var itemH = winHeight / searchLetter.length;
  30. var tempObj = [];
  31. for (var i = 0; i < searchLetter.length; i++) {
  32. var temp = {};
  33. temp.name = searchLetter[i];


易优小程序(企业版)+灵活api+前后代码开源 码云仓库:starfork
本文地址:https://www.eyoucms.com/wxmini/doc/course/23145.html 复制链接 如需定制请联系易优客服咨询:800182392 点击咨询
QQ在线咨询