Bladeren bron

Merge branch 'test' of https://git.yishihui.com/DeNet/de-net-official into test

wenliming 3 jaren geleden
bovenliggende
commit
72854d0cba
2 gewijzigde bestanden met toevoegingen van 34 en 12 verwijderingen
  1. 27 7
      pages/index.vue
  2. 7 5
      utils/help.js

+ 27 - 7
pages/index.vue

@@ -43,7 +43,7 @@
 					<div class="head-area head-money" v-if="status == 'open' || status == 'opened'">
 						<div class="txt">AWESOME! YOU Will GET</div>
 						<div class="head-money-area">
-							<img :src="currencyIconUrl" alt />
+							<img :src="currencyIconPath" alt />
 							<span class="money-txt">{{ receiveAmount }}</span>
 						</div>
 					</div>
@@ -51,7 +51,7 @@
 
 				<!-- 领取列表 -->
 				<div class="luck-list-title">
-					<div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Got</div>
+					<div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Get</div>
 					<div> {{ detail.postBizData.receiveAmountValue }} / {{
 							detail.postBizData.amountValue || ''
 					}} {{ detail.postBizData.amountCurrencyCode || '' }}</div>
@@ -65,7 +65,7 @@
 							<div class="luck-time">{{ formatTime(item.receiveTimestamp) }}</div>
 						</div>
 						<div class="luck-money">
-							<img :src="item.currencyIconUrl" alt />
+							<img :src="item.currencyIconPath" alt />
 							<div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
 						</div>
 						<div class="luck-king" v-if="item.maxAmount">
@@ -122,7 +122,7 @@
 				<div class="title">Open Giveaways</div>
 				<div class="title">with chrome</div>
 				<div class="tip">Only supports getting Giveaways through chrome</div>
-				<div class="install_chrome">
+				<div class="install_chrome" @click="clickOpenChrome()">
 					<img src="/svg/icon-chrome.svg" alt />
 					Install Chrome
 				</div>
@@ -135,7 +135,7 @@
 			</div>
 			<!-- 领取列表 -->
 			<div class="luck-list-title">
-				<div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Got</div>
+				<div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Get</div>
 				<div> {{ detail.postBizData.receiveAmountValue }} / {{
 						detail.postBizData.amountValue || ''
 				}} {{ detail.postBizData.amountCurrencyCode || '' }}</div>
@@ -149,7 +149,7 @@
 						<div class="luck-time">{{ formatTime(item.receiveTimestamp) }}</div>
 					</div>
 					<div class="luck-money">
-						<img :src="item.currencyIconUrl" alt />
+						<img :src="currencyIconPath" alt />
 						<div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
 					</div>
 					<div class="luck-king" v-if="item.maxAmount">
@@ -226,7 +226,7 @@ export default {
 					}
 				}
 			},
-			currencyIconUrl: '',
+			currencyIconPath: '',
 			title: '',
 			twitterTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
 			jumpUrl: jumpUrl,
@@ -264,6 +264,9 @@ export default {
 		}
 	},
 	methods: {
+		clickOpenChrome(){
+			window.open('https://www.google.com/chrome')
+		},
 		isMobile() {
 			let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
 			return flag;
@@ -305,6 +308,7 @@ export default {
 			}
 		},
 		async getRedPacket() {
+			this.currencyIconPath = this.detail.postBizData.currencyIconPath
 			let { data } = await axios.post(`${baseURL}/denet/post/luckdrop/receiveLuckdrop`, {
 				baseInfo: {
 					appVersionCode: this.appVersionCode,
@@ -317,6 +321,7 @@ export default {
 			this.show_home = true
 			switch (data.code.toString()) {
 				case '0':
+					this.getDetail()
 					if (data.data.newReceived) {
 						this.status = 'not-open'
 						setTimeout(() => {
@@ -405,6 +410,20 @@ export default {
 				postNickName: this.detail.postBizData.postUserInfo.nickName
 			};
 			Cookies.set('pickup_info', JSON.stringify(pickupInfo), { expires: 100 });
+		},
+		async getDetail() {
+			let { data } = await axios.post(`${baseURL}/denet/post/getDetail`, {
+				baseInfo: {
+					appVersionCode: this.appVersionCode,
+					mid: this.mid
+				},
+				params: {
+					postId: this.detail.postId
+				}
+			})
+			if (data.code == 0) {
+				this.detail.postBizData = JSON.parse(data.data.postBizData)
+			}
 		}
 	},
 
@@ -433,6 +452,7 @@ export default {
 		}
 	},
 
+
 	mounted() {
 		if (!this.detail.postId) {
 			return

+ 7 - 5
utils/help.js

@@ -28,13 +28,9 @@ export function isBrowser() {
             }
             return false;
         }
-        if (agent.indexOf("chrome") > 0) {
-            return 'chrome'
-        }
-
     }
     let s = System()
-    if(s){
+    if (s) {
         return s
     }
     if (agent.indexOf('firefox') > 0) {
@@ -43,7 +39,13 @@ export function isBrowser() {
     if (agent.indexOf('trident') > 0) {
         return "IE浏览器"
     }
+    if (agent.indexOf('edg') > 0) {
+        return "IE浏览器"
+    }
     if (agent.indexOf("safari") > 0 && agent.indexOf("chrome") < 0) {
         return 'Safari'
     }
+    if (agent.indexOf("chrome") > 0) {
+        return 'chrome'
+    }
 }