Bläddra i källkod

核销页面布局

kk.shi 3 år sedan
förälder
incheckning
8f566cd18f

+ 7 - 0
api/welfareMall.js

@@ -166,6 +166,13 @@ class WelfareMall extends request {
     return this.postRequest(`${this.BASE_URL}open/coupon/user-coupon-sn-list`, params);
   }
 
+    /**
+   * 获取订单
+   */
+  static getHexiaoList(params) {
+    return this.postRequest(`${this.BASE_URL}open/hexiao/list`, params);
+  }
+
 
 
 

+ 57 - 3
pages/welfareMall/writeOff/writeOff.js

@@ -1,18 +1,27 @@
 // pages/welfareMall/writeOff/writeOff.js
+import WelfareMall from '../../../api/welfareMall'
+import { parseTime } from '../../../utils/util'
+import {getMobileCache, getPhoneNumber as getPhoneNumberSync} from '../../../utils/user'
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-
+    page: 1,
+    pageSize: 10,
+    lock: false,
+    noResult: false,
+    noMore: false,
+    mobileTop: 'TONY WU',
+    hexiaoList: []
   },
 
   /**
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    this.getHexiaoList();
   },
 
   /**
@@ -62,5 +71,50 @@ Page({
    */
   onShareAppMessage: function () {
 
-  }
+  },
+
+  // 订单数据
+  getHexiaoList: function() {
+    WelfareMall.getHexiaoList({
+      page: this.data.page,
+      pageSize: this.data.pageSize,
+      mobile: getMobileCache(),
+    }).then(res => {
+        if (res.code == 200) {
+            this.userHexiaoListView(res.data)
+        }
+        this.data.lock = false
+    }).catch(_ => {
+        console.log(_)
+        this.data.lock = false
+    })
+},
+
+userHexiaoListView: function(data) {
+    if (!Array.isArray(data) || data.length == 0) {
+        console.log("核销列表数据为空");
+        if (this.data.page == 1) {
+            this.setData({
+                mobileTop:getMobileCache(),
+                noResult: true
+            })
+        } else {
+            this.setData({
+                mobileTop:getMobileCache(),
+                noMore: true
+            })
+        }
+        return
+    }
+    // data.forEach(v => {
+    //     let payeTime = v.payedAt
+    //     v.payedAt = parseTime(payeTime, "{y}.{m}.{d} {h}:{i}:{s}")
+    // })
+
+    this.data.hexiaoList = this.data.hexiaoList.concat(...data)
+    this.setData({
+        mobileTop:getMobileCache(),
+        hexiaoList: this.data.hexiaoList
+    })
+  }, 
 })

+ 4 - 0
pages/welfareMall/writeOff/writeOff.wxml

@@ -1,4 +1,8 @@
 <!--pages/welfareMall/writeOff/writeOff.wxml-->
+<view class="store-bar flex-row">
+  <view class="store-text">选择门店</view>
+  <image class="store-img" src="../../../images/welfareMall/open.png" />
+</view>
 <view class="writeOff-search flex-column">
   <view class="search-bar flex-row">
     <image class="search-img" src="../../../images/welfareMall/search.png" />

+ 23 - 3
pages/welfareMall/writeOff/writeOff.wxss

@@ -24,27 +24,47 @@ page{
   justify-content: center;
 }
 
-.writeOff-search{
+.store-bar{
   width: 750rpx;
-  height: 96rpx;
+  height: 88rpx;
   background: #FFFFFF;
+  justify-content: flex-start;
+}
+
+.writeOff-search{
+  width: 750rpx;
+  height: 88rpx;
+  background: #F7F7F7;
   justify-content: center;
 }
 
 .search-bar{
   width: 661rpx;
   height: 54rpx;
-  background: #F7F7F7;
+  background: #FFFFFF;
   border-radius: 28rpx;
   justify-content: flex-start;
 }
 
+.store-img{
+  width: 34rpx;
+  height: 34rpx;
+}
+
 .search-img{
   width: 34rpx;
   height: 34rpx;
   margin-left: 40rpx;
 }
 
+.store-text{
+  width: 150rpx;
+  margin-left: 50rpx;
+  font-size: 28rpx;
+  font-weight: 500;
+  color: #A0A0A0;
+}
+
 .search-text{
   margin-left: 30rpx;
   font-size: 28rpx;