nieyuge 2 years ago
parent
commit
f211dae1f8
2 changed files with 438 additions and 272 deletions
  1. 2 0
      pages/index.vue
  2. 436 272
      pages/luckdraw.vue

+ 2 - 0
pages/index.vue

@@ -687,6 +687,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,
 			}
 		}
 	},

+ 436 - 272
pages/luckdraw.vue

@@ -2,9 +2,7 @@
 <template>
     <div class="content">
         <template v-if="isLoading">
-            <img
-                class="loading"
-                src="../static/svg/icon-loading.svg" />
+            <img class="loading" src="../static/svg/icon-loading.svg" />
         </template>
         <template v-else>
             <template v-if="isMobile">
@@ -14,50 +12,47 @@
                     custom: detail.postBizData.posterType === 2 && detail.postBizData.customPosterInstalled,
                 }">
                     <template 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" />
                         </template>
                         <template v-else>
-                          <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-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="{
+                            <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>
+                                }" :rewardType="detail.postBizData.rewardType"
+                                    :customizedReward="detail.postBizData.customizedReward" :showBottomInfo="false">
+                                </custom-card-cover>
+                            </template>
+                        </template>
                     </template>
                     <template v-else>
                         <div class="succTop">
@@ -68,7 +63,8 @@
                             <template v-else-if="status === 'expire'">
                                 <!-- <img class="img" :src=" require('../static/svg/icon-luck-complete.svg') " />
                                 <p class="tips">This Draw is Complete</p> -->
