jihuaqiang 2 jaren geleden
bovenliggende
commit
5a0cec46e2
3 gewijzigde bestanden met toevoegingen van 374 en 756 verwijderingen
  1. 6 5
      .prettierrc.json
  2. 135 518
      pages/luckdraw.vue
  3. 233 233
      pages/nft/index.vue

+ 6 - 5
.prettierrc.json

@@ -1,7 +1,8 @@
 {
-  "tabWidth": 4,
-  "useTabs": true,
-  "semi": true,
-  "singleQuote": true,
-  "bracketSpacing": true
+	"printWidth": 300,
+  	"tabWidth": 4,
+  	"useTabs": true,
+  	"semi": true,
+  	"singleQuote": true,
+  	"bracketSpacing": true
 }

+ 135 - 518
pages/luckdraw.vue

@@ -11,41 +11,19 @@
 					class="small"
 					:class="{
 						bg: status === 'not-open',
-						custom:
-							detail.postBizData.posterType === 2 &&
-							detail.postBizData.customPosterInstalled,
+						custom: detail.postBizData.posterType === 2 && detail.postBizData.customPosterInstalled,
 					}"
 				>
 					<template v-if="status === 'not-open'">
-						<template
-							v-if="
-								detail.postBizData.posterType === 2 &&
-								detail.postBizData.customPosterInstalled
-							"
-						>
-							<img
-								class="customImg"
-								:src="detail.postBizData.customPosterInstalled"
-							/>
+						<template v-if="detail.postBizData.posterType === 2 && detail.postBizData.customPosterInstalled">
+							<img class="customImg" :src="detail.postBizData.customPosterInstalled" />
 						</template>
 						<template v-else>
 							<template v-if="isMoneyPrize">
-								<img
-									class="lottery"
-									:src="
-										require('../static/svg/icon-luck-mark.svg')
-									"
-								/>
+								<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>
+									<img :src="detail.postBizData.postUserInfo.avatarUrl" />
+									<span>{{ detail.postBizData.postUserInfo.nickName }}</span>
 								</div>
 								<div class="price">
 									<div class="usdt">
@@ -53,28 +31,12 @@
 										GIVEAWAY
 									</div>
 									<div class="money">
-										<img
-											:src="
-												detail.postBizData
-													.currencyIconPath
-											"
-										/>
-										<font-amount
-											:fontSize="60"
-											:amount="
-												detail.postBizData.amountValue
-											"
-										>
-										</font-amount>
+										<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')
-										"
-									/>
+									<img class="img" :src="require('../static/svg/icon-time.svg')" />
 									{{ validity || '00:00:00' }}
 								</div>
 								<div class="box">
@@ -85,29 +47,17 @@
 							<template v-else>
 								<custom-card-cover
 									:totalCount="detail.postBizData.totalCount"
-									:amountValue="
-										detail.postBizData.amountValue
-									"
-									:tokenSymbol="
-										detail.postBizData.tokenSymbol
-									"
-									:currencyIconUrl="
-										detail.postBizData.iconPath
-									"
+									: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,
+										nickName: detail.postBizData.postUserInfo.nickName,
+										avatarUrl: detail.postBizData.postUserInfo.avatarUrl,
 									}"
 									:rewardType="detail.postBizData.rewardType"
-									:customizedReward="
-										detail.postBizData.customizedReward
-									"
+									:customizedReward="detail.postBizData.customizedReward"
 									:showBottomInfo="false"
 								>
 								</custom-card-cover>
@@ -117,12 +67,7 @@
 					<template v-else>
 						<div class="succTop">
 							<template v-if="status === 'opened'">
-								<img
-									class="img"
-									:src="
-										require('../static/svg/icon-luck-rabbit.svg')
-									"
-								/>
+								<img class="img" :src="require('../static/svg/icon-luck-rabbit.svg')" />
 								<p class="tips">Good Luck Next Time!</p>
 							</template>
 							<template v-else-if="status === 'expire'">
@@ -130,87 +75,38 @@
                                 <p class="tips">This Draw is Complete</p> -->
 								<p class="expire">
 									This Giveaways<br />expired on
