nieyuge 2 anos atrás
pai
commit
ca7e3ecad9

+ 7 - 1
nuxt.config.js

@@ -50,7 +50,13 @@ export default {
         name: 'index',
         path: '/:id?',
         component: resolve(__dirname, 'pages/index.vue')
-      },{
+      },
+      {
+        name: 'luckdraw',
+        path: '/luckdraw/:id?',
+        component: resolve(__dirname, 'pages/luckdraw.vue')
+      },
+      {
         name: 'install',
         path: '/install',
         component: resolve(__dirname, 'pages/install.vue')

+ 643 - 0
pages/luckdraw.vue

@@ -0,0 +1,643 @@
+<template>
+    <div class="content">
+        <template v-if="isLoading">
+            <img
+                class="loading"
+                src="../static/svg/icon-loading.svg" />
+        </template>
+        <template v-else>
+            <template v-if="isMobile">
+                <!-- 手机端 -->
+                <div class="small">
+                    <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">USDT 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">
+                        <span class="t">🕒 18:23:53</span>
+                        <span class="w">🏆 3 WINNERS</span>
+                    </div>
+                    <div class="box">
+                        <img src="../static/subject/icon-box.png" />
+                    </div>
+                    <div class="area-cp-link">
+                        <div class="area-list">
+                            <div class="item">
+                                <div class="icon"><img :src=" require('../static/subject/01.svg') " /></div>
+                                <div class="font">Complete the tasks on tweet</div>
+                            </div>
+                            <div class="item">
+                                <div class="icon"><img :src=" require('../static/subject/02.svg') " /></div>
+                                <div class="font">Open link on PC to draw</div>
+                                <div class="pc"><img :src=" require('../static/subject/pc.svg') " /></div>
+                            </div>
+                        </div>
+                        <div class="area-content">
+                            {{ linkHref }}
+                        </div>
+                        <div class="area-btn">
+                            <div class="btn" :data-clipboard-text="linkHref" @click="copyLinkHandle">Copy Link</div>
+                        </div>
+                    </div>
+                    <div class="layer" v-show="layer_show">
+                        <div class="layer-box">
+                            <div class="layer-txt">Unable to copy, please enter the link manually</div>
+                            <div class="layer-btn" @click="layer_show = false">Done</div>
+                        </div>
+                    </div>
+                </div>
+                <!-- 手机端 -->
+            </template>
+            <template v-else>
+                <div class="logo">
+                    <img src="/img/icon-logo.png" alt />
+                </div>
+                <div class="show">
+                    <div class="center">
+                        <div class="giveaway" :class="{ bg: false }">
+                            <template v-if="false">
+                                <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">USDT 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">
+                                    <span class="t">🕒 18:23:53</span>
+                                    <span class="w">🏆 3 WINNERS</span>
+                                </div>
+                                <div class="box">
+                                    <img src="../static/subject/icon-box.png" />
+                                </div>
+                            </template>
+                            <template v-else>
+                                <div class="succTop">
+                                    <img :src=" require('../static/svg/icon-luck-complete.svg') " />
+                                    <p class="tips">This Draw is Complete</p>
+                                </div>
+                                <div class="succTitle">
+                                    <span>3/3 Winners</span>
+                                    <span>100/100 USDT</span>
+                                </div>
+                                <div class="luck-list" @scroll="handleScroll($event)">
+                                    <div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
+                                        <img v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
+                                        <img v-else src="/svg/icon-twitter.svg" alt />
+                                        <div class="luck-content">
+                                            <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">
+                                            <img :src="item.currencyIconPath" alt />
+                                            <div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
+                                        </div>
+                                        <div class="luck-king" v-if="item.maxAmount">
+                                            <img src="/svg/icon-king-hat.svg" alt />
+                                            <span>Luckiest Draw</span>
+                                        </div>
+                                    </div>
+                                </div>
+                            </template>
+                        </div>
+                        <div class="desc">
+                            <div class="title">Install DeNet Plugin<br/>to Draw Prizes</div>
+                            <div class="issue">DeNet will detect task situation to issue Giveaway</div>
+                            <img class="button" :src=" require('../static/img/icon-install-plugin.svg') " />
+                        </div>
+                    </div>
+                </div>
+            </template>
+        </template>
+    </div>
+</template>
+
+<script>
+import axios from 'axios'
+import Cookies from 'js-cookie'
+import { Toast } from 'vant';
+import { isBrowser } from '../utils/help.js'
+import FontAmount from '../components/FontAmount.vue'
+
+export default {
+    name: 'luckdraw',
+    components: {
+		FontAmount,
+	},
+    data() {
+        return {
+            detail: {
+                postId: '',
+                postBizData: {
+                    imagePath: '',
+                    postUserInfo: {},
+                    amountValue: '0',
+                }
+            },
+            luck_list: [],
+            layer_show: true,
+            isLoading: false,
+            isMobile: false,
+            isChrome: false,
+        }
+    },
+    mounted() {
+        this.checkBrowser()
+    },
+    methods: {
+        checkBrowser() {
+            this.linkHref = window.location.href;
+            this.isChrome = isBrowser() == 'chrome';
+			this.isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
+		},
+        copyLinkHandle() {
+        }
+    }
+}
+</script>
+
+<style lang="scss">
+html,
+body,
+#__nuxt,
+#__layout {
+	width: 100%;
+	height: 100%;
+	padding: 0;
+	margin: 0;
+}
+
+.content {
+    overflow: hidden;
+    width: 100%;
+    height: 100%;
+    background: #F5FAFF;
+    .loading {
+        position: absolute;
+        transform: translate(-50%, -50%);
+        top: 50%;
+        left: 50%;
+        margin: auto;
+        width: 40px;
+        border-radius: 50%;
+    }
+    .logo {
+        display: flex;
+        align-items: center;
+        height: 70px;
+        margin-left: 25px;
+        img {
+            width: 99px;
+            height: 32px;
+        }
+    }
+    .show {
+        display: flex;
+        align-items: center;
+        height: calc(100% - 70px);
+        .center {
+            display: flex;
+            margin: -50px auto 0;
+            justify-content: space-between;
+            width: 1000px;
+            .giveaway {
+                position: relative;
+                overflow: hidden;
+                width: 375px;
+                height: 500px;
+                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%);
+                }
+                .lottery {
+                    position: absolute;
+                    top: 0;
+                    right: 0;
+                    width: 110px;
+                    height: 94px;
+                }
+                .head {
+                    display: flex;
+                    height: 50px;
+                    align-items: center;
+                    img {
+                        width: 20px;
+                        height: 20px;
+                        border-radius: 50%;
+                        margin: 0 10px 0 15px;
+                        border: solid 2px #fff;
+                    }
+                    span {
+                        color: #fff;
+                        font-size: 13px;
+                        font-weight: 700;
+                        line-height: 16px;
+                        letter-spacing: 0.005em;
+                    }
+                }
+                .price {
+                    text-align: center;
+                    .usdt {
+                        margin: 10px 0;
+                        color: #FFFFFF;
+                        font-weight: bold;
+                        font-size: 16px;
+                        line-height: 20px;
+                        text-align: center;
+                        letter-spacing: 0.3px;
+                    }
+                    .money {
+                        display: flex;
+                        align-items: center;
+                        justify-content: center;
+                        img {
+                            width: 46px;
+                            height: 46px;
+                            margin-right: 15px;
+                            border-radius: 50%;
+                            border: solid 3px #fff;
+                        }
+                        span {
+                            color: #fff;
+                            font-size: 60px;
+                            font-weight: 800;
+                            line-height: 76px;
+                        }
+                    }
+                }
+                .time {
+                    display: flex;
+                    height: 30px;
+                    align-items: center;
+                    justify-content: center;
+                    font-weight: bold;
+                    font-size: 17px;
+                    line-height: 22px;
+                    text-align: center;
+                    .t {
+                        color: #fff;
+                        margin-right: 8px;
+                    }
+                    .w {
+                        color: #fcc74e;
+                        margin-left: 8px;
+                    }
+                }
+                .box {
+                    margin: auto;
+                    width: 200px;
+                    height: 200px;
+                    margin-top: 27px;
+                    img {
+                        width: 100%;
+                        height: 100%;
+                    }
+                }
+
+                .succTop {
+                    display: flex;
+                    align-items: center;
+                    flex-direction: column;
+                    justify-content: center;
+                    height: 150px;
+                    margin-bottom: 13px;
+                    background: #7D52FD;
+		            border-radius: 0 586px 586px/0 0 104px 104px;
+                    img {
+                        width: 62px;
+                        height: 62px;
+                    }
+                    .tips {
+                        color: #FFFFFF;
+                        font-size: 22px;
+                        font-weight: 800;
+                        line-height: 26px;
+                        margin-top: 15px;
+                    }
+                }
+                .succTitle {
+                    display: flex;
+                    justify-content: space-between;
+                    height: 28px;
+                    box-shadow: inset 0px -1px 0px #F2F2F2;
+                    span {
+                        margin: 0 16px;
+                        font-size: 12px;
+                        color: #B0B0B0;
+                    }
+                }
+                .luck-list {
+                    flex: 1;
+                    width: 100%;
+                    overflow-y: auto;
+                    .luck-item {
+                        display: flex;
+                        padding: 12px 0;
+                        margin: 0 16px;
+                        border-bottom: 1px solid #F2F2F2;
+                        justify-content: space-between;
+                        position: relative;
+                        img:first-child {
+                            border-radius: 50%;
+                        }
+                        .luck-king {
+                            position: absolute;
+                            top: 36px;
+                            right: 0px;
+                            display: flex;
+                            align-items: center;
+                            img {
+                                width: 22px;
+                                height: 19px;
+                                margin: 0;
+                            }
+                            span {
+                                font-weight: 500;
+                                font-size: 12px;
+                                line-height: 14px;
+                                letter-spacing: 0.3px;
+                                color: #f5b945;
+                            }
+                        }
+                        img {
+                            width: 42px;
+                            height: 42px;
+                            margin-right: 12px;
+                        }
+                        .luck-content {
+                            flex: auto;
+                            .luck-title {
+                                font-weight: 500;
+                                font-size: 16px;
+                                letter-spacing: 0.3px;
+                                color: #444444;
+                            }
+                            .luck-time {
+                                font-weight: 400;
+                                font-size: 12px;
+                                line-height: 14px;
+
+                                color: #9b9b9b;
+                            }
+                        }
+                        .luck-money {
+                            display: flex;
+                            height: 17px;
+                            align-items: center;
+                            img {
+                                width: 14px;
+                                height: 14px;
+                                margin-right: 6px;
+                            }
+                            .luck-money-txt {
+                                font-weight: 500;
+                                font-size: 14px;
+                                /* identical to box height */
+                                text-align: right;
+                                letter-spacing: 0.3px;
+                                color: #444444;
+                            }
+                        }
+                    }
+                    .luck-item:last-child {
+                        border: 0;
+                    }
+                }
+            }
+            .desc {
+                width: 520px;
+                .title {
+                    color: #2C2C2C;
+                    font-size: 36px;
+                    line-height: 40px;
+                    font-weight: 900;
+                    margin-top: 90px;
+                    margin-bottom: 20px;
+                }
+                .issue {
+                    font-size: 15px;
+                    color: #A4A4A4;
+                }
+                .button {
+                    height: 64px;
+                    margin-top: 30px;
+                }
+            }
+        }
+    }
+}
+
+.small {
+    width: 100%;
+    height: 100%;
+    position: relative;
+    background: linear-gradient(17.98deg, #3438FF 3.69%, #8B56FC 74.32%);
+    .lottery {
+        position: absolute;
+        top: 0;
+        right: 0;
+        width: 110px;
+        height: 94px;
+    }
+    .head {
+        display: flex;
+        height: 50px;
+        align-items: center;
+        img {
+            width: 20px;
+            height: 20px;
+            border-radius: 50%;
+            margin: 0 10px 0 15px;
+            border: solid 2px #fff;
+        }
+        span {
+            color: #fff;
+            font-size: 13px;
+            font-weight: 700;
+            line-height: 16px;
+            letter-spacing: 0.005em;
+        }
+    }
+    .price {
+        text-align: center;
+        .usdt {
+            margin: 10px 0;
+            color: #FFFFFF;
+            font-weight: bold;
+            font-size: 16px;
+            line-height: 20px;
+            text-align: center;
+            letter-spacing: 0.3px;
+        }
+        .money {
+            display: flex;
+            align-items: center;
+            justify-content: center;
+            img {
+                width: 46px;
+                height: 46px;
+                margin-right: 15px;
+                border-radius: 50%;
+                border: solid 3px #fff;
+            }
+            span {
+                color: #fff;
+                font-size: 60px;
+                font-weight: 800;
+                line-height: 76px;
+            }
+        }
+    }
+    .time {
+        display: flex;
+        height: 30px;
+        align-items: center;
+        justify-content: center;
+        font-weight: bold;
+        font-size: 17px;
+        line-height: 22px;
+        text-align: center;
+        .t {
+            color: #fff;
+            margin-right: 8px;
+        }
+        .w {
+            color: #fcc74e;
+            margin-left: 8px;
+        }
+    }
+    .box {
+        margin: auto;
+        width: 200px;
+        height: 200px;
+        margin-top: 27px;
+        img {
+            width: 100%;
+            height: 100%;
+        }
+    }
+    .area-cp-link {
+        position: absolute;
+        bottom: 0;
+		background: #fff;
+        overflow: hidden;
+		width: 100%;
+		flex-wrap: wrap;
+		height: 238px;
+		box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.1);
+		border-top-left-radius: 10px;
+		border-top-right-radius: 10px;
+
+        .area-list {
+            clear: both;
+            margin: 15px;
+            .item {
+                clear: both;
+                overflow: hidden;
+                margin: 7px 0;
+                font-size: 16px;
+                font-weight: 500;
+                .icon {
+                    float: left;
+                    margin-right: 8px;
+                    margin-top: -2px;
+                }
+                .font {
+                    float: left;
+                    margin-right: 8px;
+                }
+                .pc {
+                    float: left;
+                    margin-top: -2px;
+                }
+            }
+        }
+
+		.area-content {
+            margin: 0 15px;
+            color: #4B4B4B;
+			padding: 7px 10px;
+			font-size: 13px;
+            border-radius: 5px;
+            background: #F4F4F4;
+			word-break: break-all;
+		}
+
+		.area-btn {
+			flex: 1;
+			display: flex;
+			justify-content: center;
+
+			.btn {
+                margin: 15px 15px 0 15px;
+                display: inline-block;
+                width: 100%;
+				height: 47px;
+				font-size: 18px;
+                line-height: 34px;
+				color: #FFFFFF;
+				border-radius: 100px;
+				background: #389AFF;
+			}
+		}
+	}
+}
+
+.layer {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    top: 0;
+    left: 0;
+    background: rgba(0, 0, 0, .5);
+
+    .layer-box {
+        width: 300px;
+        height: 170px;
+        background: #FFFFFF;
+        border-radius: 11px;
+        opacity: 1;
+        position: absolute;
+        top: 250px;
+        left: 50%;
+        margin-left: -150px;
+
+        .layer-txt {
+            margin: 30px 0;
+            width: 100%;
+            padding: 0 27px;
+            font-weight: 600;
+            font-size: 18px;
+            text-align: center;
+        }
+
+        .layer-btn {
+            width: 190px;
+            height: 40px;
+            background: #389AFF;
+            border-radius: 100px;
+            margin: 0 auto;
+            text-align: center;
+            line-height: 40px;
+            color: #fff;
+            font-weight: 600;
+            font-size: 18px;
+        }
+    }
+}
+</style>

