wenliming преди 2 години
родител
ревизия
3b099cae65

+ 1 - 1
src/view/components/custom-card-horizontal-cover.vue

@@ -76,7 +76,7 @@
                         <div class="item">
                             <img class="icon" 
                                 :src="require('@/assets/svg/icon-preview-trophy.svg')" />
-                            {{data.addFans}} Winners
+                            {{data.totalCount}} Winners
                         </div>
                         <div class="item">
                             <img class="icon" :src="data.currencyIconUrl">

+ 4 - 3
src/view/iframe/publish/components/form-input.vue

@@ -43,8 +43,8 @@ onMounted(() => {
     display: flex;
     align-items: center;
     color: #999999;
-    font-weight: 400;
-    font-size: 14px;
+    font-weight: 500;
+    font-size: 12px;
 
     .prefix {
         margin-right: 4px;
@@ -54,7 +54,8 @@ onMounted(() => {
         margin-left: 4px;
         white-space: nowrap;
         color: #999999;
-        font-weight: 400;
+        font-weight: 500;
+        font-size: 12px;
     }
 }
 </style>

+ 20 - 15
src/view/iframe/publish/give-dialog.vue

@@ -176,7 +176,7 @@
                                                     {{selectModeInfo.type != PlayType.treasure ? 'Winners' : 'New Follower'}}
                                                 </div>
                                                 <div class="cell-content">
-                                                    <div>
+                                                    <div class="count-input-wrapper">
                                                         <form-input :suffix="selectModeInfo.type != PlayType.treasure ? 'People' : 'Follower'">
                                                             <template v-slot:content>
                                                                 <input style="width: 120px"
@@ -187,8 +187,8 @@
                                                                     @blur="onCountBlur"/>
                                                             </template>
                                                         </form-input>
-                                                        <div v-if="selectModeInfo.type == PlayType.treasure">
-                                                            <span>$0.02</span> Per New Follower
+                                                        <div class="fans-unit-txt" v-if="selectModeInfo.type == PlayType.treasure && treasureFormData.fansUnitAmount">
+                                                            <span>${{treasureFormData.fansUnitAmount}}</span> per New Follower
                                                         </div>
                                                     </div>
 
@@ -338,10 +338,7 @@
                         <!-- 预览 -->
                         <template v-else-if="showComType == 'preview'">
                             <preview-sheet 
-                                :baseFormData="{
-                                    ...baseFormData,
-                                    addFans: baseFormData.totalCount,
-                                }"
+                                :baseFormData="baseFormData"
                                 :upGainAmountUsdValue="treasureFormData.upGainAmountUsdValue"
                                 :currentCurrencyInfo="currentCurrencyInfo"
                                 :tempCurrentCurrencyInfo="tempCurrentCurrencyInfo"
@@ -994,6 +991,7 @@ const resetFormIpt = (clearMode = true) => {
     baseFormData.rewardType = RewardType.money;
     baseFormData.customizedReward = "";
     treasureFormData.usdEstimateOrderAmount = "";
+    treasureFormData.upGainAmountUsdValue = "";
 
     if(clearMode) {
         selectModeInfo.index = 0;
@@ -1467,6 +1465,7 @@ const calcFansUnitAmount = () => {
         unitAmount = calcToken2UsdEstimate({amount: unitAmount, usdPrice: currentCurrencyInfo.value.usdPrice });
     }
 
+    setUpGainAmountUsdValue({totalAmount: baseFormData.amountValue, unitPrice: unitAmount});
     return unitAmount;
 };
 
@@ -1701,7 +1700,7 @@ const treasureFormValidata = () => {
         isShowUsdMinMessage.value = true;
     } else if (!baseFormData.totalCount || baseFormData.totalCount == '0') {
         // 输入Follower 
-        iptErrMsgTxt.value = "Enter the number of follower";
+        iptErrMsgTxt.value = "Enter the number of new follower";
     } else if(iptErrMsgTxt.value  = checkTreasureAmountRange()) {
         // 粉丝单价是否 小于总金额规则 大于最小粉丝单价 、大于币种最小精度
         isShowUsdMinMessage.value = true;
@@ -2529,6 +2528,19 @@ onMounted(() => {
                                         align-items: center;
                                     }
                                     .cell-content {
+                                        .count-input-wrapper {
+                                            display: flex;
+                                            align-items: center;
+                                            .fans-unit-txt {
+                                                margin-left: 10px;
+                                                color: #7E7E7E;
+                                                font-size: 12px;
+                                                font-weight: 400;
+                                                span {
+                                                    color: #C88726;
+                                                }
+                                            }
+                                        }
                                         input {
                                             width: 178px;
                                             font-weight: 500;
@@ -2554,13 +2566,6 @@ onMounted(() => {
                                             color: #B3B3B3;
                                             margin-top: 12px;
                                         }
-
-                                        .cost-txt {
-                                            color: #7E7E7E;
-                                            font-weight: 400;
-                                            font-size: 12px;
-                                            margin-left: 10px;
-                                        }
                                     }
                                 }
 

+ 72 - 18
src/view/popup/tabbar-page/message/index.vue

@@ -4,20 +4,27 @@
       <div class="list-wrapper" ref="pageGiveListDom">
         <div class="give-list" v-if="currentTabIndex == 0">
           <template v-if="giveList.length">
-            <div class="cell" :class="{ 'cell-center': item.type == 1 || item.type == 3 }"
+            <div class="cell" :class="{ 'cell-center': item.type == 1 || item.type == 3 || item.type == 5 }"
               v-for="(item, index) in giveList" :key="index" @click="clickListItem(item, index)">
               <red-dot class="red-dots" v-if="item.unReadMsgCount > 0 && isReadMsg"></red-dot>
 
               <div class="img-wrapper">
                 <!-- 收到红包 -->
-                <template v-if="item.type == 1 || item.type == 3">
+                <template v-if="item.type == 1 || item.type == 3 || item.type == 5">
                   <img class="icon-avatar" :src="item.userInfo.avatarUrl" />
-                  <img class="icon-give" :src="require('@/assets/svg/icon-get-giveaways-s.svg')" />
+                  <img class="icon-give" v-if="item.type == 5" :src="require('@/assets/svg/icon-small-treasure.svg')" />
+                  <img class="icon-give" v-else :src="require('@/assets/svg/icon-get-giveaways-s.svg')" />
                 </template>
                 <!-- 发出去红包 -->
                 <template v-else-if="item.type == 2">
-                  <img class="icon-big-give" :src="require('@/assets/svg/icon-send-giveaways-s.svg')" />
-                  <img class="icon-mark-give" :src="require('@/assets/svg/icon-send-giveaways-mark.svg')" />
+                  <template v-if="item.postTaskLuckdrop.luckdropType === PlayType.treasure">
+                    <img class="icon-big-give" :src="require('@/assets/svg/icon-big-treasure.svg')" />
+                    <img class="icon-mark-give" :src="require('@/assets/svg/icon-send-giveaways-mark.svg')" />
+                  </template>
+                  <template v-else>
+                    <img class="icon-big-give" :src="require('@/assets/svg/icon-send-giveaways-s.svg')" />
+                    <img class="icon-mark-give" :src="require('@/assets/svg/icon-send-giveaways-mark.svg')" />
+                  </template>
                 </template>
                 <!-- 转出NFT记录 -->
                 <template v-else-if="item.type == 4">
@@ -34,14 +41,22 @@
                   </div>
                 </template>
               </div>
-              <div class="info-wrapper" :class="{ 'info-center': item.type == 1 }">
+              <div class="info-wrapper" :class="{ 'info-center': item.type == 1 || item.type == 5 }">
                 <div class="left">
                   <div class="nickname">
                     <template v-if="item.type == 1">
                       Get Giveaway
                     </template>
                     <template v-else-if="item.type == 2">
-                      {{ item.postTaskLuckdrop.luckdropType === 1 ? 'Send Giveaway' : 'Lottery Giveaway' }}
+                        <template v-if="item.postTaskLuckdrop.luckdropType === PlayType.common">
+                          Send Giveaway
+                        </template>
+                        <template v-else-if="item.postTaskLuckdrop.luckdropType === PlayType.lottery">
+                          Lottery Giveaway
+                        </template>
+                        <template v-else-if="item.postTaskLuckdrop.luckdropType === PlayType.treasure">
+                          Treasure Hunt
+                        </template>
                     </template>
                     <template v-else-if="item.type == 3">
                       Lottery
@@ -49,6 +64,9 @@
                     <template v-else-if="item.type == 4">
                       Transfer NFT
                     </template>
+                    <template v-else-if="item.type == 5">
+                      Treasure Hunt
+                    </template>
                   </div>
                   <div class="time">
                     {{ moment(item.timestamp).format("MM-DD HH:mm:ss") }}
@@ -59,11 +77,11 @@
                     <div class="bold" :class="{
                       'align-content':
                         (item.type == 2 ||
-                          (item.type == 1 && item.status == 1)) &&
+                          (item.type == 1 && item.status == 1 || item.type == 5 && item.status == 1)) &&
                         item?.amount?.length + item?.currencySymbol?.length > 12,
                       'custom-bold': item.rewardType === RewardType.custom
                     }">
-                      <!-- 收到的 -->
+                      <!-- 领取的普通红包 -->
                       <template v-if="item.type == 1">
                         <!-- 进行中-->
                         <template v-if="item.status == 0">
@@ -120,6 +138,7 @@
 
                         </template>
                       </template>
+                      <!-- 抽奖 -->
                       <template v-else-if="item.type == 3">
                         <template v-if="item.status == 1">In Progress</template>
                         <template v-else-if="item.status == 2">
@@ -156,12 +175,38 @@
                           Giveaway Expired
                         </template>
                       </template>
+                      <!-- NFT 转出记录 -->
                       <template v-else-if="item.type == 4">
                         <template v-if="item.status == 0 || item.status == 1">Transferring</template>
                         <template v-else-if="item.status == 2">Successful</template>
                         <template v-else-if="item.status == 3">Transfe Failed</template>
                       </template>
+                      <!-- 领取的夺宝红包 -->
+                      <template v-else-if="item.type == 5">
+                        <!-- 进行中-->
+                        <template v-if="item.status == 0">
+                          In Progress
+                        </template>
+                        <!-- 已完成 -->
+                        <template v-else-if="item.status == 2">
+                            <span class="blance">
+                              <a-tooltip :title="item.amount">
+                                {{ getBit(item.amount) }}</a-tooltip>
+                            </span>
+                            <div class="coin-type-wrapper">
+                              <span class="coin-type">{{
+                                  item.currencySymbol || ""
+                              }}</span>
+                              <img :src="item.currencyIconPath" alt="" />
+                            </div>
+                        </template>
+                        <!-- 已过期 -->
+                        <template v-else-if="item.status == 3">
+                          Giveaway Expired
+                        </template>
+                      </template>
                     </div>
+
                     <!-- 发出的红包显示 -->
                     <div class="desc" v-if="item.type == 2">
                       <!-- 未发送-->
@@ -170,7 +215,7 @@
                       </template>
                       <!-- 进行中 -->
                       <template v-else-if="item.status == 1">
-                        <template v-if="item.postTaskLuckdrop && item.postTaskLuckdrop.luckdropType == 2">
+                        <template v-if="item.postTaskLuckdrop && item.postTaskLuckdrop.luckdropType == PlayType.lottery">
                           {{ item.downTime || '' }}
                         </template>
                         <template v-else>
@@ -179,12 +224,13 @@
                           }}
                         </template>
                       </template>
+
                       <!-- 2:已结束; 3:提前终止-->
                       <template v-else-if="item.status == 2 || item.status == 3">
                         <!-- 普通红包 -->
-                        <template v-if="item.postTaskLuckdrop && item.postTaskLuckdrop.luckdropType == 1">
+                        <template v-if="item.postTaskLuckdrop.luckdropType == PlayType.common || item.postTaskLuckdrop.luckdropType == PlayType.treasure">
                           <template v-if="item.status == 2">
-                            (Time expired)
+                            {{item.postTaskLuckdrop.luckdropType == PlayType.common ? '(Time expired)': 'Complete'}}
                           </template>
                           <template v-if="item.status == 3">
                             {{ item.srcContentId ? '(Termination)' : 'Termination' }}
@@ -208,8 +254,7 @@
                         }}
                       </template>
 