-									{{
-										formatTime(
-											detail.postBizData.endTimestamp,
-											'MM-DD'
-										)
-									}}
+									{{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}
 								</p>
 							</template>
 							<template v-else>
 								<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>
+									<img :src="detail.postBizData.currencyIconPath" />
+									<font-amount :fontSize="46" :amount="receiveAmount"></font-amount>
 								</div>
 							</template>
 						</div>
 						<div class="succTitle">
-							<span
-								>{{ detail.postBizData.receiveCount || 0 }}/{{
-									detail.postBizData.totalCount || 0
-								}}
-								Winners</span
-							>
+							<span>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</span>
 							<span v-if="isMoneyPrize"
 								>{{ detail.postBizData.receiveAmountValue }} /
 								{{ detail.postBizData.amountValue || '' }}
-								{{
-									detail.postBizData.currencySymbol || ''
-								}}</span
+								{{ 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"
-							>
+							<div class="luck-item" v-for="(item, i) in luck_list" v-bind:key="i">
 								<div class="userLogo">
-									<img
-										class="medal"
-										v-if="i < 2"
-										:src="
-											require('../static/svg/icon-medal-' +
-												i +
-												'.svg')
-										"
-									/>
-									<img
-										class="header"
-										v-if="item.simpleUserInfoVO.avatarUrl"
-										:src="item.simpleUserInfoVO.avatarUrl"
-										alt
-									/>
-									<img
-										class="header"
-										v-else
-										src="/svg/icon-twitter.svg"
-										alt
-									/>
+									<img class="medal" v-if="i < 2" :src="require('../static/svg/icon-medal-' + i + '.svg')" />
+									<img class="header" v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
+									<img class="header" v-else src="/svg/icon-twitter.svg" alt />
 								</div>
 								<div class="luck-content">
 									<div class="luck-title">
-										{{
-											item.simpleUserInfoVO.nickName ||
-											'Twitter User'
-										}}
+										{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}
 									</div>
 									<div class="luck-time">
-										{{
-											formatTime(
-												item.receiveTimestamp,
-												'MM-DD HH:mm'
-											)
-										}}
+										{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}
 									</div>
 								</div>
 								<div class="luck-money" v-if="isMoneyPrize">
@@ -219,13 +115,8 @@
 										{{ item.amountValue || 0 }}
 									</div>
 								</div>
-								<div class="luck-custom-prize" v-else>
-									winner
-								</div>
-								<div
-									class="luck-king"
-									v-if="isMoneyPrize && 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>
@@ -236,31 +127,17 @@
 						<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
+									<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')
-										"
-									/>
+									<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')
-										"
-									/>
+									<img :src="require('../static/subject/pc.svg')" />
 								</div>
 							</div>
 						</div>
@@ -268,23 +145,13 @@
 							{{ linkHref }}
 						</div>
 						<div class="area-btn">
-							<div
-								class="btn"
-								:data-clipboard-text="linkHref"
-								@click="copyLinkHandle"
-							>
-								Copy Link
-							</div>
+							<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 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>
@@ -297,30 +164,19 @@
 				<div class="show">
 					<div class="center">
 						<div class="head-in-custom" v-if="!isMoneyPrize">
-							<img
-								:src="detail.postBizData.postUserInfo.avatarUrl"
-							/>
-							<span>{{
-								detail.postBizData.postUserInfo.nickName
-							}}</span>
+							<img :src="detail.postBizData.postUserInfo.avatarUrl" />
+							<span>{{ detail.postBizData.postUserInfo.nickName }}</span>
 						</div>
 						<div
 							class="giveaway"
 							:class="{
 								bg: status === 'not-open',
-								custom:
-									detail.postBizData.posterType === 2 &&
-									detail.postBizData.customPosterInstalled,
+								custom: detail.postBizData.posterType === 2 && detail.postBizData.customPosterInstalled,
 								'auto-height': !isMoneyPrize,
 							}"
 						>
 							<div v-if="status === 'not-open'">
-								<template
-									v-if="
-										detail.postBizData.posterType === 2 &&
-										detail.postBizData.customPosterInstalled
-									"
-								>
+								<template v-if="detail.postBizData.posterType === 2 && detail.postBizData.customPosterInstalled">
 									<!-- <img class="customImg" :src="detail.postBizData.customPosterInstalled" />
                                   <div class="customBottom">
                                     <div class="theme">
@@ -335,39 +191,20 @@
                                     </div>
                                   </div> -->
 									<custom-card-cover
-										:totalCount="
-											detail.postBizData.totalCount
-										"
-										:amountValue="
-											detail.postBizData.amountValue
-										"
-										:tokenSymbol="
-											detail.postBizData.tokenSymbol
-										"
-										:currencyIconUrl="
-											detail.postBizData.iconPath
-										"
+										:totalCount="detail.postBizData.totalCount"
+										:amountValue="detail.postBizData.amountValue"
+										:tokenSymbol="detail.postBizData.tokenSymbol"
+										:currencyIconUrl="detail.postBizData.iconPath"
 										:playType="2"
 										:posterType="2"
-										:customPosterInstalled="
-											detail.postBizData
-												.customPosterInstalled
-										"
+										:customPosterInstalled="detail.postBizData.customPosterInstalled"
 										:validity="validity"
 										:userInfo="{
-											nickName:
-												detail.postBizData.postUserInfo
-													.nickName,
-											avatarUrl:
-												detail.postBizData.postUserInfo
-													.avatarUrl,
+											nickName: detail.postBizData.postUserInfo.nickName,
+											avatarUrl: detail.postBizData.postUserInfo.avatarUrl,
 										}"
-										:rewardType="
-											detail.postBizData.rewardType
-										"
-										:customizedReward="
-											detail.postBizData.customizedReward
-										"
+										:rewardType="detail.postBizData.rewardType"
+										:customizedReward="detail.postBizData.customizedReward"
 										:showBottomInfo="true"
 									>
 									</custom-card-cover>
@@ -375,96 +212,44 @@
 								<template v-else>
 									<!-- 旧版 样式,后续更新时在 custom-card-cover 公共组件内维护-->
 									<template v-if="isMoneyPrize">
-										<img
-											class="lottery"
-											:src="
-												require('../static/svg/icon-luck-mark.svg')
-											"
-										/>
+										<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>
+											<img :src="detail.postBizData.postUserInfo.avatarUrl" />
+											<span>{{ detail.postBizData.postUserInfo.nickName }}</span>
 										</div>
 										<div class="price">
 											<div class="usdt">
-												{{
-													detail.postBizData
-														.currencySymbol
-												}}
+												{{ detail.postBizData.currencySymbol }}
 												GIVEAWAY
 											</div>
 											<div class="money">
-												<img
-													:src="
-														detail.postBizData
-															.currencyIconPath
-													"
-												/>
-												<font-amount
-													:fontSize="60"
-													:amount="
-														detail.postBizData
-															.amountValue
-													"
-												>
-												</font-amount>
+												<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')
-												"
-											/>
+											<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"
-											/>
+											<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
-											"
+											: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,
+												nickName: detail.postBizData.postUserInfo.nickName,
+												avatarUrl: detail.postBizData.postUserInfo.avatarUrl,
 											}"
