|
@@ -1,56 +1,86 @@
|
|
|
+<!-- 发布器-预览卡片 -->
|
|
|
<template>
|
|
|
<div class="wrapper">
|
|
|
- <div class="select-btn-wrapper">
|
|
|
- <div class="title">Preview</div>
|
|
|
- <div
|
|
|
- class="select-btn"
|
|
|
- v-for="(item, index) in btnList"
|
|
|
- :key="index"
|
|
|
- :class="{'active': previewType == index}"
|
|
|
- @click="previewCard(item)">
|
|
|
- <div class="text">
|
|
|
- <img class="icon"
|
|
|
- :src="require('../../assets/svg/icon-radio-default.svg')"
|
|
|
- v-if="previewType != index ">
|
|
|
- <img class="icon"
|
|
|
- :src="require('../../assets/svg/icon-radio-active.svg')"
|
|
|
- v-else>{{ item.text }}</div>
|
|
|
- <div class="desc">{{ item.desc }}</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<div class="card-container">
|
|
|
- <img class="img-preview" :src="require('../../assets/svg/icon-preview.svg')">
|
|
|
- <div class="head">
|
|
|
- <img :src="userInfo.avatarUrl"
|
|
|
- class="avatar"/>
|
|
|
- <div class="article-wrapper">
|
|
|
- <div class="nickname">
|
|
|
- {{userInfo.name}}
|
|
|
+ <!-- 安装之后的卡片样式 -->
|
|
|
+ <div class="left">
|
|
|
+ <div class="tips">
|
|
|
+ <div class="title">
|
|
|
+ After
|
|
|
</div>
|
|
|
- <div class="name">
|
|
|
- @{{userInfo.nickName}}
|
|
|
+ the installs denet
|
|
|
+ </div>
|
|
|
+ <div class="head">
|
|
|
+ <img :src="userInfo.avatarUrl"
|
|
|
+ class="avatar"/>
|
|
|
+ <div class="article-wrapper">
|
|
|
+ <div class="nickname">
|
|
|
+ {{userInfo.name}}
|
|
|
+ </div>
|
|
|
+ <div class="name">
|
|
|
+ @{{userInfo.nickName}}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="after-cover-wrapper">
|
|
|
+ <custom-card-cover :data="{
|
|
|
+ totalCount: baseFormData.totalCount,
|
|
|
+ amountValue: baseFormData.amountValue * 100,
|
|
|
+ amountCurrencyCode: 'USD',
|
|
|
+ currencyIconUrl: require('../../assets/subject/icon-USD.png'),
|
|
|
+ userInfo: {
|
|
|
+ nickName: userInfo.name,
|
|
|
+ avatarUrl: userInfo.avatarUrl
|
|
|
+ }
|
|
|
+ }"></custom-card-cover>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div v-if="previewType == 1" class="after-cover-wrapper">
|
|
|
- <div class="cover-text">
|
|
|
+
|
|
|
+ <!-- 安装之前的卡片样式 -->
|
|
|
+ <div class="content-before">
|
|
|
+ <div class="tips">
|
|
|
+ <div class="title">
|
|
|
+ Before
|
|
|
+ </div>
|
|
|
+ the installs denet
|
|
|
+ </div>
|
|
|
+ <div class="head">
|
|
|
<img :src="userInfo.avatarUrl"
|
|
|
- class="avatar"/>
|
|
|
- Giveaways from: {{userInfo.name}}
|
|
|
+ class="avatar"/>
|
|
|
+ <div class="article-wrapper">
|
|
|
+ <div class="nickname">
|
|
|
+ {{userInfo.name}}
|
|
|
+ </div>
|
|
|
+ <div class="name">
|
|
|
+ @{{userInfo.nickName}}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <img class="content-after"
|
|
|
- :src="require('../../assets/img/img-red-pack-cover.png')" />
|
|
|
- </div>
|
|
|
- <div class="content-before" v-else>
|
|
|
<div class="card-wrapper">
|
|
|
- <img :src="require('../../assets/img/icon-red-pack-card.png')"
|
|
|
+ <img :src="require('../../assets/subject/img-card-cover-blue.png')"
|
|
|
class="card-cover"/>
|
|
|
- <div class="text-wrapper">
|
|
|
- <div class="amount">
|
|
|
- ${{baseFormData.amountValue}}
|
|
|
+ <div class="bottom-bar">
|
|
|
+ <div class="title">
|
|
|
+ DeNet.me
|
|
|
</div>
|
|
|
<div class="desc">
|
|
|
- to {{baseFormData.totalCount}} People , Good Luck !
|
|
|
+ 🎁 ${{baseFormData.amountValue}} GIVEAWAY
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="user-info">
|
|
|
+ <img :src="userInfo.avatarUrl"
|
|
|
+ class="avatar"/>{{userInfo.name}}
|
|
|
+ </div>
|
|
|
+ <div class="content-text">
|
|
|
+ <div class="title">
|
|
|
+ USD GIVEAWAY
|
|
|
+ </div>
|
|
|
+ <div class="center">
|
|
|
+ <img src="../../assets/subject/icon-USD.png" class="icon">
|
|
|
+ {{baseFormData.amountValue}}
|
|
|
+ </div>
|
|
|
+ <div class="desc">
|
|
|
+ {{baseFormData.totalCount}} WINNERS TO SHARE
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -60,18 +90,15 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { reactive, ref, defineProps, onMounted } from "vue";
|
|
|
+import { ref, defineProps, onMounted, nextTick } from "vue";
|
|
|
+
|
|
|
+import customCardCover from './custom-card-cover.vue'
|
|
|
+
|
|
|
import {getChromeStorage} from "../../uilts/chromeExtension"
|
|
|
import {getUser} from "../../http/publishApi"
|
|
|
|
|
|
-let previewType = ref(1);
|
|
|
let userInfo = ref({});
|
|
|
|
|
|
-let btnList = reactive([
|
|
|
- { text: "Before", desc: "the installs denet", value: 0, checked: false },
|
|
|
- { text: "After", desc: "the installs denet", value: 1, checked: true },
|
|
|
-]);
|
|
|
-
|
|
|
defineProps({
|
|
|
postData: {
|
|
|
type: Object,
|
|
@@ -91,10 +118,6 @@ defineProps({
|
|
|
}
|
|
|
})
|
|
|
|
|
|
-const previewCard = (params) => {
|
|
|
- previewType.value = params.value;
|
|
|
-};
|
|
|
-
|
|
|
const getUserInfo = (cb) => {
|
|
|
getChromeStorage('userInfo', (res) => {
|
|
|
if(res) {
|
|
@@ -119,10 +142,12 @@ const getUserName = (screenName) => {
|
|
|
|
|
|
onMounted(() => {
|
|
|
getUserInfo((res) => {
|
|
|
+ nextTick(() => {
|
|
|
+ })
|
|
|
if(res) {
|
|
|
getUserName(res.nickName);
|
|
|
}
|
|
|
- });
|
|
|
+ });
|
|
|
})
|
|
|
|
|
|
</script>
|
|
@@ -146,18 +171,10 @@ onMounted(() => {
|
|
|
width: 100%;
|
|
|
height: fit-content;
|
|
|
background: #ffffff;
|
|
|
- border: 1px solid #e6e6e6;
|
|
|
box-sizing: border-box;
|
|
|
border-radius: 20px;
|
|
|
- padding: 16px 16px 50px 16px;
|
|
|
- position: relative;
|
|
|
-
|
|
|
- .img-preview {
|
|
|
- position: absolute;
|
|
|
- right: 0;
|
|
|
- top: 0;
|
|
|
- z-index: 200;
|
|
|
- }
|
|
|
+ padding: 0 16px;
|
|
|
+ display: flex;
|
|
|
|
|
|
.head {
|
|
|
display: flex;
|
|
@@ -188,75 +205,139 @@ onMounted(() => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .left {
|
|
|
+ width: 430px;
|
|
|
+ }
|
|
|
|
|
|
.after-cover-wrapper {
|
|
|
position:relative;
|
|
|
- width:320px;
|
|
|
+ width:375px;
|
|
|
margin-left: 53px;
|
|
|
- margin-top: -15px;
|
|
|
- .cover-text {
|
|
|
+ margin-top: -10px;
|
|
|
+
|
|
|
+ .icon-gif {
|
|
|
position: absolute;
|
|
|
left: 50%;
|
|
|
- top: 40px;
|
|
|
+ bottom: 80px;
|
|
|
transform: translateX(-50%);
|
|
|
- z-index: 100;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- font-size: 16px;
|
|
|
- color: #FFF2D3;
|
|
|
- width: max-content;
|
|
|
-
|
|
|
- img {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- border: 2px solid #FFF4DB;
|
|
|
- box-sizing: border-box;
|
|
|
- border-radius: 50%;
|
|
|
- margin-right: 10px;
|
|
|
- }
|
|
|
+ width: 160px;
|
|
|
+ height: 190px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.content-after {
|
|
|
- width: 320px;
|
|
|
- height: 423px;
|
|
|
+ width: 350px;
|
|
|
border-radius: 16px;
|
|
|
display: block;
|
|
|
object-fit: contain;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
.content-before {
|
|
|
- margin-top: -10px;
|
|
|
- margin-left: 60px;
|
|
|
+ width: 550px;
|
|
|
+ margin-left: 40px;
|
|
|
.card-wrapper {
|
|
|
+ width: 491px;
|
|
|
+ border: 1px solid #D1D9DD;
|
|
|
background: #ffffff;
|
|
|
box-sizing: border-box;
|
|
|
- border-radius: 16px;
|
|
|
- width: 100%;
|
|
|
overflow: hidden;
|
|
|
position: relative;
|
|
|
- .text-wrapper {
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 16px;
|
|
|
+ margin-left: 60px;
|
|
|
+ margin-top: -10px;
|
|
|
+
|
|
|
+ .user-info {
|
|
|
position: absolute;
|
|
|
- top: 30px;
|
|
|
- left: 108px;
|
|
|
+ left: 15px;
|
|
|
+ top: 15px;
|
|
|
+ z-index: 100;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #FFF2D3;
|
|
|
+ width: max-content;
|
|
|
|
|
|
- .amount {
|
|
|
- font-weight: bolder;
|
|
|
- font-size: 40px;
|
|
|
- color: #FFEABC;
|
|
|
+ img {
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ border: 2px solid #FFF4DB;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 50%;
|
|
|
+ margin-right: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .content-text {
|
|
|
+ position: absolute;
|
|
|
+ top: 68px;
|
|
|
+ left: 35px;
|
|
|
+ .title {
|
|
|
+ font-weight: 800;
|
|
|
+ font-size: 16px;
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ .center {
|
|
|
+ padding: 12px 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-weight: 800;
|
|
|
+ font-size: 56px;
|
|
|
+ color: #fff;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ .icon {
|
|
|
+ width: 46px;
|
|
|
+ height: 46px;
|
|
|
+ margin-right: 10px;
|
|
|
+ border: 3px solid #fff;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
}
|
|
|
.desc {
|
|
|
- font-weight: 700;
|
|
|
- font-size: 12px;
|
|
|
- color: #F5CD77;
|
|
|
+ font-weight: 800;
|
|
|
+ font-size: 13px;
|
|
|
+ color: #ffffff;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
.card-cover {
|
|
|
width: 100%;
|
|
|
object-fit: contain;
|
|
|
}
|
|
|
+
|
|
|
+ .bottom-bar {
|
|
|
+ padding: 12px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ .title {
|
|
|
+ color: #566370;
|
|
|
+ font-weight: 400;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-bottom: 6px;
|
|
|
+ }
|
|
|
+ .desc {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 15px;
|
|
|
+ color: #101419;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .left, .content-before {
|
|
|
+ position: relative;
|
|
|
+ .tips {
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ background: #F4F4F4;
|
|
|
+ border-radius: 6px;
|
|
|
+ padding: 3px 10px;
|
|
|
+ font-size: 10px;
|
|
|
+ color: #4D4D4D;
|
|
|
+
|
|
|
+ .title {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #000;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|