source: branches/version-2_13-dev/data/Smarty/templates/sphone/mypage/favorite.tpl @ 23122

Revision 23122, 8.1 KB checked in by poego, 11 years ago (diff)

#2283 r23041での間違って消したAタグ Stylesheetのpx指定漏れに対応

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id
  • Property svn:mime-type set to text/x-smarty-template; charset=UTF-8
Line 
1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23*}-->
24
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}-->
32
33    <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3>
34    <!--{if $tpl_linemax > 0}-->
35
36        <!--★インフォメーション★-->
37        <div class="information">
38            <p><span class="attention"><span id="productscount"><!--{$tpl_linemax}--></span>件</span>のお気に入りがあります。</p>
39        </div>
40
41        <!--▼フォームここから -->
42        <div class="form_area">
43
44            <form name="form1" id="form1" method="post" action="<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php">
45                <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
46                <input type="hidden" name="mode" value="cart" />
47                <input type="hidden" name="product_id" value="" />
48
49
50                <!--▼フォームボックスここから -->
51                <div class="formBox">
52                    <!--{section name=cnt loop=$arrFavorite max=$dispNumber}-->
53                        <!--{assign var=product_id value="`$arrFavorite[cnt].product_id`"}-->
54
55                        <!--▼商品 -->
56                        <div class="favoriteBox">
57                            <a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->"><img src="<!--{$smarty.const.IMAGE_SAVE_URLPATH}--><!--{$arrFavorite[cnt].main_list_image|sfNoImageMainList|h}-->" style="max-width: 80px;max-height: 80px;" class="photoL productImg"  /></a>
58                            <div class="favoriteContents clearfix">
59                                <h4><a rel="external" href="<!--{$smarty.const.P_DETAIL_URLPATH}--><!--{$product_id|u}-->" class="productName"><!--{$arrFavorite[cnt].name}--></a></h4>
60                                <p><span class="mini productPrice"><!--{$smarty.const.SALE_PRICE_TITLE}-->:<!--{if $arrFavorite[cnt].price02_min_inctax == $arrFavorite[cnt].price02_max_inctax}-->
61                                    <!--{$arrFavorite[cnt].price02_min_inctax|number_format}-->
62                                    <!--{else}-->
63                                    <!--{$arrFavorite[cnt].price02_min_inctax|number_format}-->~<!--{$arrFavorite[cnt].price02_max_inctax|number_format}-->
64                                    <!--{/if}-->円</span></p>
65                                <p class="btn_delete"><img src="<!--{$TPL_URLPATH}-->img/button/btn_delete.png" width="21" height="20" alt="削除" onclick="javascript:eccube.setModeAndSubmit('delete_favorite','product_id','<!--{$product_id|h}-->');" class="pointer" /></p>
66                            </div>
67                        </div><!--▲商品 -->
68                    <!--{/section}-->
69                </div><!-- /.formBox -->
70
71                <!--{if $stock_find_count > 0 && $customer_rank < 51}-->
72                    <div class="product-btn">
73                        <a rel="external" href="javascript:void(document.form1.submit())" class="btn-cart">カートに入れる</a>
74                    </div>
75                <!--{/if}-->
76            </form>
77        </div><!-- /.form_area -->
78
79        <div class="btn_area">
80            <!--{if $tpl_linemax > $dispNumber}-->
81                <p><a rel="external" href="javascript: void(0);" class="btn_more" id="btn_more_product" onclick="getProducts(5); return false;">もっとみる(+<!--{$dispNumber}-->件)</a></p>
82            <!--{/if}-->
83        </div>
84
85    <!--{else}-->
86        <div class="form_area">
87            <div class="information">
88                <p>お気に入りが登録されておりません。</p>
89            </div>
90        </div><!-- /.form_area -->
91    <!--{/if}-->
92
93</section>
94
95<!--{include file= 'frontparts/search_area.tpl'}-->
96
97<script>
98    var pageNo = 2;
99    var url = "<!--{$smarty.const.P_DETAIL_URLPATH}-->";
100    var imagePath = "<!--{$smarty.const.IMAGE_SAVE_URLPATH}-->";
101    var statusImagePath = "<!--{$TPL_URLPATH}-->";
102
103    function getProducts(limit) {
104        $.mobile.showPageLoadingMsg();
105        var i = limit;
106        //送信データを準備
107        var postData = {};
108        $('#form1').find(':input').each(function(){
109            postData[$(this).attr('name')] = $(this).val();
110        });
111        postData["mode"] = "getList";
112        postData["pageno"] = pageNo;
113        postData["disp_number"] = i;
114
115        $.ajax({
116            type: "POST",
117            url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/favorite.php",
118            data: postData,
119            cache: false,
120            dataType: "json",
121            error: function(XMLHttpRequest, textStatus, errorThrown){
122                alert(textStatus);
123                $.mobile.hidePageLoadingMsg();
124            },
125            success: function(result){
126                var productStatus = result.productStatus;
127                for (var j = 0; j < i; j++) {
128                    if (result[j] != null) {
129                        var product = result[j];
130                        var productHtml = "";
131                        var maxCnt = $(".favoriteBox").length - 1;
132                        var productEl = $(".favoriteBox").get(maxCnt);
133                        productEl = $(productEl).clone(true).insertAfter(productEl);
134                        maxCnt++;
135
136                        //商品写真をセット
137                        $($(".favoriteBox img.productImg").get(maxCnt)).attr({
138                            src: imagePath + product.main_list_image,
139                            alt: product.name
140                        });
141
142                        //商品名をセット
143                        $($(".favoriteBox a.productName").get(maxCnt)).text(product.name);
144                        $($(".favoriteBox a.productName").get(maxCnt)).attr("href", url + product.product_id);
145
146                        //販売価格をセット
147                        var price = $($(".favoriteBox span.productPrice").get(maxCnt));
148                        //販売価格をクリア
149                        price.empty();
150                        var priceVale = "";
151                        //販売価格が範囲か判定
152                        if (product.price02_min == product.price02_max) {
153                            priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_inctax_format + '円';
154                        } else {
155                            priceVale = "<!--{$smarty.const.SALE_PRICE_TITLE}-->:" + product.price02_min_inctax_format + '~' + product.price02_max_inctax_format + '円';
156                        }
157                        price.append(priceVale);
158
159                        //削除ボタンをセット
160                        $($(".favoriteBox p.btn_delete img").get(maxCnt)).attr("onclick", "javascript:eccube.setModeAndSubmit('delete_favorite','product_id','" + product.product_id + "');");
161
162                    }
163                }
164                pageNo++;
165
166                //全ての商品を表示したか判定
167                if (parseInt($("#productscount").text()) <= $(".favoriteBox").length) {
168                    $("#btn_more_product").hide();
169                }
170                $.mobile.hidePageLoadingMsg();
171            }
172        });
173    }
174</script>
Note: See TracBrowser for help on using the repository browser.