zoukankan      html  css  js  c++  java
  • (十五)微信小程序:优化电影页面

    优化电影页面

      1.显示:正在加载 的提示

          首先查看API

          

           

     1   onLoad: function (options) {
     2       console.log(options.category);
     3       var publicURL = "";
     4       switch(options.category){
     5         case "正在热映":
     6           publicURL = "http://localhost:8888/v2/movie/in_theaters";
     7           break;
     8         case "即将上映":
     9           publicURL = "http://localhost:8888/v2/movie/coming_soon";
    10           break;  
    11         case "排行榜":
    12           publicURL = "http://localhost:8888/v2/movie/top250";
    13           break;  
    14       }
    15       utils.http(publicURL,this.getMovieInfo,null,null);
    16       this.setData({
    17         publicURL:publicURL
    18       });
    19       wx.showLoading({
    20         title: '加载中',
    21       })
    22   },
    23   getMovieInfo:function(data){
    24     //停止下拉刷新
    25     wx.stopPullDownRefresh();
    26     //隐藏加载等待框
    27     wx.hideLoading();
    28 }
    movie-more.js

            代码解析:1.使用到了停止下拉刷新的stopPullDownRefresh()函数

                 2.调取了加载页面:wx.showLoading,并在获取到数据后隐藏加载框:wx.hideLoading()

      2.将点击更多后的制定导航信息放置导航栏    

    wx.setNavigationBarTitle({
            title: options.category,
          });
    View Code

      3.实现的效果:

            

     本节完成了对于电影页面的人性化优化,下节制作电影详情页面~

  • 相关阅读:
    button theme
    Container详解
    flutter控件之ExpansionPanelList
    flutter屏幕适配
    Flutter 获取控件尺寸和位置
    Dart
    异步async、await和Future的使用技巧
    flutter key
    Flutter 控件之 Routes 和 Navigator. [PopupRoute]
    flutter
  • 原文地址:https://www.cnblogs.com/happy-prince/p/12785028.html
Copyright © 2011-2022 走看看