bobo 3 years ago
parent
commit
bab2708d21
2 changed files with 30 additions and 19 deletions
  1. 27 4
      pages/luckDraw/detail.js
  2. 3 15
      pages/luckDraw/detail.wxml

+ 27 - 4
pages/luckDraw/detail.js

@@ -19,8 +19,8 @@ Page({
         activityId: 0,
         forbidTurn: false,
         giftList: DEFAULT_GIFTS,
-        allNum: 1000,
-        remainNum: 128,
+        allNum: 0,
+        remainNum: 0,
         remainNumSplits: [],
         showHitPrizeDlg: false,
         showNoHitPrizeDlg: false,
@@ -28,7 +28,8 @@ Page({
         showPage: true,
         isLogin: false,
         hitResult: null,
-        noHitResult: null
+        noHitResult: null,
+        hitRecordList: []
     },
 
     popMessage(message) {
@@ -52,6 +53,8 @@ Page({
         this.data.activityId = options.id
         this.loadActivity()
         this.getDrawTimes()
+        // 获取中奖名单
+        this.getHitRecord()
     },
     loadActivity: function() {
         LuckDraw.getActivityDetail(this.data.activityId).then(resp => {
@@ -234,7 +237,6 @@ Page({
             this.getDrawTimes()
         })
     },
-
     nextPos() {
         let pos = 0
         switch(this.data.pointerPos) {
@@ -329,6 +331,27 @@ Page({
             }
             this.isLock = false
         }, 300)
+
+        // 刷新一下中奖名单
+        this.getHitRecord()
+    },
+
+    /**
+     * 中奖名单
+     */
+    getHitRecord: function() {
+        LuckDraw.getHitList(this.data.activityId).then(res => {
+            if (res.code == 200) {
+                this.setHitRecordDataMap(res.data)
+            }
+        }).catch(_ => {
+
+        })
+    },
+    setHitRecordDataMap: function(hitRecordList) {
+        this.setData({
+            hitRecordList
+        })
     },
 
     /**

+ 3 - 15
pages/luckDraw/detail.wxml

@@ -71,21 +71,9 @@
         <view/>
     </view>
     <view class="hit-record-list">
-        <view class="_item">
-            <view>166*****2223</view>
-            <viwe>XXXX优惠券</viwe>
-        </view>
-        <view class="_item">
-            <view>166*****2223</view>
-            <viwe>XXXX优惠券</viwe>
-        </view>
-        <view class="_item">
-            <view>133*****2233</view>
-            <viwe>XXXX优惠券</viwe>
-        </view>
-        <view class="_item">
-            <view>134*****2223</view>
-            <viwe>XXXX优惠券</viwe>
+        <view class="_item" wx:for="{{hitRecordList}}" wx:key="key">
+            <view>{{item.mobile}}</view>
+            <viwe>{{item.goodsName}}</viwe>
         </view>
     </view>