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

Revision 22856, 8.4 KB checked in by Seasoft, 11 years ago (diff)

#2043 (typo修正・ソース整形・ソースコメントの改善 for 2.13.0)

  • 主に空白・空白行の調整。もう少し整えたいが、一旦現状コミット。
  • 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
27    <h2 class="title"><!--{$tpl_title|h}--></h2>
28        <!--{if $tpl_navi != ""}-->
29            <!--{include file=$tpl_navi}-->
30        <!--{else}-->
31            <!--{include file=`$smarty.const.TEMPLATE_REALDIR`mypage/navi.tpl}-->
32        <!--{/if}-->
33
34        <form name="form1" id="form1" method="post" action="<!--{$smarty.const.ROOT_URLPATH}-->mypage/index.php">
35            <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
36            <input type="hidden" name="order_id" value="" />
37            <input type="hidden" name="pageno" value="<!--{$objNavi->nowpage}-->" />
38
39            <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3>
40            <!--{if $objNavi->all_row > 0}-->
41
42                <!--★インフォメーション★-->
43                <div class="information">
44                    <p><span class="attention"><span id="historycount"><!--{$objNavi->all_row}--></span>件</span>の購入履歴があります。</p>
45                </div>
46
47                <div class="form_area">
48
49                    <!--▼フォームボックスここから -->
50                    <div class="formBox">
51                        <!--{section name=cnt loop=$arrOrder max=$dispNumber}-->
52                            <!--▼商品 -->
53                            <div class="arrowBox">
54                                <p>
55                                    <em>注文番号:</em><span class="order_id"><!--{$arrOrder[cnt].order_id}--><!--{assign var=payment_id value="`$arrOrder[cnt].payment_id`"}--></span><br />
56                                    <em>購入日時:</em><span class="create_date"><!--{$arrOrder[cnt].create_date|sfDispDBDate}--></span><br />
57                                    <em>お支払い方法:</em><span class="payment_id"><!--{$arrPayment[$payment_id]|h}--></span><br />
58                                    <em>合計金額:</em><span class="payment_total"><!--{$arrOrder[cnt].payment_total|number_format}--></span>円<br />
59                                    <em>ご注文状況:</em>
60                                    <!--{if $smarty.const.MYPAGE_ORDER_STATUS_DISP_FLAG }-->
61                                        <!--{assign var=order_status_id value="`$arrOrder[cnt].status`"}-->
62                                        <!--{if $order_status_id != $smarty.const.ORDER_PENDING }-->
63                                        <span class="order_status"><!--{$arrCustomerOrderStatus[$order_status_id]|h}--></span><br />
64                                        <!--{else}-->
65                                        <span class="order_status attention"><!--{$arrCustomerOrderStatus[$order_status_id]|h}--></span><br />
66                                        <!--{/if}-->
67                                    <!--{/if}-->
68                                </p>
69                                <a href="<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php?order_id=<!--{$arrOrder[cnt].order_id}-->" rel="external"></a>
70                            </div>
71                            <!--▲商品 -->
72                        <!--{/section}-->
73                    </div><!-- /.formBox -->
74                </div><!-- /.form_area-->
75                <div class="btn_area">
76                    <!--{if $objNavi->all_row > $dispNumber}-->
77                        <p><a href="javascript: void(0);" class="btn_more" id="btn_more_history" onClick="getHistory(5); return false;" rel="external">もっとみる(+<!--{$dispNumber}-->件)</a></p>
78                    <!--{/if}-->
79                </div>
80            <!--{else}-->
81                <div class="form_area">
82                    <div class="information">
83                        <p>購入履歴はありません。</p>
84                    </div>
85                </div><!-- /.form_area-->
86            <!--{/if}-->
87        </form>
88</section>
89
90<!--▼検索バー -->
91<section id="search_area">
92    <form method="get" action="<!--{$smarty.const.ROOT_URLPATH}-->products/list.php">
93        <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" />
94        <input type="hidden" name="mode" value="search" />
95        <input type="search" name="name" id="search" value="" placeholder="キーワードを入力" class="searchbox" >
96    </form>
97</section>
98<!--▲検索バー -->
99
100<script>
101    var pageNo = 2;
102    var url = "<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php";
103    var statusImagePath = "<!--{$TPL_URLPATH}-->";
104    var arrPayment = <!--{$json_payment}-->
105    var arrCustomerOrderStatus = <!--{$json_customer_order_status}-->
106
107    function getHistory(limit) {
108        $.mobile.showPageLoadingMsg();
109        var i = limit;
110        //送信データを準備
111        var postData = {};
112        $('#form1').find(':input').each(function(){
113            postData[$(this).attr('name')] = $(this).val();
114        });
115        postData["mode"] = "getList";
116        postData["pageno"] = pageNo;
117        postData["disp_number"] = i;
118
119        $.ajax({
120            type: "POST",
121            url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/index.php",
122            data: postData,
123            cache: false,
124            dataType: "json",
125            error: function(XMLHttpRequest, textStatus, errorThrown){
126                alert(textStatus);
127                $.mobile.hidePageLoadingMsg();
128            },
129            success: function(result){
130                for (var j = 0; j < i; j++) {
131                    if (result[j] != null) {
132                        var history = result[j];
133                        var historyHtml = "";
134                        var maxCnt = $(".arrowBox").length - 1;
135                        var historyEl = $(".arrowBox").get(maxCnt);
136                        historyEl = $(historyEl).clone(true).insertAfter(historyEl);
137                        maxCnt++;
138
139                        var regex = new RegExp('([0-9]{2,4}).([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2}).');
140                        var matches = history.create_date.match(regex);
141                        var formatted_date = history.create_date;
142                        if(matches != null){
143                            formatted_date = matches[1]+'/'+matches[2]+'/'+matches[3]+' '+matches[4]+':'+matches[5];
144                        }
145
146                        var formatted_payment_total = history.payment_total.toString().replace(/([0-9]+?)(?=(?:[0-9]{3})+$)/g , '$1,');
147
148                        //注文番号をセット
149                        $($(".arrowBox span.order_id").get(maxCnt)).text(history.order_id);
150                        //購入日時をセット
151                        $($(".arrowBox span.create_date").get(maxCnt)).text(formatted_date);
152                        //支払い方法をセット
153                        $($(".arrowBox span.payment_id").get(maxCnt)).text(arrPayment[history.payment_id]);
154                        //合計金額をセット
155                        $($(".arrowBox span.payment_total").get(maxCnt)).text(formatted_payment_total);
156                        //履歴URLをセット
157                        $($(".arrowBox a").get(maxCnt)).attr("href", url + "?order_id=" + history.order_id);
158                        //注文状況をセット
159                        $($(".arrowBox span.order_status").get(maxCnt)).text(arrCustomerOrderStatus[history.status]);
160                    }
161                }
162                pageNo++;
163
164                //すべての商品を表示したか判定
165                if (parseInt($("#historycount").text()) <= $(".arrowBox").length) {
166                    $("#btn_more_history").hide();
167                }
168                $.mobile.hidePageLoadingMsg();
169            }
170        });
171    }
172</script>
Note: See TracBrowser for help on using the repository browser.