浏览代码

Merge remote-tracking branch 'origin/bobo/feat/luck-draw' into bobo/feat/luck-draw

kk.shi 3 年之前
父节点
当前提交
71018e084b

+ 21 - 5
pages/luckDraw/detail.js

@@ -190,12 +190,18 @@ Page({
         this.data.hitTime = 0
         this.data.isHit = null;
         this.data.stopNotify = false
-        this.startTurnAnimationFast()
-        // 开始调用后台
-        setTimeout(_ => {
+        if (this.isSniffAgain) {
             this.data.hitTime = new Date().getTime()
             this.requestDrawPrize()
-        }, (Math.random() + 1)*1000)
+            this.isLock = false;
+        } else {
+            this.startTurnAnimationFast()
+            // 开始调用后台
+            setTimeout(_ => {
+                this.data.hitTime = new Date().getTime()
+                this.requestDrawPrize()
+            }, (Math.random() + 1)*1000)
+        }
     },
     
     requestDrawPrize: function() {
@@ -204,8 +210,10 @@ Page({
                 this.hitPrizeMapData(res.data)
             }
         }).catch(_ => {
-            this.data.stopNotify = true
             console.log(_)
+            this.data.stopNotify = true
+            this.isLock = false
+            this.getDrawTimes()
         })
     },
 
@@ -248,6 +256,13 @@ Page({
                     noHitResult,
                     isHit: 0,
                 })
+                if (this.data.hitPos == -1) {
+                    this.data.stopNotify = true
+                    this.setData({
+                        showNoHitPrizeDlg: true
+                    })
+                    this.isLock = false
+                }
             }
         }
         // 重刷次数
@@ -263,6 +278,7 @@ Page({
     // 授权手机号
     getPhoneNumber(e) {
         getPhoneNumberSync(e, _ => {
+            this.setData({ isLogin: true })
             this.getDrawTimes()
         })
     },

+ 1 - 1
pages/luckDraw/detail.wxml

@@ -22,7 +22,7 @@
                         <image wx:if="item.iconPath" src="{{item.iconUrl}}"/>
                     </view>
                     <view class="_text">
-                    <text>{{item.text}}</text>
+                    <text></text>
                     </view>
                     <image class="_bg" src="{{item.active ? '/images/luck-draw/gift-booth-active.png': '/images/luck-draw/gift-booth.png'}}" />
                 </view>

+ 6 - 0
pages/luckDraw/detail.wxss

@@ -184,6 +184,12 @@ page {
     color: #6C4EC2;
     left: 0;
     top: 102rpx;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+    padding: 0 10rpx;
+    width: 168rpx;
+    box-sizing: border-box;
 }
 
 ._gift ._bg {

+ 9 - 13
pages/luckDraw/index.js

@@ -23,15 +23,6 @@ Page({
         Object.assign(this, Common)
         this.getActivityList();
         this.startCountdownTimer()
-
-        LuckDraw.getUserPrizeList({
-    mobile: "16602120168",
-    goodsType: 1,
-    page: 1,
-    pageSize: 20
-}).then(res => {
-
-}).catch(_ => {})
     },
 
     /**
@@ -107,13 +98,18 @@ Page({
             let beginTime = v.beginTime
             let endTime = v.endTime
             if (v.timeType == 1 || beginTime == null) {
-                beginTime = "2021.11.01"
+                beginTime = ""
             }
             if (v.timeType == 1 || endTime == null) {
-                endTime = "2031.11.01"
+                endTime = ""
             }
-            v._beginTime = parseTime(beginTime, "{y}.{m}.{d}")
-            v._endTime = parseTime(endTime, "{y}.{m}.{d}")
+            beginTime && (v._beginTime = parseTime(beginTime, "{y}.{m}.{d} {h}:{i}:{s}"))
+            endTime && (v._endTime = parseTime(endTime, "{y}.{m}.{d} {h}:{i}:{s}"))
+
+            if (v.activityTitle && v.activityTitle.length > 20) {
+                v.activityTitle = v.activityTitle.substr(0, 20) + "..."
+            }
+
         })
         this.data.activityList = this.data.activityList.concat(...data)
         this.setData({

+ 4 - 1
pages/luckDraw/index.wxml

@@ -11,7 +11,10 @@
                 <view class="_base_info">
                     <view class="_title">{{item.activityTitle}}</view>
                     <view class="_subtitle">{{item.activitySubtitle}}</view>
-                    <view class="_time">{{item._beginTime}}-{{item._endTime}}</view>
+                    <view class="_time" wx:if="{{item.timeType == 1}}">
+                    长期
+                    </view>
+                    <view class="_time" wx:else>{{item._beginTime}}-{{item._endTime}}</view>
                 </view>
                 <view class="_status">
                     <view wx:if="{{item.status==1||item.status==4||item.status==5}}" class="_status_btn _status{{item.status}}">

+ 11 - 0
pages/luckDraw/index.wxss

@@ -30,12 +30,16 @@ page {
 ._info {
     display: flex;
     flex-direction: row;
+    position: relative;
 }
 ._base_info {
     flex: 1;
 }
 ._status {
     width: 210rpx;
+    position: absolute;
+    right: 0;
+    top: 0;
 }
 
 ._base_info {
@@ -46,6 +50,7 @@ page {
     font-size: 36rpx;
     color: #000;
     margin-bottom: 16rpx;
+    width: 390rpx;
 }
 
 ._subtitle {
@@ -53,6 +58,11 @@ page {
     color: #8c8c8c;
     font-size: 24rpx;
     margin-bottom: 4rpx;
+    width: 400rpx;
+    height: 32rpx;
+    overflow: hidden;
+    text-overflow:ellipsis;
+    white-space: nowrap;
 }
 ._time {
     font-size: 28rpx;
@@ -85,6 +95,7 @@ page {
     font-size: 26rpx;
     position: relative;
     left: -50rpx;
+    margin: 35rpx 0 0 0;
 }
 
 ._status3 {

+ 2 - 2
utils/request.js

@@ -2,9 +2,9 @@ import util from './util.js'
 class request {
 
     //本地的
- static BASE_URL = 'http://localhost:8014/'
+ // static BASE_URL = 'http://localhost:8014/'
 //   pre环境的
-//   static BASE_URL = 'https://oapi.shpr.top/'
+   static BASE_URL = 'https://oapi.shpr.top/'
 //   正式的
 //   static BASE_URL = 'https://vapi.hsayi.com/'