zhangwei 3 лет назад
Родитель
Сommit
2d99041eb6
1 измененных файлов с 15 добавлено и 7 удалено
  1. 15 7
      pages/index.vue

+ 15 - 7
pages/index.vue

@@ -44,14 +44,15 @@
 						<div class="txt">AWESOME! YOU Will GET</div>
 						<div class="head-money-area">
 							<img :src="currencyIconPath" alt />
-							<span class="money-txt">{{ receiveAmount }}</span>
+							<span class="money-txt" :style="{ fontSize: amount_font_size + 'px' }">{{ receiveAmount }}</span>
 						</div>
 					</div>
 				</div>
 
 				<!-- 领取列表 -->
 				<div class="luck-list-title">
-					<div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners</div>
+					<div>{{ detail.postBizData.receiveCount || 0 }}/{{ detail.postBizData.totalCount || 0 }} Winners
+					</div>
 					<div> {{ detail.postBizData.receiveAmountValue }} / {{
 							detail.postBizData.amountValue || ''
 					}} {{ detail.postBizData.currencySymbol || '' }}</div>
@@ -150,7 +151,7 @@
 					</div>
 					<div class="luck-money">
 						<img :src="currencyIconPath" alt />
-						<div class="luck-money-txt" >{{ item.amountValue || 0 }}</div>
+						<div class="luck-money-txt">{{ item.amountValue || 0 }}</div>
 					</div>
 					<div class="luck-king" v-if="item.maxAmount">
 						<img src="/svg/icon-king-hat.svg" alt />
@@ -215,6 +216,7 @@ export default {
 			show_moblie: false,
 			show_home: false,
 			layer_show: false,
+			amount_font_size:46,
 			validity: '',
 			receiveAmount: 0,
 			validity_state: true,
@@ -236,7 +238,7 @@ export default {
 			luck_list: [],
 			luck_list_end: false,
 			config: {
-				extensionsInstallChannel : 'officeDownload', // chromeAppStore
+				extensionsInstallChannel: 'officeDownload', // chromeAppStore
 				extensionsInstallUrl: ''
 			}
 		}
@@ -268,7 +270,7 @@ export default {
 		}
 	},
 	methods: {
-		clickOpenChrome(){
+		clickOpenChrome() {
 			window.open('https://www.google.com/chrome')
 		},
 		isMobile() {
@@ -276,7 +278,7 @@ export default {
 			return flag;
 		},
 		installExtension() {
-			let {extensionsInstallChannel, extensionsInstallUrl} = this.config;
+			let { extensionsInstallChannel, extensionsInstallUrl } = this.config;
 			let url = extensionsInstallUrl || "https://d1mcov78iir8kk.cloudfront.net/extensions/chrome/denet1_0_1.zip"
 			switch (extensionsInstallChannel) {
 				case "officeDownload":
@@ -310,6 +312,11 @@ export default {
 				this.getReceivedList()
 			}
 		},
+		getFontSize(amount) {
+			let _num = parseInt(360 / amount.length);
+			debugger
+			this.amount_font_size = _num < 46 ? _num : 46;
+		},
 		setCookieMid() {
 			let _cookie_mid_arr = Cookies.get('mid') || []
 			if (_cookie_mid_arr.length > 0) {
@@ -345,6 +352,7 @@ export default {
 					}
 					this.getValidity(data.data.endTimestamp)
 					this.receiveAmount = data.data.receiveAmount
+					this.getFontSize(this.receiveAmount)
 					break;
 				case '2003':
 					this.status = 'expire'
@@ -438,7 +446,7 @@ export default {
 			}
 		},
 		async getConfig() {
-			let {data} = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
+			let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
 				baseInfo: {
 					appVersionCode: this.appVersionCode,
 					mid: this.mid