Sfoglia il codice sorgente

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

kk.shi 3 anni fa
parent
commit
bcd5b3b051
3 ha cambiato i file con 27 aggiunte e 5 eliminazioni
  1. 13 1
      pages/luckDraw/detail.js
  2. 3 3
      pages/luckDraw/detail.wxml
  3. 11 1
      pages/luckDraw/detail.wxss

+ 13 - 1
pages/luckDraw/detail.js

@@ -26,7 +26,7 @@ Page({
         showHitPrizeDlg: false,
         showNoHitPrizeDlg: false,
         showNeedShareDlg: false,
-        showPage: true,
+        showPage: false,
         isLogin: false,
         hitResult: null,
         noHitResult: null,
@@ -73,6 +73,10 @@ Page({
            this.setData({
              errMessage: err.data.msg
            })
+       }).finally(_ => {
+           this.setData({
+               showPage: true
+           })
        })
     },
 
@@ -80,6 +84,14 @@ Page({
      * 获取次数
      */
     getDrawTimes: function() {
+        if (!this.data.isLogin) {
+            this.setData({
+                remainNum: 0,
+                allNum: 0
+            })
+            this.setRemainNumSplits()
+            return
+        }
         LuckDraw.getTimes(this.data.activityId, getMobileCache()).then(res => {
             if (res.code == 200) {
                 this.setData({

+ 3 - 3
pages/luckDraw/detail.wxml

@@ -37,7 +37,7 @@
                     <view class="_gift _turn_btn" catchtap="turnPrize">
                         <button wx:if="{{!isLogin}}" class="phone-button" open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" />
                         <image class="_bg" src="/images/luck-draw/gift-booth-center.png" />
-                        <view class="_nums">
+                        <view wx:if="{{isLogin}}" class="_nums">
                             <text>{{remainNum}}/{{allNum}}</text>
                         </view>
                     </view>    
@@ -86,13 +86,13 @@
             恭喜您中奖了!
             <image src="/images/luck-draw/hbar.png" />
         </view>
-        <view class="prize-subtitle">抽到神秘大奖一份~</view>
+        <view class="prize-subtitle">{{hitResult.goodsName}}</view>
         <view class="prize-figure">
            <!-- 图片封面 -->
            <image wx:if="{{hitResult.goodsBigImage}}" src="{{hitResult.goodsBigImage}}" />
            <image src="/images/luck-draw/gift.png" wx:else />
         </view>
-        <view class="prize-tip">{{hitResult.goodsName}}</view>
+        <view class="prize-tip">{{hitResult.hitDesc || ""}}</view>
         <view class="btns">
             <view class="_btn _confirm" catchtap="closeDlg">确定</view>
             <navigator class="_btn _exchange" 

+ 11 - 1
pages/luckDraw/detail.wxss

@@ -345,17 +345,27 @@ page {
     top: 265rpx;
     left: 0;
     text-align: center;
+    box-sizing: border-box;
+    padding: 0 120rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
 }
 
 .prize-tip {
     width: 100%;
     font-size: 30rpx;
-    height: 32rpx;
+    height: 50rpx;
     position: absolute;
     top: 595rpx;
     left: 0;
     text-align: center;
     color: #fff;
+    box-sizing: border-box;
+    padding: 0 60rpx;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
 }
 
 .dlg .btns {