소스 검색

历史订单数据交互

kk.shi 3 년 전
부모
커밋
f7e2d3877a
3개의 변경된 파일31개의 추가작업 그리고 18개의 파일을 삭제
  1. 12 8
      pages/welfareMall/historical/historical.js
  2. 11 9
      pages/welfareMall/historical/historical.wxml
  3. 8 1
      pages/welfareMall/historical/historical.wxss

+ 12 - 8
pages/welfareMall/historical/historical.js

@@ -63,17 +63,15 @@ Page({
         }
         }
         return
         return
     }
     }
-    data.forEach(v => {
-        let beginTime = v.coupon.couponBeginTimestamp
-        let endTime = v.coupon.couponEndTimestamp
-        v.coupon.couponBeginTimestamp = parseTime(beginTime, "{y}.{m}.{d}")
-        v.coupon.couponEndTimestamp = parseTime(endTime, "{y}.{m}.{d}")
-    })
+    // data.forEach(v => {
+    //     let payeTime = v.payedAt
+    //     v.payedAt = parseTime(payeTime, "{y}.{m}.{d} {h}:{i}:{s}")
+    // })
 
 
-    this.data.couponList = this.data.couponList.concat(...data)
+    this.data.orderList = this.data.orderList.concat(...data)
     this.setData({
     this.setData({
         mobileTop:getMobileCache(),
         mobileTop:getMobileCache(),
-        couponList: this.data.couponList
+        orderList: this.data.orderList
     })
     })
 }, 
 }, 
 
 
@@ -116,6 +114,12 @@ Page({
    * 页面上拉触底事件的处理函数
    * 页面上拉触底事件的处理函数
    */
    */
   onReachBottom: function () {
   onReachBottom: function () {
+    if (this.data.lock || this.data.noMore) {
+      return
+    }
+    this.data.lock = true
+    this.data.page++
+    this.getOrderList();
 
 
   },
   },
 
 

+ 11 - 9
pages/welfareMall/historical/historical.wxml

@@ -1,32 +1,34 @@
 <!--pages/welfareMall/historical/historical.wxml-->
 <!--pages/welfareMall/historical/historical.wxml-->
 <!-- 历史订单 -->
 <!-- 历史订单 -->
 <view class="historical flex-column">
 <view class="historical flex-column">
-  <view class="historical-style">
+  <view class="historical-style flex-column">
     <!-- 内容 -->
     <!-- 内容 -->
-    <view class="historical-content flex-column">
+    <view class="historical-content flex-column" wx:for="{{orderList}}" wx:key="index" data-id="{{item.id}}">
       <view class="content-hm flex-column">
       <view class="content-hm flex-column">
         <view class="content-head flex-row">
         <view class="content-head flex-row">
-          <view class="content-head-date">2021.11.04 12:22:35</view>
-          <view class="content-head-state">已完成</view>
+          <view class="content-head-date">{{item.payedAt}}</view>
+          <view class="content-head-state">{{item.status.showText}}</view>
         </view>
         </view>
         <view class="content-middle flex-row">
         <view class="content-middle flex-row">
           <view class="middle-it flex-row">
           <view class="middle-it flex-row">
-            <image class="middle-img" src="/images/welfareMall/middle_img.png" />
-            <view class="middle-text">圣诞优惠券包</view>
+            <image class="middle-img" src="{{item.goodsList[0].fullCoverImg}}" />
+            <view class="middle-text">{{item.goodsList[0].activityName}}</view>
           </view>
           </view>
           <view class="middle-num flex-column">
           <view class="middle-num flex-column">
-            <view class="middle-num-money">¥0.0</view>
-            <view class="money-num-count">x1</view>
+            <view class="middle-num-money">¥{{item.payPriceFormatter}}</view>
+            <view class="money-num-count">x{{item.goodsList.length}}</view>
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>
       <view class="content-line"></view>
       <view class="content-line"></view>
       <view class="content-lower flex-row" catchtap="getCompletion">
       <view class="content-lower flex-row" catchtap="getCompletion">
-        <view class="lower-total">共1件商品 合计¥9.9</view>
+        <view class="lower-total">共{{item.goodsList.length}}件商品 合计¥{{item.payPriceFormatter}}</view>
         <view class="lower-order-style flex-row">
         <view class="lower-order-style flex-row">
           <view class="lower-order-text">订单详情</view>
           <view class="lower-order-text">订单详情</view>
         </view>
         </view>
       </view>
       </view>
     </view>
     </view>
+    <view class="no_result" wx:if="{{noResult}}">———— 抱歉,您暂无历史订单 ————</view>
+    <view class="no_result" wx:if="{{noMore}}">———— 更多订单 | 敬请期待 ————</view>
   </view>
   </view>
 </view>
 </view>

+ 8 - 1
pages/welfareMall/historical/historical.wxss

@@ -41,7 +41,7 @@
 }
 }
 
 
 .content-head-date{
 .content-head-date{
-  width: 211rpx;
+  width: 230rpx;
   height: 28rpx;
   height: 28rpx;
   font-size: 22rpx;
   font-size: 22rpx;
   font-weight: 500;
   font-weight: 500;
@@ -135,4 +135,11 @@
   font-size: 22rpx;
   font-size: 22rpx;
   font-weight: 500;
   font-weight: 500;
   color: #B01717;
   color: #B01717;
+}
+
+.no_result {
+  font-size: 24rpx;
+  color: #B1B1B1;
+  line-height: 100rpx;
+  font-weight: 1000;
 }
 }