[Svn-src-all:3650] [version-2_12-dev 22562] #2149 (スマートフォンの購入履歴ページにて、もっと見る表示が不適切) を修正
Qwert
admin @ mail.ec-cube.net
2013年 2月 18日 (月) 14:13:36 JST
Subversion committed to /home/svn/open 22562
http://svn.ec-cube.net/open_trac/changeset/22562
┌────────────────────────────┐
│更新者 : Qwert │
│更新日時: 2013-02-18 14:13:36 +0900 (月, 18 2月 2013)│
└────────────────────────────┘
Log:
--------------------------------------------------------
#2149 (スマートフォンの購入履歴ページにて、もっと見る表示が不適切) を修正
Changed: [U:修正,A:追加,D:削除]
--------------------------------------------------------
U branches/version-2_12-dev/data/Smarty/templates/sphone/mypage/index.tpl
変更: branches/version-2_12-dev/data/Smarty/templates/sphone/mypage/index.tpl
===================================================================
--- branches/version-2_12-dev/data/Smarty/templates/sphone/mypage/index.tpl 2013-02-18 03:56:46 UTC (rev 22561)
+++ branches/version-2_12-dev/data/Smarty/templates/sphone/mypage/index.tpl 2013-02-18 05:13:36 UTC (rev 22562)
@@ -101,6 +101,8 @@
var pageNo = 2;
var url = "<!--{$smarty.const.ROOT_URLPATH}-->mypage/history.php";
var statusImagePath = "<!--{$TPL_URLPATH}-->";
+ var arrPayment = <!--{$arrPayment|@json_encode}-->
+ var arrCustomerOrderStatus = <!--{$arrCustomerOrderStatus|@json_encode}-->
function getHistory(limit) {
$.mobile.showPageLoadingMsg();
@@ -133,17 +135,28 @@
var historyEl = $(".arrowBox").get(maxCnt);
historyEl = $(historyEl).clone(true).insertAfter(historyEl);
maxCnt++;
+
+ var regex = new RegExp('([0-9]{2,4}).([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2}).([0-9]{1,2}).');
+ var matches = history.create_date.match(regex);
+ var formatted_date = history.create_date;
+ if(matches != null){
+ formatted_date = matches[1]+'/'+matches[2]+'/'+matches[3]+' '+matches[4]+':'+matches[5];
+ }
+
+ var formatted_payment_total = history.payment_total.toString().replace(/([0-9]+?)(?=(?:[0-9]{3})+$)/g , '$1,');
//注文番号をセット
$($(".arrowBox span.order_id").get(maxCnt)).text(history.order_id);
//購入日時をセット
- $($(".arrowBox span.create_date").get(maxCnt)).text(history.create_date);
+ $($(".arrowBox span.create_date").get(maxCnt)).text(formatted_date);
//支払い方法をセット
- $($(".arrowBox span.payment_id").get(maxCnt)).text(history.payment_id);
+ $($(".arrowBox span.payment_id").get(maxCnt)).text(arrPayment[history.payment_id]);
//合計金額をセット
- $($(".arrowBox span.payment_total").get(maxCnt)).text(history.payment_total);
+ $($(".arrowBox span.payment_total").get(maxCnt)).text(formatted_payment_total);
//履歴URLをセット
$($(".arrowBox a").get(maxCnt)).attr("href", url + "?order_id=" + history.order_id);
+ //注文状況をセット
+ $($(".arrowBox span.order_status").get(maxCnt)).text(arrCustomerOrderStatus[history.status]);
}
}
pageNo++;
Svn-src-all メーリングリストの案内