BIN
static/subject/icon-box.png


Diferenças do arquivo suprimidas por serem muito extensas
+ 6 - 0
static/svg/icon-luck-complete.svg


+ 11 - 0
static/svg/icon-luck-mark.svg

@@ -0,0 +1,11 @@
+<svg width="110" height="94" viewBox="0 0 110 94" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_19980_193811)">
+<rect x="19.9258" y="-27" width="152" height="31" transform="rotate(40 19.9258 -27)" fill="#FFBB55"/>
+<path d="M44.2663 18.332L39.6822 14.4856L45.6377 7.38815L43.4629 5.56327L35.8137 14.6792L42.5725 20.3505L44.2663 18.332ZM55.6641 15.5128C52.8512 13.1525 49.1759 13.4861 46.892 16.2079C44.6082 18.9296 44.9179 22.607 47.7308 24.9673C50.5437 27.3276 54.219 26.994 56.5028 24.2723C58.7867 21.5505 58.477 17.8731 55.6641 15.5128ZM53.9157 17.5965C55.4003 18.8422 55.5482 20.8082 54.2369 22.3709C52.9256 23.9336 50.9638 24.1294 49.4792 22.8837C47.9946 21.638 47.8467 19.672 49.158 18.1092C50.4693 16.5465 52.4311 16.3507 53.9157 17.5965ZM68.4067 26.4936L60.834 20.1394L59.1402 22.1579L61.8424 24.4253L55.887 31.5227L58.0618 33.3476L64.0172 26.2502L66.713 28.5122L68.4067 26.4936ZM76.6613 33.42L69.0885 27.0658L67.3948 29.0843L70.097 31.3517L64.1416 38.4491L66.3164 40.274L72.2718 33.1766L74.9675 35.4386L76.6613 33.42ZM78.8557 47.4559L74.0503 43.4236L75.449 41.7567L79.9484 45.5321L81.5875 43.5787L77.0881 39.8033L78.4103 38.2276L83.1897 42.2379L84.8343 40.278L77.8801 34.4428L70.2309 43.5587L77.2111 49.4158L78.8557 47.4559ZM86.5798 41.7427L78.9306 50.8586L81.1054 52.6835L83.9684 49.2715L84.2875 49.5392L83.8272 54.9673L86.4187 57.1419L86.7188 51.4684C88.5717 52.5793 90.3356 52.3284 91.5485 50.8829C93.0565 49.0858 92.7982 46.9605 90.5452 45.0701L86.5798 41.7427ZM88.8637 47.0212C89.632 47.6659 89.8756 48.3806 89.3347 49.0253C88.7883 49.6764 88.0497 49.5781 87.2683 48.9225L85.5037 47.4418L87.0991 45.5405L88.8637 47.0212ZM103.351 55.8157L100.903 53.7613L95.8108 55.6911L96.8205 50.3356L94.3006 48.2212L93.0494 56.7472L90.1154 60.2438L92.2967 62.0741L95.2417 58.5645L103.351 55.8157Z" fill="white"/>
+</g>
+<defs>
+<clipPath id="clip0_19980_193811">
+<rect width="110" height="94" fill="white"/>
+</clipPath>
+</defs>
+</svg>

Alguns arquivos não foram mostrados porque muitos arquivos mudaram nesse diff