-                                <p class="expire">This Giveaways<br/>expired on {{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</p>
+                                <p class="expire">This Giveaways<br />expired on {{
+                                    formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</p>
                             </template>
                             <template v-else>
                                 <p class="win">🎉 Awesome! You Will Get</p>
@@ -79,14 +75,19 @@
                             </template>
                         </div>
                         <div class="succTitle">
-                            <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>
+                            <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>
                         </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="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="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">
@@ -121,7 +122,7 @@
                             {{ linkHref }}
                         </div>
                         <div class="area-btn">
-                            <div class="btn" :data-clipboard-text="linkHref">Copy Link</div>
+                            <div class="btn" :data-clipboard-text="linkHref" @click="copyLinkHandle">Copy Link</div>
                         </div>
                     </div>
                     <div class="layer" v-show="layer_show">
@@ -139,18 +140,19 @@
                 </div>
                 <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>
-                      </div>
+                        <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',
                             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">
-                                  <!-- <img class="customImg" :src="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">
                                       <img class="icon" :src="require('../static/svg/icon-last-time.svg')"/>
@@ -163,65 +165,55 @@
                                       <span class="prize-name">{{detail.postBizData.amountValue + ' ' + detail.postBizData.currencySymbol}}</span>
                                     </div>
                                   </div> -->
-                                  <custom-card-cover
-                                    :totalCount="detail.postBizData.totalCount"
-                                    :amountValue="detail.postBizData.amountValue"
-                                    :tokenSymbol="detail.postBizData.tokenSymbol"
-                                    :currencyIconUrl="detail.postBizData.iconPath"
-                                    :playType="2"
-                                    :posterType="2"
-                                    :customPosterInstalled="detail.postBizData.customPosterInstalled"
-                                    :validity="validity"
-                                    :userInfo="{
+                                    <custom-card-cover :totalCount="detail.postBizData.totalCount"
+                                        :amountValue="detail.postBizData.amountValue"
+                                        :tokenSymbol="detail.postBizData.tokenSymbol"
+                                        :currencyIconUrl="detail.postBizData.iconPath" :playType="2" :posterType="2"
+                                        :customPosterInstalled="detail.postBizData.customPosterInstalled"
+                                        :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>
+                                    }" :rewardType="detail.postBizData.rewardType"
+                                        :customizedReward="detail.postBizData.customizedReward" :showBottomInfo="true">
+                                    </custom-card-cover>
                                 </template>
                                 <template v-else>
-                                  <!-- 旧版 样式,后续更新时在 custom-card-cover 公共组件内维护-->
-                                  <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>
+                                    <!-- 旧版 样式,后续更新时在 custom-card-cover 公共组件内维护-->
+                                    <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>
-                                  </template>
+                                        <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="{
+                                    <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>
+                                        }" :rewardType="detail.postBizData.rewardType"
+                                            :customizedReward="detail.postBizData.customizedReward"
+                                            :showBottomInfo="true"></custom-card-cover>
+                                    </template>
                                 </template>
                             </div>
                             <template v-else>
@@ -233,7 +225,8 @@
                                     <template v-else-if="status === 'expire'">
                                         <!-- <img class="img" :src=" require('../static/svg/icon-luck-complete.svg') " />
                                         <p class="tips">This Draw is Complete</p> -->
-                                        <p class="expire">This Giveaways<br/>expired on {{ formatTime(detail.postBizData.endTimestamp, 'MM-DD') }}</p>
+                                        <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>
@@ -244,19 +237,26 @@
                                     </template>
                                 </div>
                                 <div class="succTitle">
-                                    <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>
+                                    <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>
                                 </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="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="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' }}</div>
-                                            <div class="luck-time">{{ formatTime(item.receiveTimestamp, 'MM-DD HH:mm') }}</div>
+                                            <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" v-if="isMoneyPrize">
                                             <img :src="item.currencyIconPath" alt />
@@ -274,18 +274,20 @@
                         <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="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" />
+                                <img class="button" @click="clickOpenChrome"
+                                    src="../static/svg/icon-install-nft-chrome.svg" />
                             </template>
                         </div>
                     </div>
@@ -302,6 +304,7 @@ 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 Report from "../log-center/log"
 import { RewardType } from '../types';
 
 var moment = require('moment');
@@ -329,41 +332,41 @@ export default {
 		return {
 			type: '',
 			title: this.title,
-			appVersionCode: 3,
-			meta: [
-				// facebook
-				{
-					name: 'og:url',
-					content: this.jumpUrl + 'luckdraw/' + this.detail.postId
-				},
-				{
-					name: 'og:title',
-					content: this.metaTitle
-				},
-				{
-					name: 'og:image',
-					content: this.detail.postBizData.imagePath || this.detail.postBizData.customPosterUninstalled || ''
-				},
-				// twitter
-				{
-					name: 'twitter:card',
-					content: 'summary_large_image'
-				},
-				{
-					name: 'twitter:url',
-					content: this.jumpUrl + 'luckdraw/' + this.detail.postId
-				},
-				{
-					name: 'twitter:title',
-					content: this.metaTitle
-				},
-				{
-					name: 'twitter:image',
-					content: this.detail.postBizData.imagePath || this.detail.postBizData.customPosterUninstalled || ''
-				}
-			]
-		}
-	},
+            appVersionCode: appVersionCode,
+            meta: [
+                // facebook
+                {
+                    name: 'og:url',
+                    content: this.jumpUrl + 'luckdraw/' + this.detail.postId
+                },
+                {
+                    name: 'og:title',
+                    content: this.metaTitle
+                },
+                {
+                    name: 'og:image',
+                    content: this.detail.postBizData.imagePath || this.detail.postBizData.customPosterUninstalled || ''
+                },
+                // twitter
+                {
+                    name: 'twitter:card',
+                    content: 'summary_large_image'
+                },
+                {
+                    name: 'twitter:url',
+                    content: this.jumpUrl + 'luckdraw/' + this.detail.postId
+                },
+                {
+                    name: 'twitter:title',
+                    content: this.metaTitle
+                },
+                {
+                    name: 'twitter:image',
+                    content: this.detail.postBizData.imagePath || this.detail.postBizData.customPosterUninstalled || ''
+                }
+            ]
+        }
+    },
     data() {
         return {
             detail: {
@@ -384,20 +387,23 @@ export default {
             mid: '',
             status: '',  // not-open->未打开   opened->没有抽中   success->抽中了   expire->过期
             page_index: 1,
-			page_size: 20,
+            page_size: 20,
             validity: '',
             receiveAmount: '0',
             title: 'DeNet Giveaway',
             jumpUrl: jumpUrl,
-			metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
+            metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
+            reportStatus: 'normal',
+            customCover: '',
+            customGiveaway: '',
         }
-  },
-  computed: {
-    // 货币类型的奖品
-    isMoneyPrize() {
-      return this.detail.postBizData.rewardType === RewardType.money;
-    }
-  },
+    },
+    computed: {
+        // 货币类型的奖品
+        isMoneyPrize() {
+            return this.detail.postBizData.rewardType === RewardType.money;
+        }
+    },
     mounted() {
         this.getConfig()
         this.setCookieMid()
@@ -416,102 +422,157 @@ export default {
         });
     },
     async asyncData(params) {
-		let { route } = params;
-		let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
-			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);
-					});
-				}()
-			},
-			params: {
-				postId: route.params.id || ''
-			}
-		})
-		if (data.code == 0) {
-			if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
-				data.data.postBizData = JSON.parse(data.data.postBizData)
-			}
-			if(data.data.postBizData === null) {
-				data.data.postBizData = {
-					postUserInfo: {}
-				}
-			}
-			return {
-				detail: data.data,
-			}
-		}
-	},
+        let { route } = params;
+        let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
+            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);
+                    });
+                }()
+            },
+            params: {
+                postId: route.params.id || ''
+            }
+        })
+        if (data.code == 0) {
+            if (data.data && data.data.postBizData && typeof data.data.postBizData == 'string') {
+                data.data.postBizData = JSON.parse(data.data.postBizData)
+            }
+            if (data.data.postBizData === null) {
+                data.data.postBizData = {
+                    postUserInfo: {}
+                }
+            }
+            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,
+            }
+        }
+    },
     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);
