瀏覽代碼

Merge branch 'bug_fix_220415_style' into dev_220318_test

# Conflicts:
#	src/entry/content.js
#	src/http/configAPI.js
#	src/view/components/paypal-button.vue
wenliming 3 年之前
父節點
當前提交
91e89dd682
共有 2 個文件被更改,包括 71 次插入37 次删除
  1. 1 1
      src/view/components/paypal-button.vue
  2. 70 36
      src/view/red-packet.vue

+ 1 - 1
src/view/components/paypal-button.vue

@@ -8,7 +8,7 @@
             <iframe
                 class="iframe-pay"
                 ref="iframe"
-                :src="`https://art-weapp.oss-cn-hangzhou.aliyuncs.com/chromeExtension/paypal3.html?paypalClientId=${payConfig.paypalClientId}&amount=${props.finalAmountData.finalAmountValue}`"></iframe>
+                :src="`${payConfig.paypalHtml}?paypalClientId=${payConfig.paypalClientId}&amount=${props.finalAmountData.finalAmountValue}`"></iframe>
         </div>
     </div>
 </template>

+ 70 - 36
src/view/red-packet.vue

@@ -3,6 +3,7 @@
     <!-- open -->
     <div v-if="data.status == 'opened'" class="opened">
       <div class="header" :style="{ 'backgroundImage': `url(${require('../assets/svg/back-head-top.svg')})` }">
+        <div class="seat"></div>
         <div class="title">Awesome! You Will Get</div>
         <div class="money">
           <img :src="require('../assets/svg/icon-dollar.svg')" alt />
@@ -75,6 +76,7 @@
     <!-- success -->
     <div v-else-if="data.status == 'success'" class="success">
       <div class="header" :style="{ 'backgroundImage': `url(${require('../assets/svg/back-head-top.svg')})` }">
+        <div class="seat"></div>
         <div class="money">
           <img :src="require('../assets/svg/icon-dollar.svg')" alt />
           <span class="big">{{ data.money / 100 }}</span>
@@ -155,6 +157,7 @@
     <!-- 红包被领完了 -->
     <div v-else-if="data.status == 'close'" class="close">
       <div class="header" :style="{ 'backgroundImage': `url(${require('../assets/svg/back-head-top.svg')})` }">
+        <div class="seat"></div>
         <div class="close-title">{{ data.close_title }}</div>
         <div class="close-title" v-if="data.close_text">{{ data.close_text }}</div>
       </div>
@@ -373,7 +376,40 @@ async function clickFollowAll(item) {
     }
   })
 }
+// 我领取了的状态
+function myReceivedState() {
+  data.status = 'opened'
+  data.money = data.detail.myReceived.amountValue
 
+  // 我的红包已经过期了 and 大红包可以领取
+  if (data.detail.myReceived.taskFinishStatus == 2 && !data.detail.receiveTimeExpired) {
+    data.status = 'not-open'
+  }
+  // 我领取未完成 and 大红包可以领取
+  if (data.detail.myReceived.taskFinishStatus == 0 && !data.detail.receiveTimeExpired) {
+    initTaskDetail()
+    getValidity()
+    data.detail.taskCondition = JSON.parse(data.detail.taskCondition)
+    data.detail.amountValue = showLastTwoPlace(data.detail.amountValue)
+    data.detail.receiveAmountValue = showLastTwoPlace(data.detail.receiveAmountValue)
+  }
+
+  // 大红包不能领取了
+  if (data.detail.receiveTimeExpired) {
+    data.status = 'close'
+    data.close_title = `This Giveways`
+    data.close_text = `expired on ${moment(data.detail.endTimestamp).format('MM-DD')}`
+  }
+  // 任务已经被领完了
+  if (data.detail.totalCount == data.detail.receiveCount) {
+    data.status = 'close'
+    data.close_title = 'Better luck next time!'
+  }
+  // 我领取成功了
+  if (data.detail.myReceived.taskFinishStatus == 1) {
+    data.status = 'success'
+  }
+}
 
 function showLastTwoPlace(n) {
   return n / 100
@@ -399,48 +435,37 @@ function init() {
         // 红包未开始
         if (data.detail.status == 0) {
           data.status = 'not-open'
-          return
-        }
-        // 我领取了  
-        if (data.detail.myReceived) {
-          data.status = 'opened'
-          data.money = data.detail.myReceived.amountValue
-
-          // 我的红包已经过期了
-          if (data.detail.myReceived.taskFinishStatus == 2) {
-            data.status = 'not-open'
-          }
-          // 我领取成功了
-          if (data.detail.myReceived.taskFinishStatus == 1) {
-            data.status = 'success'
-          }
-          // 我领取未完成
-          if (data.detail.myReceived.taskFinishStatus == 0) {
-            initTaskDetail()
-            getValidity()
-            data.detail.taskCondition = JSON.parse(data.detail.taskCondition)
-            data.detail.amountValue = showLastTwoPlace(data.detail.amountValue)
-            data.detail.receiveAmountValue = showLastTwoPlace(data.detail.receiveAmountValue)
-          }
 
-          // 我没有领取
-        } else {
           // 任务进行中
-          if (data.detail.status == 1) {
-            data.status = 'not-open'
+        } else if (data.detail.status == 1) {
+          data.status = 'not-open'
+          // 我领取过的状态
+          if (data.detail.myReceived) {
+            myReceivedState()
+          } else {
+            // 大红包不可以领取了
+            if (data.detail.receiveTimeExpired) {
+              data.status = 'close'
+              data.close_title = `This Giveways`
+              data.close_text = `expired on ${moment(data.detail.endTimestamp).format('MM-DD')}`
+            }
+            // 任务已经被领完了
+            if (data.detail.totalCount == data.detail.receiveCount) {
+              data.status = 'close'
+              data.close_title = 'Better luck next time!'
+            }
+          }
 
-            // 任务已经结束了
-          } else if (data.detail.status == 2) {
+          // 任务已经结束了
+        } else if (data.detail.status == 2) {
+          // 我领取过的状态
+          if (data.detail.myReceived) {
+            myReceivedState()
+          } else {
             data.status = 'close'
             data.close_title = `This Giveways`
             data.close_text = `expired on ${moment(data.detail.endTimestamp).format('MM-DD')}`
           }
-
-          // 任务已经被领完了
-          if (data.detail.totalCount == data.detail.receiveCount) {
-            data.status = 'close'
-            data.close_title = 'Better luck next time!'
-          }
         }
         break
     }
@@ -698,6 +723,11 @@ body {
       background-size: 100% 100%;
       position: relative;
 
+      .seat {
+        width: 100%;
+        height: 30px;
+      }
+
       .done {
         cursor: pointer;
         position: absolute;
@@ -896,6 +926,11 @@ body {
       // padding-top: 30px;
       background-size: 100% 100%;
 
+      .seat {
+        width: 100%;
+        height: 30px;
+      }
+
       .title {
         color: #fff7e4;
         opacity: 0.6;
@@ -904,7 +939,6 @@ body {
         font-size: 18px;
         line-height: 21px;
         letter-spacing: -0.3px;
-        margin-top: 30px;
       }
 
       .money {