-											:rewardType="
-												detail.postBizData.rewardType
-											"
-											:customizedReward="
-												detail.postBizData
-													.customizedReward
-											"
+											:rewardType="detail.postBizData.rewardType"
+											:customizedReward="detail.postBizData.customizedReward"
 											:showBottomInfo="true"
 										></custom-card-cover>
 									</template>
@@ -473,12 +258,7 @@
 							<template v-else>
 								<div class="succTop">
 									<template v-if="status === 'opened'">
-										<img
-											class="img"
-											:src="
-												require('../static/svg/icon-luck-rabbit.svg')
-											"
-										/>
+										<img class="img" :src="require('../static/svg/icon-luck-rabbit.svg')" />
 										<p class="tips">Good Luck Next Time!</p>
 									</template>
 									<template v-else-if="status === 'expire'">
@@ -486,138 +266,50 @@
                                         <p class="tips">This Draw is Complete</p> -->
 										<p class="expire">
 											This Giveaways<br />expired on
-											{{
-												formatTime(
-													detail.postBizData
-														.endTimestamp,
-													'MM-DD'
-												)
-											}}
+											{{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}
 										</p>
 									</template>
 									<template v-else>
-										<p class="win">
-											🎉 Awesome! You are Winner!
-										</p>
+										<p class="win">🎉 Awesome! You are Winner!</p>
 										<div class="win-money">
-											<img
-												:src="
-													detail.postBizData
-														.currencyIconPath
-												"
-											/>
-											<font-amount
-												:fontSize="46"
-												:amount="receiveAmount"
-											></font-amount>
+											<img :src="detail.postBizData.currencyIconPath" />
+											<font-amount :fontSize="46" :amount="receiveAmount"></font-amount>
 										</div>
 									</template>
 								</div>
 								<div class="succTitle">
-									<span
-										>{{
-											detail.postBizData.receiveCount ||
-											0
-										}}/{{
-											detail.postBizData.totalCount || 0
-										}}
-										Winners</span
-									>
+									<span>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</span>
 									<span v-if="isMoneyPrize"
-										>{{
-											detail.postBizData
-												.receiveAmountValue
-										}}
+										>{{ detail.postBizData.receiveAmountValue }}
 										/
-										{{
-											detail.postBizData.amountValue || ''
-										}}
-										{{
-											detail.postBizData.currencySymbol ||
-											''
-										}}</span
+										{{ 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"
-									>
+								<div class="luck-list" @scroll="handleScroll($event)">
+									<div class="luck-item" v-for="(item, i) in luck_list" v-bind:key="i">
 										<div class="userLogo">
-											<img
-												class="medal"
-												v-if="i < 2"
-												:src="
-													require('../static/svg/icon-medal-' +
-														i +
-														'.svg')
-												"
-											/>
-											<img
-												class="header"
-												v-if="
-													item.simpleUserInfoVO
-														.avatarUrl
-												"
-												:src="
-													item.simpleUserInfoVO
-														.avatarUrl
-												"
-												alt
-											/>
-											<img
-												class="header"
-												v-else
-												src="/svg/icon-twitter.svg"
-												alt
-											/>
+											<img class="medal" v-if="i < 2" :src="require('../static/svg/icon-medal-' + i + '.svg')" />
+											<img class="header" v-if="item.simpleUserInfoVO.avatarUrl" :src="item.simpleUserInfoVO.avatarUrl" alt />
+											<img class="header" v-else src="/svg/icon-twitter.svg" alt />
 										</div>
 										<div class="luck-content">
 											<div class="luck-title">
-												{{
-													item.simpleUserInfoVO
-														.nickName ||
-													'Twitter User'
-												}}
+												{{ item.simpleUserInfoVO.nickName || 'Twitter User' }}
 											</div>
 											<div class="luck-time">
-												{{
-													formatTime(
-														item.receiveTimestamp,
-														'MM-DD HH:mm'
-													)
-												}}
+												{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}
 											</div>
 										</div>
-										<div
-											class="luck-money"
-											v-if="isMoneyPrize"
-										>
-											<img
-												:src="item.currencyIconPath"
-												alt
-											/>
+										<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-custom-prize" v-else>
-											winner
-										</div>
-										<div
-											class="luck-king"
-											v-if="
-												isMoneyPrize && item.maxAmount
-											"
-										>
-											<img
-												src="/svg/icon-king-hat.svg"
-												alt
-											/>
+										<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>
 									</div>
@@ -627,39 +319,18 @@
 						<div class="desc">
 							<template v-if="isChrome">
 								<template v-if="status === 'not-open'">
-									<div class="title">
-										Install DeNet Plugin<br />to Draw Prizes
-									</div>
-									<div class="issue">
-										DeNet will detect task situation to
-										issue Giveaway
-									</div>
+									<div class="title">Install DeNet Plugin<br />to Draw Prizes</div>
+									<div class="issue">DeNet will detect task situation to issue Giveaway</div>
 								</template>
 								<template v-else>
-									<div class="title">
-										Install the Denet plugin<br />to not
-										miss the next draw
-									</div>
+									<div class="title">Install the Denet plugin<br />to not miss the next draw</div>
 								</template>
-								<img
-									class="button"
-									@click="installExtension"
-									src="../static/svg/icon-install-nft-plugin.svg"
-								/>
+								<img class="button" @click="installExtension" src="../static/svg/icon-install-nft-plugin.svg" />
 							</template>
 							<template v-else>
-								<div class="title">
-									Get Giveaway<br />with chrome
-								</div>
-								<div class="issue">
-									Only supports getting Giveaways through
-									chrome
-								</div>
-								<img
-									class="button"
-									@click="clickOpenChrome"
-									src="../static/svg/icon-install-nft-chrome.svg"
-								/>
+								<div class="title">Get Giveaway<br />with chrome</div>
+								<div class="issue">Only supports getting Giveaways through chrome</div>
+								<img class="button" @click="clickOpenChrome" src="../static/svg/icon-install-nft-chrome.svg" />
 							</template>
 						</div>
 					</div>
@@ -673,12 +344,7 @@
 import axios from 'axios';
 import Cookies from 'js-cookie';
 import { Toast } from 'vant';
-import {
-	isBrowser,
-	appType,
-	appVersionCode,
-	formatSecondsAsDaysOrTime,
-} from '../utils/help.js';
+import { isBrowser, appType, appVersionCode, formatSecondsAsDaysOrTime } from '../utils/help.js';
 import FontAmount from '../components/FontAmount.vue';
 import CustomCardCover from '../components/CustomCardCover.vue';
 import Report from '../log-center/log';
@@ -723,10 +389,7 @@ export default {
 				},
 				{
 					name: 'og:image',
-					content:
-						this.detail.postBizData.imagePath ||
-						this.detail.postBizData.customPosterUninstalled ||
-						'',
+					content: this.detail.postBizData.imagePath || this.detail.postBizData.customPosterUninstalled || '',
 				},
 				// twitter
 				{
@@ -743,10 +406,7 @@ export default {
 				},
 				{
 					name: 'twitter:image',
-					content:
-						this.detail.postBizData.imagePath ||
-						this.detail.postBizData.customPosterUninstalled ||
-						'',
+					content: this.detail.postBizData.imagePath || this.detail.postBizData.customPosterUninstalled || '',
 				},
 			],
 		};
@@ -811,14 +471,11 @@ export default {
 			baseInfo: {
 				appVersionCode: appVersionCode,
 				mid: (function () {
-					return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
-						/[xy]/g,
-						function (c) {
-							var r = (Math.random() * 16) | 0,
-								v = c == 'x' ? r : (r & 0x3) | 0x8;
-							return v.toString(16);
-						}
-					);
+					return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+						var r = (Math.random() * 16) | 0,
+							v = c == 'x' ? r : (r & 0x3) | 0x8;
+						return v.toString(16);
+					});
 				})(),
 			},
 			params: {
@@ -826,11 +483,7 @@ export default {
 			},
 		});
 		if (data.code == 0) {
-			if (
-				data.data &&
-				data.data.postBizData &&
-				typeof data.data.postBizData == 'string'
-			) {
+			if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
 				data.data.postBizData = JSON.parse(data.data.postBizData);
 			}
 			if (data.data.postBizData === null) {
@@ -840,16 +493,8 @@ export default {
 			}
 			return {
 				detail: data.data,
-				customCover:
-					data.data.postBizData &&
-					data.data.postBizData.posterType == 2
-						? 1
-						: 0,
-				customGiveaway:
-					data.data.postBizData &&
-					data.data.postBizData.rewardType == 2
-						? 1
-						: 0,
+				customCover: data.data.postBizData && data.data.postBizData.posterType == 2 ? 1 : 0,
+				customGiveaway: data.data.postBizData && data.data.postBizData.rewardType == 2 ? 1 : 0,
 			};
 		}
 	},
