Ignore:
Timestamp:
2013/02/18 14:13:36 (11 years ago)
Author:
Qwert
Message:

#2149 (スマートフォンの購入履歴ページにて、もっと見る表示が不適切) を修正

File:
1 edited

Legend:

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

    r22206 r22562  
    102102    var url = "<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php"; 
    103103    var statusImagePath = "<!--{$TPL_URLPATH}-->"; 
     104    var arrPayment = <!--{$arrPayment|@json_encode}--> 
     105    var arrCustomerOrderStatus = <!--{$arrCustomerOrderStatus|@json_encode}--> 
    104106 
    105107    function getHistory(limit) { 
     
    134136                        historyEl = $(historyEl).clone(true).insertAfter(historyEl); 
    135137                        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,'); 
    136147 
    137148                        //注文番号をセット 
    138149                        $($(".arrowBox span.order_id").get(maxCnt)).text(history.order_id); 
    139150                        //購入日時をセット 
    140                         $($(".arrowBox span.create_date").get(maxCnt)).text(history.create_date); 
     151                        $($(".arrowBox span.create_date").get(maxCnt)).text(formatted_date); 
    141152                        //支払い方法をセット 
    142                         $($(".arrowBox span.payment_id").get(maxCnt)).text(history.payment_id); 
     153                        $($(".arrowBox span.payment_id").get(maxCnt)).text(arrPayment[history.payment_id]); 
    143154                        //合計金額をセット 
    144                         $($(".arrowBox span.payment_total").get(maxCnt)).text(history.payment_total); 
     155                        $($(".arrowBox span.payment_total").get(maxCnt)).text(formatted_payment_total); 
    145156                        //履歴URLをセット 
    146157                        $($(".arrowBox a").get(maxCnt)).attr("href", url + "?order_id=" + history.order_id); 
     158                        //注文状況をセット 
     159                        $($(".arrowBox span.order_status").get(maxCnt)).text(arrCustomerOrderStatus[history.status]); 
    147160                    } 
    148161                } 
Note: See TracChangeset for help on using the changeset viewer.