+            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 {
                 this.setPickupInfo()
             }
-		},
+            // report
+            setTimeout(() => {
+                this.reportData()
+            }, 500)
+        },
         async getConfig() {
             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;
-			}
+                baseInfo: {
+                    appVersionCode: appVersionCode,
+                    mid: this.mid
+                },
+                params: {}
+            })
+            if (data.code == 0) {
+                this.config = data.data;
+            }
         },
         setCookieMid() {
             let _cookie_mid_arr = Cookies.get('mid') || []
-			if (_cookie_mid_arr.length > 0) {
-				this.mid = JSON.parse(_cookie_mid_arr)[0].mid
-			} else {
-				this.mid = this.guid()
-				Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 })
-			}
+            if (_cookie_mid_arr.length > 0) {
+                this.mid = JSON.parse(_cookie_mid_arr)[0].mid
+            } else {
+                this.mid = this.guid()
+                Cookies.set('mid', JSON.stringify([{ mid: this.mid }]), { expires: 1000 })
+            }
         },
         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')
-		},
+            window.open('https://www.google.com/chrome')
+
+            let extParams = this.isMobile ? {} : { status: this.reportStatus }
+            Report.reportLog({
+                baseInfo: {
+                    appVersionCode: appVersionCode,
+                    mid: this.mid,
+                    pageSource: Report.pageSource.newUserLandingPage,
+                    appType,
+                    machineCode: this.mid
+                },
+                params: {
+                    eventData: {
+                        businessType: Report.businessType.buttonClick,
+                        objectType: Report.objectType.installButton,
+                        postId: this.detail.postId,
+                        srcContentId: this.detail.srcContentId,
+                        senderId: this.detail.srcUserId,
+                        redPacketType: 1,
+                        customCover: this.customCover,
+                        customGiveaway: this.customGiveaway,
+                    },
+                    extParams: extParams
+                }
+            })
+        },
         installExtension() {
             let { extensionsInstallChannel, extensionsInstallUrl } = this.config;
+            let extParams = this.isMobile ? {} : { status: this.reportStatus }
+
+            Report.reportLog({
+                baseInfo: {
+                    appVersionCode: appVersionCode,
+                    mid: this.mid,
+                    pageSource: Report.pageSource.newUserLandingPage,
+                    appType,
+                    machineCode: this.mid
+                },
+                params: {
+                    eventData: {
+                        businessType: Report.businessType.buttonClick,
+                        objectType: Report.objectType.installButton,
+                        postId: this.detail.postId,
+                        srcContentId: this.detail.srcContentId,
+                        senderId: this.detail.srcUserId,
+                        redPacketType: 1,
+                        customCover: this.customCover,
+                        customGiveaway: this.customGiveaway,
+                    },
+                    extParams: extParams,
+                }
+            })
+
             switch (extensionsInstallChannel) {
-				case "officeDownload":
-					location.href = url;
-					this.$router.push({
-						path: '/install'
-					})
-					break;
-				case "chromeAppStore":
-					window.open(extensionsInstallUrl)
-					break;
-			}
+                case "officeDownload":
+                    location.href = url;
+                    this.$router.push({
+                        path: '/install'
+                    })
+                    break;
+                case "chromeAppStore":
+                    window.open(extensionsInstallUrl)
+                    break;
+            }
         },
         setPickupInfo() {
             let pickupInfo = {
-				srcContentId: this.detail.srcContentId || '',
-				postNickName: this.detail.postBizData.postUserInfo.nickName || '',
+                srcContentId: this.detail.srcContentId || '',
+                postNickName: this.detail.postBizData.postUserInfo.nickName || '',
                 createTime: Date.now(),
                 jump_type: 'luck_draw',
-			};
-			Cookies.set('jump_info', JSON.stringify(pickupInfo), { expires: 100 });
+            };
+            Cookies.set('jump_info', JSON.stringify(pickupInfo), { expires: 100 });
         },
         formatTime(time, _type = 'MM-DD HH:mm:ss') {
-			return moment(time).format(_type)
-		},
+            return moment(time).format(_type)
+        },
         getValidity(end_time) {
             let timer = setInterval(() => {
                 let time = moment(new Date().getTime())
@@ -529,16 +590,16 @@ export default {
             }, 1000)
         },
         handleScroll(e) {
-			e = e.target
-			if (this.luck_list_end) {
-				return
-			}
-			if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
-				this.luck_list_end = false
-				this.page_index++
-				this.getReceivedList()
-			}
-		},
+            e = e.target
+            if (this.luck_list_end) {
+                return
+            }
+            if ((e.clientHeight + e.scrollTop) / e.scrollHeight > .8) {
+                this.luck_list_end = false
+                this.page_index++
+                this.getReceivedList()
+            }
+        },
         handleStatusPage() {
             // 如果 我领取过了
             // taskFinishStatus  任务完成状态(0:未完成,1:已完成,2:已过期)
@@ -553,6 +614,7 @@ export default {
                     if (this.receiveAmount == 0) {
                         // 领取到空红包
                         this.status = `opened`
+                        this.reportStatus = `empty`
                     } else {
                         // 显示成功页面
                         this.status = `success`
@@ -565,6 +627,7 @@ export default {
                     } else {
                         // 显示已经过期页面
                         this.status = 'expire'
+                        this.reportStatus = `empty`
                     }
                 }
             } else {
@@ -575,6 +638,7 @@ export default {
                     if (this.detail.postBizData.receiveTimeExpired) {
                         // 显示过期页面
                         this.status = 'expire'
+                        this.reportStatus = `empty`
                     } else {
                         // 如果 过了红包的领取截止时间 = false
                         // 显示未打开页面
@@ -584,6 +648,7 @@ export default {
                     // 红包状态 = 已经结束了 | 已经终止 | 终止退款中
                     // 显示过期页面
                     this.status = 'expire'
+                    this.reportStatus = `empty`
                 }
             }
 
@@ -597,42 +662,141 @@ export default {
             }
         },
         async getDetail(fn) {
-			let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
-				baseInfo: {
-					appVersionCode: appVersionCode,
-					mid: this.mid
-				},
-				params: {
-					postId: this.detail.postId
-				}
-			})
-          if (data.code == 0) {
-        console.log(data.data)
-				this.detail.postBizData = JSON.parse(data.data.postBizData)
+            let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
+                baseInfo: {
+                    appVersionCode: appVersionCode,
+                    mid: this.mid
+                },
+                params: {
+                    postId: this.detail.postId
+                }
+            })
+            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;
                 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 || ''
