ソースを参照

首页点击跳转到首页

jmx 8 年 前
コミット
ea4e36dde5
1 ファイル変更31 行追加35 行削除
  1. 31 35
      www/webapp/o2o/js/page/home.js

+ 31 - 35
www/webapp/o2o/js/page/home.js

@@ -87,16 +87,11 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'addr
                 }
             }, $view);
 
-            // 我的预约
+            // 点击……不知如何说明……
             $.newTouch('.btn-action-my-order', function (event) {
                 event.preventDefault();
-                user.checkLogin(function () {
-                    $doc.trigger('spa:navigate', {
-                        hash: 'myOrder/1',
-                        pushData: {
-                            needReload: true
-                        }
-                    });
+                $doc.trigger('spa:navigate', {
+                    hash: ''
                 });
             }, $view);
 
@@ -194,42 +189,43 @@ define(['$', 'template', 'IScroll', 'product', 'user', 'native', 'config', 'addr
             /* 如果需要重新加载,就请求服务列表。 */
             if (!pageData.pushData.dontNeedReload) {
                 $doc.trigger('spa:openloader');
-                product.getListAll(user.id, function (res) {
-                    $doc.trigger('spa:closeloader');
-
-                    /*
-                     * tmodjs:
-                     * 使用模版语法把数据填到html文件,生成一个js文件。
-                     * var tpl = template(html文件路径,数据)
-                     */
-                    var tpl = template('home/index', {
-                        showNavBar: !config.isWX && !config.isChubao,
-                    });
 
-                    /*
-                     * jQuery:
-                     * 提供一个html元素到js变量的映射,和findViewById一个作用。
-                     * $(selector).???(xxx)
-                     * 其中selector是选择器,对应html的元素、类、id等
-                     * ???是jQuery定义的事件
-                     * xxx是参数,具体是什么取决于事件
-                     *
-                     * 这句的意思是,选取class=".spa-page-body"的元素,把tpl插入其中
-                     */
-                    $('.spa-page-body', $view).html(tpl);
-                    
-                    /* 建立IScroll */
-                    setTimeout(function () {
-                        pageData.scroll = new IScroll('#homeScroll');
-                    }, 500);
+                /*
+                 * tmodjs:
+                 * 使用模版语法把数据填到html文件,生成一个js文件。
+                 * var tpl = template(html文件路径,数据)
+                 */
+                var tpl = template('home/index', {
+                    showNavBar: !config.isWX && !config.isChubao,
                 });
 
+                /*
+                 * jQuery:
+                 * 提供一个html元素到js变量的映射,和findViewById一个作用。
+                 * $(selector).???(xxx)
+                 * 其中selector是选择器,对应html的元素、类、id等
+                 * ???是jQuery定义的事件
+                 * xxx是参数,具体是什么取决于事件
+                 *
+                 * 这句的意思是,选取class=".spa-page-body"的元素,把tpl插入其中
+                 */
+                $('.spa-page-body', $view).html(tpl);
+
+                /* 建立IScroll */
+                setTimeout(function () {
+                    pageData.scroll = new IScroll('#homeScroll');
+                }, 500);
+                // product.getListAll(user.id, function (res) {
+                // });
+
                 address.getList({
                     request_from: 'weixin',
                     user_id: user.id
                 });
 
                 user.getCouponList(user.id);
+
+                $doc.trigger('spa:closeloader');
             }
 
             /* 又是这个。不知道什么玩意…… */