@@ -857,9 +502,7 @@ export default {
 		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
-			);
+			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);
 			if (!this.isChrome) {
 				this.status = 'no-chrome';
 			} else {
@@ -871,16 +514,13 @@ export default {
 			}, 500);
 		},
 		async getConfig() {
-			let { data } = await axios.post(
-				`${baseURL}/denet/base/config/getFrontConfig`,
-				{
-					baseInfo: {
-						appVersionCode: appVersionCode,
-						mid: this.mid,
-					},
-					params: {},
-				}
-			);
+			let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
+				baseInfo: {
+					appVersionCode: appVersionCode,
+					mid: this.mid,
+				},
+				params: {},
+			});
 			if (data.code == 0) {
 				this.config = data.data;
 			}
@@ -897,14 +537,11 @@ export default {
 			}
 		},
 		guid() {
-			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
-				/[xy]/g,
-				function (c) {
-					var r = (Math.random() * 16) | 0,
-						v = c == 'x' ? r : (r & 0x3) | 0x8;
-					return v.toString(16);
-				}
-			);
+			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
+				var r = (Math.random() * 16) | 0,
+					v = c == 'x' ? r : (r & 0x3) | 0x8;
+				return v.toString(16);
+			});
 		},
 		clickOpenChrome() {
 			window.open('https://www.google.com/chrome');
@@ -934,8 +571,7 @@ export default {
 			});
 		},
 		installExtension() {
-			let { extensionsInstallChannel, extensionsInstallUrl } =
-				this.config;
+			let { extensionsInstallChannel, extensionsInstallUrl } = this.config;
 			let extParams = this.isMobile ? {} : { status: this.reportStatus };
 
 			Report.reportLog({
@@ -977,8 +613,7 @@ export default {
 		setPickupInfo() {
 			let pickupInfo = {
 				srcContentId: this.detail.srcContentId || '',
-				postNickName:
-					this.detail.postBizData.postUserInfo.nickName || '',
+				postNickName: this.detail.postBizData.postUserInfo.nickName || '',
 				createTime: Date.now(),
 				jump_type: 'luck_draw',
 			};
@@ -1020,15 +655,12 @@ export default {
 			// 如果 我领取过了
 			// taskFinishStatus  任务完成状态(0:未完成,1:已完成,2:已过期)
 			if (this.detail.postBizData.myReceived) {
-				this.receiveAmount =
-					this.detail.postBizData.myReceived.amountValue || 0;
+				this.receiveAmount = this.detail.postBizData.myReceived.amountValue || 0;
 				// 如果 任务完成状态 = 未完成
 				if (this.detail.postBizData.myReceived.taskFinishStatus == 0) {
 					// 显示任务未完成页面
 					this.status = `opened`;
-				} else if (
-					this.detail.postBizData.myReceived.taskFinishStatus == 1
-				) {
+				} else if (this.detail.postBizData.myReceived.taskFinishStatus == 1) {
 					//如果 任务完成状态 = 已经完成
 					if (this.receiveAmount == 0) {
 						// 领取到空红包
@@ -1092,34 +724,23 @@ export default {
 			});
 			if (data.code == 0) {
 				this.detail.postBizData = JSON.parse(data.data.postBizData);
-				this.customCover =
-					this.detail.postBizData &&
-					this.detail.postBizData.posterType == 2
-						? 1
-						: 0;
-				this.customGiveaway =
-					this.detail.postBizData &&
-					this.detail.postBizData.rewardType == 2
-						? 1
-						: 0;
+				this.customCover = this.detail.postBizData && this.detail.postBizData.posterType == 2 ? 1 : 0;
+				this.customGiveaway = this.detail.postBizData && this.detail.postBizData.rewardType == 2 ? 1 : 0;
 				if (fn) fn();
 			}
 		},
 		async getReceivedList() {
-			let { data } = await axios.post(
-				`${baseURL}/denet/post/luckdrop/getReceivedList`,
-				{
-					baseInfo: {
-						appVersionCode: appVersionCode,
-						mid: this.mid,
-					},
-					params: {
-						pageNum: this.page_index,
-						pageSize: this.page_size,
-						postId: this.detail.postId || '',
-					},
-				}
-			);
+			let { data } = await axios.post(`${baseURL}/denet/post/luckdrop/getReceivedList`, {
+				baseInfo: {
+					appVersionCode: appVersionCode,
+					mid: this.mid,
+				},
+				params: {
+					pageNum: this.page_index,
+					pageSize: this.page_size,
+					postId: this.detail.postId || '',
+				},
+			});
 			if (data.code == 0) {
 				if (data.data.length > 0) {
 					this.luck_list = this.luck_list.concat(data.data);
@@ -1304,11 +925,7 @@ body,
 				box-shadow: 0px 2px 20px rgba(0, 0, 0, 0.1);
 
 				&.bg {
-					background: linear-gradient(
-						17.98deg,
-						#3438ff 3.69%,
-						#8b56fc 74.32%
-					);
+					background: linear-gradient(17.98deg, #3438ff 3.69%, #8b56fc 74.32%);
 				}
 				&.custom {
 					background: unset;

+ 233 - 233
pages/nft/index.vue

@@ -1,211 +1,211 @@
 <template>
-    <div class="nft-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">
-                    <div class="banner"><img :src="detail.pageImagePath" /></div>
-                    <div class="title">Open link on PC to Buy NFT</div>
-                    <div class="desc">{{ linkHref }}</div>
-                    <div class="copy">
-                        <button class="btn" :data-clipboard-text="linkHref">Copy Link</button>
-                    </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="img">
-                            <img :src="detail.pageImagePath" />
-                        </div>
-                        <div class="info">
-                            <template v-if="isChrome">
-                                <div class="title">Install DeNet Plugin<br/>to Buy NFT</div>
-                                <img class="buy" @click="installExtension" src="../../static/img/icon-install-plugin.svg" />
-                            </template>
-                            <template v-else>
-                                <div class="title">Only Support to Use Chrome to buy NFT</div>
-                                <img class="buy" @click="installChrome" src="../../static/img/icon-install-chrome.svg" />
-                            </template>
-                        </div>
-                    </div>
-                </div>
-            </template>
-        </template>
-    </div>
+	<div class="nft-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">
+					<div class="banner"><img :src="detail.pageImagePath" /></div>
+					<div class="title">Open link on PC to Buy NFT</div>
+					<div class="desc">{{ linkHref }}</div>
+					<div class="copy">
+						<button class="btn" :data-clipboard-text="linkHref">Copy Link</button>
+					</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="img">
+							<img :src="detail.pageImagePath" />
+						</div>
+						<div class="info">
+							<template v-if="isChrome">
+								<div class="title">Install DeNet Plugin<br />to Buy NFT</div>
+								<img class="buy" @click="installExtension" src="../../static/img/icon-install-plugin.svg" />
+							</template>
+							<template v-else>
+								<div class="title">Only Support to Use Chrome to buy NFT</div>
+								<img class="buy" @click="installChrome" src="../../static/img/icon-install-chrome.svg" />
+							</template>
+						</div>
+					</div>
+				</div>
+			</template>
+		</template>
+	</div>
 </template>
 
 <script>
-import axios from 'axios'
-import Cookies from 'js-cookie'
+import axios from 'axios';
+import Cookies from 'js-cookie';
 import { Toast } from 'vant';
-import { isBrowser } from '../../utils/help.js'
+import { isBrowser } from '../../utils/help.js';
 
 const api = {
 	prod: 'https://api.denetme.net',
 	pre: 'https://preapi.denetme.net',
-	test: 'https://testapi.denetme.net'
-}
+	test: 'https://testapi.denetme.net',
+};
 const page = {
-	prod: "https://h5.denetme.net",
-	pre: "https://preh5.denetme.net",
-	test: 'https://testh5.denetme.net'
-}
-const jumpUrl = page[process.env.NUXT_ENV.MODE] + '/'
-const baseURL = api[process.env.NUXT_ENV.MODE]
+	prod: 'https://h5.denetme.net',
+	pre: 'https://preh5.denetme.net',
+	test: 'https://testh5.denetme.net',
+};
+const jumpUrl = page[process.env.NUXT_ENV.MODE] + '/';
+const baseURL = api[process.env.NUXT_ENV.MODE];
 const appVersionCode = 6;
-const ClipboardJS = require('clipboard')
+const ClipboardJS = require('clipboard');
 
 export default {
-    name: 'ntf',
-    data() {
-        return {
-            isLoading: true,
-            appVersionCode: appVersionCode,
-            jumpUrl: jumpUrl,
-            detail: {},
-            config: {},
-            title: 'DeNet Giveaway',
-            isMobile: false,
-            isChrome: false,
-            linkHref: '',
-            metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
-        }
-    },
-    head() {
+	name: 'ntf',
+	data() {
+		return {
+			isLoading: true,
+			appVersionCode: appVersionCode,
+			jumpUrl: jumpUrl,
+			detail: {},
+			config: {},
+			title: 'DeNet Giveaway',
+			isMobile: false,
+			isChrome: false,
+			linkHref: '',
+			metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
+		};
+	},
+	head() {
 		return {
 			type: '',
 			title: this.title,
 			appVersionCode: appVersionCode,
 			meta: [
-				// facebook 
+				// facebook
 				{
 					name: 'og:url',
-					content: this.jumpUrl + 'nft/' + this.$route.params.id + `/${this.$route.params.account}`
+					content: this.jumpUrl + 'nft/' + this.$route.params.id + `/${this.$route.params.account}`,
 				},
 				{
 					name: 'og:title',
-					content: this.metaTitle
+					content: this.metaTitle,
 				},
 				{
 					name: 'og:image',
-					content: this.detail.linkImagePath || ''
+					content: this.detail.linkImagePath || '',
 				},
 				// twitter
 				{
 					name: 'twitter:card',
-					content: 'summary_large_image'
+					content: 'summary_large_image',
 				},
 				{
 					name: 'twitter:url',
-					content: this.jumpUrl + 'nft/' + this.$route.params.id + `/${this.$route.params.account}`
+					content: this.jumpUrl + 'nft/' + this.$route.params.id + `/${this.$route.params.account}`,
 				},
 				{
 					name: 'twitter:title',
-					content: this.metaTitle
+					content: this.metaTitle,
 				},
 				{
 					name: 'twitter:image',
-					content: this.detail.linkImagePath || ''
-				}
-			]
-		}
+					content: this.detail.linkImagePath || '',
+				},
+			],
+		};
 	},
-    async asyncData(params) {
-        let { route } = params;
+	async asyncData(params) {
+		let { route } = params;
 		let { data } = await axios.post(`${baseURL}/denet/nft/project/getNftProjectInfo`, {
 			baseInfo: {
 				appVersionCode: appVersionCode,
-				mid: function () {
+				mid: (function () {
 					return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
-						var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
+						var r = (Math.random() * 16) | 0,
+							v = c == 'x' ? r : (r & 0x3) | 0x8;
 						return v.toString(16);
 					});
-				}()
+				})(),
 			},
 			params: {
-				nftProjectId: route.params.id || ''
-			}
-		})
+				nftProjectId: route.params.id || '',
+			},
+		});
 		if (data.code == 0 && data.data !== null) {
-            return {
-                detail: data.data,
-            }
+			return {
+				detail: data.data,
+			};
 		}
-    },
-    created() {
-        this.setCookieMid();
-        this.getConfig();
-    },
-    mounted() {
-        this.checkBrowser();
-        this.setNftInfo();
-        this.isLoading = false;
+	},
+	created() {
+		this.setCookieMid();
+		this.getConfig();
+	},
+	mounted() {
+		this.checkBrowser();
+		this.setNftInfo();
+		this.isLoading = false;
 
-        var clipboard = new ClipboardJS('.btn');
-        clipboard.on('success', function (e) {
-            Toast('copy success');
-            e.clearSelection();
-        });
-    },
-    methods: {
-        guid() {
+		var clipboard = new ClipboardJS('.btn');
+		clipboard.on('success', function (e) {
+			Toast('copy success');
+			e.clearSelection();
+		});
+	},
+	methods: {
+		guid() {
 			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
-				var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
+				var r = (Math.random() * 16) | 0,
+					v = c == 'x' ? r : (r & 0x3) | 0x8;
 				return v.toString(16);
 			});
 		},
-        setCookieMid() {
-			let _cookie_mid_arr = Cookies.get('mid') || []
+		setCookieMid() {
+			let _cookie_mid_arr = Cookies.get('mid') || [];
 			if (_cookie_mid_arr.length > 0) {
-				this.mid = JSON.parse(_cookie_mid_arr)[0].mid
+				this.mid = JSON.parse(_cookie_mid_arr)[0].mid;
 			} else {
-				this.mid = this.guid()
-				Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 })
+				this.mid = this.guid();
+				Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 });
 			}
 		},
-        installExtension() {
-            let { extensionsInstallUrl } = this.config;
-            window.open(extensionsInstallUrl)
-        },
-        installChrome() {
-            window.open('https://www.google.com/chrome')
-        },
-        async getConfig() {
+		installExtension() {
+			let { extensionsInstallUrl } = this.config;
+			window.open(extensionsInstallUrl);
+		},
+		installChrome() {
+			window.open('https://www.google.com/chrome');
+		},
+		async getConfig() {
 			let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
 				baseInfo: {
 					appVersionCode: appVersionCode,
-					mid: this.mid
+					mid: this.mid,
 				},
-				params: {}
-			})
+				params: {},
+			});
 			if (data.code == 0) {
 				this.config = data.data;
 			}
 		},