-				}
-			})
-			if (data.code == 0) {
-				if (data.data.length > 0) {
-					this.luck_list = this.luck_list.concat(data.data)
-					this.luck_list_end = false
-				} else {
-					this.luck_list_end = true
-				}
-			}
-		},
+            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)
+                    this.luck_list_end = false
+                } else {
+                    this.luck_list_end = true
+                }
+            }
+        },
+
+        copyLinkHandle() {
+            Report.reportLog({
+                baseInfo: {
+                    appVersionCode: appVersionCode,
+                    mid: this.mid,
+                    pageSource: Report.pageSource.mobileLandingPage,
+                    appType,
+                    machineCode: this.mid
+                },
+                params: {
+                    eventData: {
+                        businessType: Report.businessType.buttonClick,
+                        objectType: Report.objectType.copyLinkButton,
+                        postId: this.detail.postId || '',
+                        srcContentId: this.detail.srcContentId || '',
+                        senderId: this.detail.srcUserId || '',
+                        redPacketType: 1,
+                        customCover: this.customCover,
+                        customGiveaway: this.customGiveaway,
+                    }
+                }
+            })
+        },
+        reportData() {
+            if (this.isMobile) {
+                // 手机端
+                Report.reportLog({
+                    baseInfo: {
+                        appVersionCode: appVersionCode,
+                        mid: this.mid,
+                        pageSource: Report.pageSource.mobileLandingPage,
+                        appType,
+                        machineCode: this.mid
+                    },
+                    params: {
+                        eventData: {
+                            businessType: Report.businessType.pageView,
+                            postId: this.detail.postId,
+                            srcContentId: this.detail.srcContentId,
+                            senderId: this.detail.srcUserId,
+                            redPacketType: 1,
+                            customCover: this.customCover,
+                            customGiveaway: this.customGiveaway,
+                        }
+                    }
+                })
+            } else if (this.isChrome) {
+                // pc端
+                Report.reportLog({
+                    baseInfo: {
+                        appVersionCode: appVersionCode,
+                        mid: this.mid,
+                        pageSource: Report.pageSource.newUserLandingPage,
+                        appType,
+                        machineCode: this.mid
+                    },
+                    params: {
+                        eventData: {
+                            businessType: Report.businessType.pageView,
+                            postId: this.detail.postId,
+                            srcContentId: this.detail.srcContentId,
+                            senderId: this.detail.srcUserId,
+                            redPacketType: 1,
+                            customCover: this.customCover,
+                            customGiveaway: this.customGiveaway,
+                        },
+                        extParams: {
+                            status: this.reportStatus,
+                        }
+                    }
+                });
+            } else {
+                Report.reportLog({
+                    baseInfo: {
+                        appVersionCode: appVersionCode,
+                        mid: this.mid,
+                        pageSource: Report.pageSource.newUserLandingPage,
+                        appType,
+                        machineCode: this.mid
+                    },
+                    params: {
+                        eventData: {
+                            businessType: Report.businessType.pageView,
+                            postId: this.detail.postId,
+                            srcContentId: this.detail.srcContentId,
+                            senderId: this.detail.srcUserId,
+                            redPacketType: 1,
+                            customCover: this.customCover,
+                            customGiveaway: this.customGiveaway,
+                        },
+                        extParams: {
+                            status: 'not-chrome',
+                        }
+                    }
+                })
+            }
+        }
     }
 }
 </script>