|
@@ -1,3 +1,4 @@
|
|
|
+<!-- 红包玩法落地页 -->
|
|
|
<template>
|
|
|
<div class="content">
|
|
|
<template v-if="isLoading">
|
|
@@ -10,25 +11,45 @@
|
|
|
<!-- 手机端 -->
|
|
|
<div class="small" :class="{ bg: status === 'not-open' }">
|
|
|
<template v-if="status === 'not-open'">
|
|
|
- <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
|
|
|
- <div class="head">
|
|
|
- <img :src="detail.postBizData.postUserInfo.avatarUrl" />
|
|
|
- <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
|
|
|
- </div>
|
|
|
- <div class="price">
|
|
|
- <div class="usdt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
|
|
|
- <div class="money">
|
|
|
- <img :src="detail.postBizData.currencyIconPath" />
|
|
|
- <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
|
|
|
+ <template v-if="isMoneyPrize">
|
|
|
+ <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
|
|
|
+ <div class="head">
|
|
|
+ <img :src="detail.postBizData.postUserInfo.avatarUrl" />
|
|
|
+ <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="time">
|
|
|
- <img class="img" :src=" require('../static/svg/icon-time.svg') " />
|
|
|
- {{ validity || '00:00:00' }}
|
|
|
- </div>
|
|
|
- <div class="box">
|
|
|
- <img src="../static/subject/icon-box.png" />
|
|
|
- </div>
|
|
|
+ <div class="price">
|
|
|
+ <div class="usdt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
|
|
|
+ <div class="money">
|
|
|
+ <img :src="detail.postBizData.currencyIconPath" />
|
|
|
+ <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="time">
|
|
|
+ <img class="img" :src=" require('../static/svg/icon-time.svg') " />
|
|
|
+ {{ validity || '00:00:00' }}
|
|
|
+ </div>
|
|
|
+ <div class="box">
|
|
|
+ <img src="../static/subject/icon-box.png" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <custom-card-cover
|
|
|
+ :totalCount="detail.postBizData.totalCount"
|
|
|
+ :amountValue="detail.postBizData.amountValue"
|
|
|
+ :tokenSymbol="detail.postBizData.tokenSymbol"
|
|
|
+ :currencyIconUrl="detail.postBizData.iconPath"
|
|
|
+ :playType="2"
|
|
|
+ :validity="validity"
|
|
|
+ :userInfo="{
|
|
|
+ nickName: detail.postBizData.postUserInfo.nickName,
|
|
|
+ avatarUrl: detail.postBizData.postUserInfo.avatarUrl
|
|
|
+ }"
|
|
|
+ :rewardType="detail.postBizData.rewardType"
|
|
|
+ :customizedReward="detail.postBizData.customizedReward"
|
|
|
+ :showBottomInfo="false"
|
|
|
+ ></custom-card-cover>
|
|
|
+ </template>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div class="succTop">
|
|
@@ -42,7 +63,7 @@
|
|
|
<p class="expire">This Giveaways<br/>expired on {{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</p>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
- <p class="win">🎉 Awesome! You are Winner!</p>
|
|
|
+ <p class="win">🎉 Awesome! You Will Get</p>
|
|
|
<div class="win-money">
|
|
|
<img :src="detail.postBizData.currencyIconPath" />
|
|
|
<font-amount :fontSize="46" :amount="receiveAmount"></font-amount>
|
|
@@ -51,7 +72,7 @@
|
|
|
</div>
|
|
|
<div class="succTitle">
|
|
|
<span>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</span>
|
|
|
- <span>{{ detail.postBizData.receiveAmountValue }} / {{ detail.postBizData.amountValue || '' }} {{ detail.postBizData.currencySymbol || '' }}</span>
|
|
|
+ <span v-if="isMoneyPrize">{{ detail.postBizData.receiveAmountValue }} / {{ detail.postBizData.amountValue || '' }} {{ detail.postBizData.currencySymbol || '' }}</span>
|
|
|
</div>
|
|
|
<div class="luck-list" @scroll="handleScroll($event)">
|
|
|
<div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
|
|
@@ -64,11 +85,12 @@
|
|
|
<div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
|
|
|
<div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
|
|
|
</div>
|
|
|
- <div class="luck-money">
|
|
|
+ <div class="luck-money" v-if="isMoneyPrize">
|
|
|
<img :src="item.currencyIconPath" alt />
|
|
|
<div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
|
|
|
</div>
|
|
|
- <div class="luck-king" v-if="item.maxAmount">
|
|
|
+ <div class="luck-custom-prize" v-else>winner</div>
|
|
|
+ <div class="luck-king" v-if="isMoneyPrize && item.maxAmount">
|
|
|
<img src="/svg/icon-king-hat.svg" alt />
|
|
|
<span>Luckiest Draw</span>
|
|
|
</div>
|
|
@@ -101,35 +123,61 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <!-- 手机端 -->
|
|
|
</template>
|
|
|
+ <!-- PC端 -->
|
|
|
<template v-else>
|
|
|
<div class="logo">
|
|
|
<img src="/img/icon-logo.png" />
|
|
|
</div>
|
|
|
<div class="show">
|
|
|
<div class="center">
|
|
|
- <div class="giveaway" :class="{ bg: status === 'not-open' }">
|
|
|
+ <div class="head-in-custom" v-if="!isMoneyPrize">
|
|
|
+ <img :src="detail.postBizData.postUserInfo.avatarUrl" />
|
|
|
+ <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="giveaway" :class="{ bg: status === 'not-open', 'auto-height': !isMoneyPrize }">
|
|
|
+ <!-- 旧版 样式,后续更新时在 custom-card-cover 公共组件内维护-->
|
|
|
<template v-if="status === 'not-open'">
|
|
|
- <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
|
|
|
- <div class="head">
|
|
|
- <img :src="detail.postBizData.postUserInfo.avatarUrl" />
|
|
|
- <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
|
|
|
- </div>
|
|
|
- <div class="price">
|
|
|
- <div class="usdt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
|
|
|
- <div class="money">
|
|
|
- <img :src="detail.postBizData.currencyIconPath" />
|
|
|
- <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="time">
|
|
|
- <img class="img" :src=" require('../static/svg/icon-time.svg') " />
|
|
|
- {{ validity || '00:00:00' }}
|
|
|
- </div>
|
|
|
- <div class="box">
|
|
|
- <img src="../static/subject/icon-box.png" />
|
|
|
- </div>
|
|
|
+ <template v-if="isMoneyPrize">
|
|
|
+ <img class="lottery" :src=" require('../static/svg/icon-luck-mark.svg') " />
|
|
|
+ <div class="head">
|
|
|
+ <img :src="detail.postBizData.postUserInfo.avatarUrl" />
|
|
|
+ <span>{{ detail.postBizData.postUserInfo.nickName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="price">
|
|
|
+ <div class="usdt">{{ detail.postBizData.currencySymbol }} GIVEAWAY</div>
|
|
|
+ <div class="money">
|
|
|
+ <img :src="detail.postBizData.currencyIconPath" />
|
|
|
+ <font-amount :fontSize="60" :amount="detail.postBizData.amountValue"></font-amount>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="time">
|
|
|
+ <img class="img" :src=" require('../static/svg/icon-time.svg') " />
|
|
|
+ {{ validity || '00:00:00' }}
|
|
|
+ </div>
|
|
|
+ <div class="box">
|
|
|
+ <img src="../static/subject/icon-box.png" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <template v-else>
|
|
|
+ <custom-card-cover
|
|
|
+ :totalCount="detail.postBizData.totalCount"
|
|
|
+ :amountValue="detail.postBizData.amountValue"
|
|
|
+ :tokenSymbol="detail.postBizData.tokenSymbol"
|
|
|
+ :currencyIconUrl="detail.postBizData.iconPath"
|
|
|
+ :playType="2"
|
|
|
+ :validity="validity"
|
|
|
+ :userInfo="{
|
|
|
+ nickName: detail.postBizData.postUserInfo.nickName,
|
|
|
+ avatarUrl: detail.postBizData.postUserInfo.avatarUrl
|
|
|
+ }"
|
|
|
+ :rewardType="detail.postBizData.rewardType"
|
|
|
+ :customizedReward="detail.postBizData.customizedReward"
|
|
|
+ :showBottomInfo="true"
|
|
|
+ ></custom-card-cover>
|
|
|
+ </template>
|
|
|
+
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<div class="succTop">
|
|
@@ -152,7 +200,7 @@
|
|
|
</div>
|
|
|
<div class="succTitle">
|
|
|
<span>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</span>
|
|
|
- <span>{{ detail.postBizData.receiveAmountValue }} / {{ detail.postBizData.amountValue || '' }} {{ detail.postBizData.currencySymbol || '' }}</span>
|
|
|
+ <span v-if="isMoneyPrize">{{ detail.postBizData.receiveAmountValue }} / {{ detail.postBizData.amountValue || '' }} {{ detail.postBizData.currencySymbol || '' }}</span>
|
|
|
</div>
|
|
|
<div class="luck-list" @scroll="handleScroll($event)">
|
|
|
<div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
|
|
@@ -165,11 +213,12 @@
|
|
|
<div class="luck-title">{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}</div>
|
|
|
<div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
|
|
|
</div>
|
|
|
- <div class="luck-money">
|
|
|
+ <div class="luck-money" v-if="isMoneyPrize">
|
|
|
<img :src="item.currencyIconPath" alt />
|
|
|
<div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
|
|
|
</div>
|
|
|
- <div class="luck-king" v-if="item.maxAmount">
|
|
|
+ <div class="luck-custom-prize" v-else>winner</div>
|
|
|
+ <div class="luck-king" v-if="isMoneyPrize && item.maxAmount">
|
|
|
<img src="/svg/icon-king-hat.svg" alt />
|
|
|
<span>Luckiest Draw</span>
|
|
|
</div>
|
|
@@ -207,6 +256,8 @@ import Cookies from 'js-cookie'
|
|
|
import { Toast } from 'vant';
|
|
|
import { isBrowser, appType, appVersionCode, formatSecondsAsDaysOrTime } from '../utils/help.js'
|
|
|
import FontAmount from '../components/FontAmount.vue'
|
|
|
+import CustomCardCover from '../components/CustomCardCover.vue'
|
|
|
+import { RewardType } from '../types';
|
|
|
|
|
|
var moment = require('moment');
|
|
|
var ClipboardJS = require('clipboard')
|
|
@@ -227,7 +278,7 @@ const baseURL = api[process.env.NUXT_ENV.MODE]
|
|
|
export default {
|
|
|
name: 'luckdraw',
|
|
|
components: {
|
|
|
- FontAmount,
|
|
|
+ FontAmount,CustomCardCover
|
|
|
},
|
|
|
head() {
|
|
|
return {
|
|
@@ -235,7 +286,7 @@ export default {
|
|
|
title: this.title,
|
|
|
appVersionCode: 3,
|
|
|
meta: [
|
|
|
- // facebook
|
|
|
+ // facebook
|
|
|
{
|
|
|
name: 'og:url',
|
|
|
content: this.jumpUrl + 'luckdraw/' + this.detail.postId
|
|
@@ -295,7 +346,13 @@ export default {
|
|
|
jumpUrl: jumpUrl,
|
|
|
metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
|
|
|
}
|
|
|
- },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 货币类型的奖品
|
|
|
+ isMoneyPrize() {
|
|
|
+ return this.detail.postBizData.rewardType === RewardType.money;
|
|
|
+ }
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.getConfig()
|
|
|
this.setCookieMid()
|
|
@@ -338,8 +395,6 @@ export default {
|
|
|
postUserInfo: {}
|
|
|
}
|
|
|
}
|
|
|
- console.log('detail', data.data)
|
|
|
-
|
|
|
return {
|
|
|
detail: data.data,
|
|
|
}
|
|
@@ -505,7 +560,8 @@ export default {
|
|
|
postId: this.detail.postId
|
|
|
}
|
|
|
})
|
|
|
- if (data.code == 0) {
|
|
|
+ if (data.code == 0) {
|
|
|
+ console.log(data.data)
|
|
|
this.detail.postBizData = JSON.parse(data.data.postBizData)
|
|
|
if (fn) fn();
|
|
|
}
|
|
@@ -550,7 +606,7 @@ body,
|
|
|
overflow: hidden;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
- background: #F5FAFF;
|
|
|
+ background: #fff;
|
|
|
.loading {
|
|
|
position: absolute;
|
|
|
transform: translate(-50%, -50%);
|
|
@@ -579,6 +635,26 @@ body,
|
|
|
margin: -50px auto 0;
|
|
|
justify-content: space-between;
|
|
|
width: 1000px;
|
|
|
+ position: relative;
|
|
|
+ .head-in-custom {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 100%;
|
|
|
+ left: 0;
|
|
|
+ background: #fff;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 15px;
|
|
|
+ color: #000;
|
|
|
+ height: 54px;
|
|
|
+ img {
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
.giveaway {
|
|
|
position: relative;
|
|
|
overflow: hidden;
|
|
@@ -587,9 +663,16 @@ body,
|
|
|
border-radius: 20px;
|
|
|
background-color: #fff;
|
|
|
box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.1);
|
|
|
+
|
|
|
&.bg {
|
|
|
background: linear-gradient(17.98deg, #3438FF 3.69%, #8B56FC 74.32%);
|
|
|
}
|
|
|
+ &.auto-height {
|
|
|
+ height: auto;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
.lottery {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
@@ -985,6 +1068,12 @@ body,
|
|
|
color: #444444;
|
|
|
}
|
|
|
}
|
|
|
+ .luck-custom-prize {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 14px;
|
|
|
+ letter-spacing: 0.3px;
|
|
|
+ color: #F5B945;
|
|
|
+ }
|
|
|
}
|
|
|
.luck-item:last-child {
|
|
|
border: 0;
|