-        checkBrowser() {
-            this.linkHref = window.location.href;
-            this.isChrome = isBrowser() == 'chrome';
+		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);
 		},
-        setNftInfo() {
+		setNftInfo() {
 			let nftInfo = {
 				nftProjectId: this.detail.nftProjectId || '',
-                twitterAccount: atob(this.$route.params.account || ''),
-                createTime: Date.now(),
-                jump_type: 'nft_info',
+				twitterAccount: atob(this.$route.params.account || ''),
+				createTime: Date.now(),
+				jump_type: 'nft_info',
 			};
 			Cookies.set('jump_info', JSON.stringify(nftInfo), { expires: 100 });
 		},
-    }
-}
+	},
+};
 </script>
 
 <style lang="scss">
@@ -220,106 +220,106 @@ body,
 }
 
 .nft-content {
-    overflow: hidden;
-    width: 100%;
-    height: 100%;
-    background: linear-gradient(180deg, #FFFFFF 0%, #F0F7FE 94.31%);
-    .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;
-            width: 1000px;
-            .img {
-                width: 50%;
-                margin-right: 6%;
-                img {
-                    width: 100%;
-                }
-            }
-            .info {
-                display: flex;
-                flex-direction: column;
-                justify-content: center;
-                width: 44%;
-                .tag {
-                    width: 25%;
-                    margin-bottom: 6px;
-                }
-                .title {
-                    color: #3A4B56;
-                    font-size: 2.2vw;
-                    font-family: 'SF Pro Display';
-                    font-weight: bold;
-                    word-break: break-word;
-                    margin-bottom: 1vw;
-                }
-                .buy {
-                    width: 75%;
-                    max-width: 263px;
-                    max-height: 64px;
-                    cursor: pointer;
-                }
-            }
-        }
-    }
+	overflow: hidden;
+	width: 100%;
+	height: 100%;
+	background: linear-gradient(180deg, #ffffff 0%, #f0f7fe 94.31%);
+	.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;
+			width: 1000px;
+			.img {
+				width: 50%;
+				margin-right: 6%;
+				img {
+					width: 100%;
+				}
+			}
+			.info {
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				width: 44%;
+				.tag {
+					width: 25%;
+					margin-bottom: 6px;
+				}
+				.title {
+					color: #3a4b56;
+					font-size: 2.2vw;
+					font-family: 'SF Pro Display';
+					font-weight: bold;
+					word-break: break-word;
+					margin-bottom: 1vw;
+				}
+				.buy {
+					width: 75%;
+					max-width: 263px;
+					max-height: 64px;
+					cursor: pointer;
+				}
+			}
+		}
+	}
 }
 
 .small {
-    padding: 30px 20px;
-    .banner {
-        width: 100%;
-        img {
-            width: 100%;
-        }
-    }
-    .title {
-        color: #000000;
-        font-weight: 600;
-        font-size: 20px;
-        text-align: center;
-        padding: 17px 0 12px;
-    }
-    .desc {
-        color: #8A8A8A;
-        font-size: 13px;
-        padding: 0 22px;
-        word-break: break-all;
-        text-align: center;
-    }
-    .copy {
-        margin-top: 35px;
-        button {
-            width: 100%;
-            border: 0;
-            height: 53px;
-            color: #fff;
-            font-size: 18px;
-            font-weight: 700;
-            border-radius: 55px;
-            background: #1D9BF0;
-        }
-    }
+	padding: 30px 20px;
+	.banner {
+		width: 100%;
+		img {
+			width: 100%;
+		}
+	}
+	.title {
+		color: #000000;
+		font-weight: 600;
+		font-size: 20px;
+		text-align: center;
+		padding: 17px 0 12px;
+	}
+	.desc {
+		color: #8a8a8a;
+		font-size: 13px;
+		padding: 0 22px;
+		word-break: break-all;
+		text-align: center;
+	}
+	.copy {
+		margin-top: 35px;
+		button {
+			width: 100%;
+			border: 0;
+			height: 53px;
+			color: #fff;
+			font-size: 18px;
+			font-weight: 700;
+			border-radius: 55px;
+			background: #1d9bf0;
+		}
+	}
 }
-</style>
+</style>