浏览代码

赠券时间格式化

junyuanz 4 年之前
父节点
当前提交
fcfd402573
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 5 1
      packageUser/pages/user/promotion/promotion.js
  2. 1 1
      packageUser/pages/user/promotion/promotion.wxml

+ 5 - 1
packageUser/pages/user/promotion/promotion.js

@@ -44,7 +44,11 @@ Page({
       per_page: this.data.per_page
     }
     var success = function (res) {
-      var result = that.data.list.concat(res.data.present || [])
+      var result = that.data.list.concat(res.data.present || []);
+	  for(var i in result){
+		  result[i]['time'] = result[i]['created_at'].replace("T"," ").replace("+"," ");
+	  }
+	  
       that.setData({
         list: result
       })

+ 1 - 1
packageUser/pages/user/promotion/promotion.wxml

@@ -7,7 +7,7 @@
         <!-- <view class="radish-main__time"><format-time type="formatTime" value="{{item.ctime}}" ></format-time></view> -->
 		<view class="radish-main__source">数量:{{item.send_nums1}}</view>
 		<view class="radish-main__source">来源:{{item.source_name}}</view>
-		<view class="radish-main__time">发放日期:{{item.created_at}}</view>
+		<view class="radish-main__time">发放日期:{{item.time}}</view>
         <view class="clean"></view>
       </view>
       <!-- <view class="radish-main__count">{{item.source_name}}</view> -->