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

Revision 23230, 8.0 KB checked in by m_uehara, 11 years ago (diff)

#2363 r23177, r23181 - r23186, r23188 - r23191, r23194, r23197, r23199 - r23218, r23220, r23223 - r23225 をマージ

  • 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
RevLine 
[19713]1<!--{*
2/*
3 * This file is part of EC-CUBE
4 *
[22206]5 * Copyright(c) 2000-2013 LOCKON CO.,LTD. All Rights Reserved.
[19713]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*}-->
[21533]24
[21050]25<section id="mypagecolumn">
[19713]26
[21533]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}-->
[19713]33
[21533]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}-->" />
[19713]38
[21533]39            <h3 class="title_mypage"><!--{$tpl_subtitle|h}--></h3>
40            <!--{if $objNavi->all_row > 0}-->
[19713]41
[21533]42                <!--★インフォメーション★-->
43                <div class="information">
44                    <p><span class="attention"><span id="historycount"><!--{$objNavi->all_row}--></span>件</span>の購入履歴があります。</p>
45                </div>
[21050]46
[21533]47                <div class="form_area">
[21050]48
[21533]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 />
[22001]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}-->
[21533]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}-->
[23230]77                        <p><a href="javascript: void(0);" class="btn_more" id="btn_more_history" onClick="getHistory(<!--{$dispNumber}-->); return false;" rel="external">もっとみる(+<!--{$dispNumber}-->件)</a></p>
[21533]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>
[21107]89
[23002]90<!--{include file= 'frontparts/search_area.tpl'}-->
[21533]91
[21050]92<script>
[21533]93    var pageNo = 2;
94    var url = "<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php";
95    var statusImagePath = "<!--{$TPL_URLPATH}-->";
[22563]96    var arrPayment = <!--{$json_payment}-->
97    var arrCustomerOrderStatus = <!--{$json_customer_order_status}-->
[21050]98
[21533]99    function getHistory(limit) {
100        $.mobile.showPageLoadingMsg();
101        var i = limit;
102        //送信データを準備
103        var postData = {};
104        $('#form1').find(':input').each(function(){
105            postData[$(this).attr('name')] = $(this).val();
106        });
107        postData["mode"] = "getList";
108        postData["pageno"] = pageNo;
109        postData["disp_number"] = i;
[21050]110
[21533]111        $.ajax({
112            type: "POST",
113            url: "<!--{$smarty.const.ROOT_URLPATH}-->mypage/index.php",
114            data: postData,
115            cache: false,
116            dataType: "json",
117            error: function(XMLHttpRequest, textStatus, errorThrown){
118                alert(textStatus);
119                $.mobile.hidePageLoadingMsg();
120            },
121            success: function(result){
122                for (var j = 0; j < i; j++) {
123                    if (result[j] != null) {
124                        var history = result[j];
125                        var historyHtml = "";
126                        var maxCnt = $(".arrowBox").length - 1;
127                        var historyEl = $(".arrowBox").get(maxCnt);
128                        historyEl = $(historyEl).clone(true).insertAfter(historyEl);
129                        maxCnt++;
[22856]130
[22562]131                        var regex = new RegExp('([0-9]{2,4}).([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2}).');
132                        var matches = history.create_date.match(regex);
133                        var formatted_date = history.create_date;
134                        if(matches != null){
135                            formatted_date = matches[1]+'/'+matches[2]+'/'+matches[3]+' '+matches[4]+':'+matches[5];
136                        }
[22856]137
[22562]138                        var formatted_payment_total = history.payment_total.toString().replace(/([0-9]+?)(?=(?:[0-9]{3})+$)/g , '$1,');
[21050]139
[21533]140                        //注文番号をセット
141                        $($(".arrowBox span.order_id").get(maxCnt)).text(history.order_id);
142                        //購入日時をセット
[22562]143                        $($(".arrowBox span.create_date").get(maxCnt)).text(formatted_date);
[21533]144                        //支払い方法をセット
[22562]145                        $($(".arrowBox span.payment_id").get(maxCnt)).text(arrPayment[history.payment_id]);
[21533]146                        //合計金額をセット
[22562]147                        $($(".arrowBox span.payment_total").get(maxCnt)).text(formatted_payment_total);
[21533]148                        //履歴URLをセット
149                        $($(".arrowBox a").get(maxCnt)).attr("href", url + "?order_id=" + history.order_id);
[22562]150                        //注文状況をセット
151                        $($(".arrowBox span.order_status").get(maxCnt)).text(arrCustomerOrderStatus[history.status]);
[21533]152                    }
153                }
154                pageNo++;
[21050]155
[22960]156                //全ての商品を表示したか判定
[21533]157                if (parseInt($("#historycount").text()) <= $(".arrowBox").length) {
158                    $("#btn_more_history").hide();
159                }
160                $.mobile.hidePageLoadingMsg();
161            }
162        });
163    }
[21529]164</script>
Note: See TracBrowser for help on using the repository browser.