Ignore:
Timestamp:
2011/07/27 13:49:38 (13 years ago)
Author:
468
Message:

#1413 スマートフォン版テンプレートファイル変更(HTML5対応)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/Smarty/templates/sphone/mypage/favorite.tpl

    r20764 r21050  
    2222 */ 
    2323*}--> 
    24 <div id="mypagecolumn"> 
    25   <h2 class="title"><!--{$tpl_title|h}--></h2> 
    26   <!--{if $tpl_navi != ""}--> 
    27     <!--{include file=$tpl_navi}--> 
    28   <!--{else}--> 
    29     <!--{include file=`$smarty.const.TEMPLATE_REALDIR`mypage/navi.tpl}--> 
    30   <!--{/if}--> 
     24<!--▼CONTENTS--> 
     25<section id="mypagecolumn"> 
     26      <h2 class="title"><!--{$tpl_title|h}--></h2> 
     27      <!--{if $tpl_navi != ""}--> 
     28        <!--{include file=$tpl_navi}--> 
     29      <!--{else}--> 
     30        <!--{include file=`$smarty.const.TEMPLATE_REALDIR`mypage/navi.tpl}--> 
     31      <!--{/if}--> 
    3132 
    32   <div id="mycontentsarea"> 
    33     <form name="form1" method="post" action="?"> 
    34     <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 
    35     <input type="hidden" name="order_id" value="" /> 
    36     <input type="hidden" name="pageno" value="<!--{$tpl_pageno}-->" /> 
    37     <h2><!--{$tpl_subtitle|h}--></h2> 
     33      <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3> 
     34      <!--{if $tpl_linemax > 0}--> 
    3835 
    39 <!--{if $tpl_linemax > 0}--> 
     36      <!--★インフォメーション★--> 
     37      <div class="information"> 
     38           <p><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>のお気に入りがあります。</p> 
     39           <p>最大20件まで登録できます。</p>   
     40      </div> 
    4041 
    41     <p><!--{$tpl_linemax}-->件のお気に入りがあります。</p> 
    42     <div class="paging"> 
    43       <!--▼ページナビ--> 
    44       <!--{$tpl_strnavi}--> 
    45       <!--▲ページナビ--> 
    46     </div> 
     42      <!--▼フォームここから --> 
     43      <div class="form_area"> 
    4744 
    48     <form name="form1" id="form1" method="post" action="?"> 
    49     <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 
    50     <input type="hidden" name="mode" value="cart" /> 
    51     <input type="hidden" name="product_id" value="" /> 
    52     <table summary="お気に入り" id="mypage-history-list" class="entryform"> 
    53       <tr> 
    54         <th width="40" class="alignC valignM">削除</th> 
    55         <th width="60" class="alignC valignM">商品画像</th> 
    56         <th width="200" class="alignC valignM">商品名</th> 
    57         <th width="200" class="sale_price alignC valignM"><!--{$smarty.const.SALE_PRICE_TITLE}--><span class="mini">(税込)</span></th> 
    58       </tr> 
    59       <!--{section name=cnt loop=$arrFavorite}--> 
    60       <!--{assign var=product_id value="`$arrFavorite[cnt].product_id`"}--> 
    61       <tr> 
    62        <td class="multi_send"><a href="javascript:fnModeSubmit('delete_favorite','product_id','<!--{$product_id|h}-->');">削除</a></td> 
    63        <td><a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->"><img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrFavorite[cnt].main_list_image|sfNoImageMainList|h}-->&amp;width=65&amp;height=65"></a></td> 
    64        <td><a href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->"><!--{$arrFavorite[cnt].name}--></a></td> 
    65        <td class="right sale_price alignR"> 
    66         <span class="price"> 
    67           <!--{if $arrFavorite[cnt].price02_min == $arrFavorite[cnt].price02_max}--> 
    68             <!--{$arrFavorite[cnt].price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 
    69           <!--{else}--> 
    70             <!--{$arrFavorite[cnt].price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrFavorite[cnt].price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 
    71           <!--{/if}-->円</span> 
    72        </td> 
    73      </tr> 
    74      <!--{/section}--> 
    75     </table> 
    76     <br /> 
    77     <!--{if $stock_find_count > 0 && $customer_rank < 51}--> 
    78     <div class="product-btn"> 
    79       <a href="javascript:void(document.form1.submit())" class="btn-cart">カートに入れる</a> 
    80     </div> 
    81     <!--{/if}--> 
    82     </form> 
     45        <form name="form1" id="form1" method="post" action="<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php"> 
     46            <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> 
     47            <input type="hidden" name="mode" value="cart" /> 
     48            <input type="hidden" name="product_id" value="" /> 
    8349 
    84     <!--{else}--> 
    85     <p>お気に入りが登録されておりません。</p> 
    86     <!--{/if}--> 
    87     </form> 
    88   </div> 
    89 </div> 
     50 
     51      <!--▼フォームボックスここから --> 
     52      <div class="formBox"> 
     53        <!--{section name=cnt loop=$arrFavorite max=$dispNumber}--> 
     54        <!--{assign var=product_id value="`$arrFavorite[cnt].product_id`"}--> 
     55 
     56      <!--▼商品 --> 
     57      <div class="favoriteBox"> 
     58          <a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->"><img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrFavorite[cnt].main_list_image|sfNoImageMainList|h}-->&amp;width=80&amp;height=80" alt="" width="80" height="80" class="photoL productImg" /></a> 
     59        <div class="favoriteContents clearfix"> 
     60           <h4><a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->" class="productName"><!--{$arrFavorite[cnt].name}--></a></h4> 
     61               <p><span class="mini productPrice"><!--{$smarty.const.SALE_PRICE_TITLE}-->:<!--{if $arrFavorite[cnt].price02_min == $arrFavorite[cnt].price02_max}--> 
     62                  <!--{$arrFavorite[cnt].price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 
     63                  <!--{else}--> 
     64                  <!--{$arrFavorite[cnt].price02_min|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}-->~<!--{$arrFavorite[cnt].price02_max|sfCalcIncTax:$arrSiteInfo.tax:$arrSiteInfo.tax_rule|number_format}--> 
     65                  <!--{/if}-->円</span></p> 
     66               <p class="btn_delete"><img src="<!--{$TPL_URLPATH}-->img/button/btn_delete.png" width="21" height="20" alt="削除" onClick="javascript:fnModeSubmit('delete_favorite','product_id','<!--{$product_id|h}-->');" class="pointer" /></p> 
     67        </div> 
     68      </div><!--▲商品 --> 
     69         
     70      <!--{/section}--> 
     71 
     72      </div><!--▲formBox --> 
     73            <!--{if $stock_find_count > 0 && $customer_rank < 51}--> 
     74            <div class="product-btn"> 
     75               <a rel="external" href="javascript:void(document.form1.submit())" class="btn-cart">カートに入れる</a> 
     76            </div> 
     77            <!--{/if}--> 
     78         </form> 
     79         </div><!--▲form_area --> 
     80          
     81         <div class="btn_area"> 
     82         <!--{if $tpl_linemax > $dispNumber}--> 
     83           <p><a rel="external" href="javascript: void(0);" class="btn_more" id="btn_more_product" onClick="getProducts(5); return false;">もっとみる(+<!--{$dispNumber}-->件)</a></p> 
     84         <!--{/if}--> 
     85         </div> 
     86          
     87         <!--{else}--> 
     88              <div class="form_area"> 
     89               <div class="information"> 
     90                <p>お気に入りが登録されておりません。</p> 
     91               </div>         
     92              </div><!--▲form_area --> 
     93         <!--{/if}--> 
     94 
     95</section> 
     96<!--▲CONTENTS --> 
     97 
     98<script> 
     99var pageNo = 2; 
     100var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->"; 
     101var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH|sfTrimURL}-->/"; 
     102var statusImagePath = "<!--{$TPL_URLPATH}-->"; 
     103 
     104function getProducts(limit) { 
     105    $.mobile.pageLoading(); 
     106    var i = limit; 
     107    //送信データを準備 
     108    var postData = {}; 
     109    $('#form1').find(':input').each(function(){   
     110        postData[$(this).attr('name')] = $(this).val();   
     111    }); 
     112    postData["mode"] = "getList"; 
     113    postData["pageno"] = pageNo; 
     114    postData["disp_number"] = i; 
     115 
     116    $.ajax({ 
     117           type: "POST", 
     118           url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php", 
     119           data: postData, 
     120           cache: false, 
     121           dataType: "json", 
     122           error: function(XMLHttpRequest, textStatus, errorThrown){ 
     123            alert(textStatus); 
     124            $.mobile.pageLoading(true); 
     125           }, 
     126           success: function(result){ 
     127            
     128            var productStatus = result.productStatus; 
     129             for (var j = 0; j < i; j++) { 
     130                 if (result[j] != null) { 
     131                     var product = result[j]; 
     132                     var productHtml = ""; 
     133                    var maxCnt = $(".favoriteBox").length - 1; 
     134                    var productEl = $(".favoriteBox").get(maxCnt); 
     135                    productEl = $(productEl).clone(true).insertAfter(productEl); 
     136                    maxCnt++; 
     137                     
     138                     //商品写真をセット 
     139                     $($(".favoriteBox img.productImg").get(maxCnt)).attr({ 
     140                                                                 src: imagePath + product.main_list_image,  
     141                                                                 alt: product.name 
     142                                                             }); 
     143                      
     144                     //商品名をセット 
     145                     $($(".favoriteBox a.productName").get(maxCnt)).text(product.name); 
     146                     $($(".favoriteBox a.productName").get(maxCnt)).attr("href", url + product.product_id); 
     147                      
     148                     //販売価格をセット 
     149                     var price = $($(".favoriteBox span.productPrice").get(maxCnt)); 
     150                    //販売価格をクリア 
     151                     price.empty(); 
     152                     var priceVale = ""; 
     153                    //販売価格が範囲か判定 
     154                     if (product.price02_min == product.price02_max) { 
     155                         priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_tax_format + '円'; 
     156                     } else { 
     157                         priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_tax_format + '~' + product.price02_max_tax_format + '円'; 
     158                     } 
     159                     price.append(priceVale); 
     160                      
     161                     //削除ボタンをセット 
     162                     $($(".favoriteBox p.btn_delete a").get(maxCnt)).attr("href", "javascript:fnModeSubmit('delete_favorite','product_id','" + product.product_id + "');"); 
     163 
     164                 } 
     165             } 
     166             pageNo++; 
     167 
     168             //すべての商品を表示したか判定 
     169             if (parseInt($("#productscount").text()) <= $(".favoriteBox").length) { 
     170                 $("#btn_more_product").hide(); 
     171             } 
     172             $.mobile.pageLoading(true); 
     173           } 
     174}); 
     175} 
     176</script> 
Note: See TracChangeset for help on using the changeset viewer.