-                      <!-- 进行中或者未发送成功时显示 
-                                                v-if="item.status == 1 || item.postTaskLuckdrop.reSendAvailable"-->
+                      <!-- 进行中或者未发送成功时显示 -->
                       <div class="desc-bottom-bar">
                         <!-- 没有终止红包时显示 -->
                         <div v-if="item.postTaskLuckdrop.terminatedAvailable" class="btn"
@@ -259,7 +304,7 @@ import { terminatedLuckdrop } from "@/http/redPacket";
 import { readAllMsgByType, getAllMessageInfo } from "@/http/messageApi"
 import { setBadgeInfo, hideBadge } from "@/logic/background/twitter";
 import { getChromeStorage } from "@/uilts/chromeExtension";
-import { RewardType } from "@/types";
+import { PlayType, RewardType } from '@/types';
 
 var moment = require("moment");
 
@@ -412,13 +457,22 @@ const terminaHandler = (params, index) => {
   terminaTask.index = index;
 
   // set font
-  if (params && params.postTaskLuckdrop && params.postTaskLuckdrop.luckdropType == 2) {
-    modalTitle.value = `Early Termination of Lottery?`
-    modalContent.value = `This operation will terminate the lottery process and refund the lottery prizes.`
+  if(params && params.postTaskLuckdrop) {
+    if (params.postTaskLuckdrop.luckdropType == PlayType.lottery) {
+      modalTitle.value = `Early Termination of Lottery?`
+      modalContent.value = `This operation will terminate the lottery process and refund the lottery prizes.`
+    } else if(params.postTaskLuckdrop.luckdropType == PlayType.treasure) {
+      modalTitle.value = `Early Termination of treasure Hunt?`
+      modalContent.value = `This operation will stop the treasure hunt and refund the remaining amount within 2 days`
+    } else{
+      modalTitle.value = `Early termination of Giveaway?`
+      modalContent.value = `The remaining amount will be returned to your wallet within 1 day.`
+    }
   } else {
     modalTitle.value = `Early termination of Giveaway?`
     modalContent.value = `The remaining amount will be returned to your wallet within 1 day.`
   }
+  
   modalVisible.value = true;
 };