From 27ac04fa0edb7c92da41e864ba67558330927d1c Mon Sep 17 00:00:00 2001
From: Bi Kai <kai.bi@yoho.cn>
Date: Wed, 16 Dec 2015 15:03:51 +0800
Subject: [PATCH] 增加加价购页面

---
 template/m.yohobuy.com/actions/cart/index/gift-advance.phtml         | 32 ++++++++++++++++----------------
 template/m.yohobuy.com/partials/cart/gift-advance-good.phtml         |  4 ++--
 template/m.yohobuy.com/partials/layout/use.phtml                     |  7 ++++++-
 yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php |  9 ++++-----
 4 files changed, 28 insertions(+), 24 deletions(-)

diff --git a/template/m.yohobuy.com/actions/cart/index/gift-advance.phtml b/template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
index 0e0494b..9352bfc 100644
--- a/template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
+++ b/template/m.yohobuy.com/actions/cart/index/gift-advance.phtml
@@ -1,20 +1,20 @@
 {{> layout/header}}
 <div class="gift-advance-page yoho-page">
-    {{# shoppingCart}}
-        {{#if gift}}
-            {{# gift}}
-                {{> cart/gift-advance-good}}
-            {{/ gift}}
-        {{^}}
-            {{# advance}}
-                <div class="advance-block">
-                    <p class="title">{{title}}</p>
-                    {{# goods}}
-                        {{> cart/gift-advance-good}}
-                    {{/ goods}}
-                </div>
-            {{/ advance}}
-        {{/if}}
-    {{/ shoppingCart}}
+    {{#if advanceBuyPage}}
+        {{# advanceBuy}}
+            <div class="advance-block">
+                <p class="title">{{title}}</p>
+                {{#goods}}
+                    {{> cart/gift-advance-good}}
+                {{/goods}}
+            </div>
+        {{/ advanceBuy}}
+    {{else}}
+        {{# gift}}
+            {{> cart/gift-advance-good}}
+        {{/ gift}}
+    {{/if}}
+
+
 </div>
 {{> layout/footer}}
diff --git a/template/m.yohobuy.com/partials/cart/gift-advance-good.phtml b/template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
index 9ca6c5c..4e63fc5 100644
--- a/template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
+++ b/template/m.yohobuy.com/partials/cart/gift-advance-good.phtml
@@ -23,7 +23,7 @@
                 ¥{{price}}
             </span>
              <span class="price">
-                ¥{{salePrice}}
+                ¥{{marketPrice}}
             </span>
             <span class="count">
                 ×{{count}}
@@ -33,4 +33,4 @@
     </div>
 
 
-</div>
\ No newline at end of file
+</div>
diff --git a/template/m.yohobuy.com/partials/layout/use.phtml b/template/m.yohobuy.com/partials/layout/use.phtml
index 385d213..77729dc 100644
--- a/template/m.yohobuy.com/partials/layout/use.phtml
+++ b/template/m.yohobuy.com/partials/layout/use.phtml
@@ -225,7 +225,12 @@
     seajs.use('js/product/recommend-for-you');
 </script>
 {{/if}}
-{{#if giftAdvancePage}}
+{{#if giftPage}}
+<script>
+    seajs.use('js/shopping-cart/gift-advance');
+</script>
+{{/if}}
+{{#if advanceBuyPage}}
 <script>
     seajs.use('js/shopping-cart/gift-advance');
 </script>
diff --git a/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php b/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
index c0ceb0f..0bf9c27 100644
--- a/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
+++ b/yohobuy/m.yohobuy.com/application/modules/Cart/controllers/Index.php
@@ -143,11 +143,11 @@ class IndexController extends AbstractAction
         $shoppingKey = Helpers::getShoppingKeyByCookie();
         $uid = $this->getUid(true);
         $cartType = $this->get('cartType', 'ordinary');
-        $data = array('shoppingCartPage' => true);
+        $data = array('giftPage' => true);
         $data += CartModel::getCartData($uid, $shoppingKey, $cartType, true);
 
         // 渲染模板
-        $this->_view->display('gift-advance-good', $data);
+        $this->_view->display('gift-advance', $data);
     }
 
     /*
@@ -161,12 +161,11 @@ class IndexController extends AbstractAction
         $shoppingKey = Helpers::getShoppingKeyByCookie();
         $uid = $this->getUid(true);
         $cartType = $this->get('cartType', 'ordinary');
-        $data = array('shoppingCartPage' => true);
+        $data = array('advanceBuyPage' => true);
         $data += CartModel::getCartData($uid, $shoppingKey, $cartType, false, true);
 
         // 渲染模板
-        var_dump($data);
-        $this->_view->display('gift-advance-good', $data);
+        $this->_view->display('gift-advance', $data);
     }
 
     /*
--
libgit2 0.24.0