Browse Source

Merge branch 'test' of DeNet/de-net-official into master

zhangwei 3 năm trước cách đây
mục cha
commit
b40be2cbe1

+ 14 - 6
nuxt.config.js

@@ -1,13 +1,9 @@
 const env = require('./env')
-module.exports = {
-  env: {
-    NUXT_ENV: env[process.env.MODE]
-  }
-}
+
 export default {
   // Global page headers: https://go.nuxtjs.dev/config-head
   head: {
-    title: 'de-net-official',
+    title: 'de-net-official1',
     htmlAttrs: {
       lang: 'en'
     },
@@ -53,7 +49,19 @@ export default {
         name: 'index',
         path: '/:id?',
         component: resolve(__dirname, 'pages/index.vue')
+      },{
+        name: 'install',
+        path: '/install',
+        component: resolve(__dirname, 'pages/install.vue')
+      },
+      {
+        name: 'custom',
+        path: '*',
+        component: resolve(__dirname, 'pages/404.vue')
       })
     }
+  },
+  env: {
+    NUXT_ENV: env[process.env.MODE]
   }
 }

+ 1 - 0
package.json

@@ -9,6 +9,7 @@
     }
   },
   "scripts": {
+    "dev": "nuxt",
     "dev-test": "cross-env MODE=test nuxt",
     "dev-pre": "cross-env MODE=pre nuxt",
     "dev-prod": "cross-env MODE=prod nuxt",

+ 10 - 0
pages/404.vue

@@ -0,0 +1,10 @@
+<template>
+    <div>404</div>
+</template>
+
+<script>
+
+</script>
+
+<style lang="scss" >
+</style>

+ 33 - 15
pages/index.vue

@@ -1,12 +1,13 @@
 <template>
-	<div class="content" :style="{ 'backgroundImage': `url(${this.back_img})` }" v-show="home_show">
+	<div class="content" :style="{ 'backgroundImage': `url(${this.back_img})` }" v-show="home_show" v-if="detail">
 		<div class="logo">
 			<img src="/svg/icon-logo.svg" alt />
 		</div>
 		<!-- 红包 -->
 		<div class="redPacket" :class="{ redPacket2: status != 'open', key_packet: status == 'open' }"
-			v-show="status != 'error'">
-			<div class="area" :class="{ key_area: status == 'open' }" v-show="status == 'open' || status == 'no-chrome'">
+				 v-show="status != 'error'">
+			<div class="area" :class="{ key_area: status == 'open' }"
+					 v-show="status == 'open' || status == 'no-chrome'">
 				<div class="title">
 					<img :src="detail.postBizData.postUserInfo.avatarUrl" alt />
 					<span>Giveaways from: {{ detail.postBizData.postUserInfo.nickName }}</span>
@@ -15,9 +16,9 @@
 			</div>
 
 			<img src="/svg/back-top.svg" alt class="top" v-show="status == 'open' || status == 'no-chrome'"
-				:class="{ key_top: status == 'open' }" />
+					 :class="{ key_top: status == 'open' }" />
 			<img src="/svg/back-down.svg" alt class="down" v-show="status == 'open' || status == 'no-chrome'"
-				:class="{ key_down: status == 'open' }" />
+					 :class="{ key_down: status == 'open' }" />
 			<img src="/svg/icon-usd.svg" alt class="start" v-show="status == 'no-chrome'" />
 			<img src="/git/icon-start.gif" alt class="start" v-show="status == 'open'" />
 
@@ -32,7 +33,7 @@
 				<div class="head-area" v-else-if="status == 'nothing'">Better luck next time!</div>
 				<div class="head-area" v-else-if="status == 'expire'">
 					<div>This Giveways</div>
-					<div>expired on 03-14</div>
+					<div>expired on {{ formatTime(detail.postBizData.endTimestamp,'MM-DD') }}</div>
 				</div>
 				<div class="head-money" v-if="status == 'open' || status == 'opened'">
 					<img src="/svg/icon-usd.svg" alt />
@@ -47,8 +48,8 @@
 				</div>
 				<div>Total ${{ detail.postBizData.amountValue / 100 || '' }} {{
 					detail.postBizData.amountCurrencyCode ||
-						''
-				}}</div>
+					''
+					}}</div>
 			</div>
 			<div class="luck-list" @scroll="handleScroll" ref="list">
 				<div class="luck-item" v-for="item, i in luck_list" v-bind:key="i">
@@ -92,7 +93,7 @@
 					<span>Install DeNet</span>
 				</div>
 				<div class="tip">Used for Task Verification and Giveaways Withdrawal</div>
-				<div class="install_btn">Install</div>
+				<div class="install_btn" @click="installExtension">Install</div>
 				<div class="area_num">
 					<div class="num" style="background: #E0E0E0;">2</div>
 					<span>Complete Tasks by {{ detail.postBizData.postUserInfo.nickName }}</span>
@@ -126,12 +127,14 @@ import { isBrowser } from '../utils/help.js'
 var moment = require('moment');
 
 const api = {
-	prod: 'https://api.denet.me',
-	pre: 'https://preapi.denet.me',
-	test: 'https://testapi.denet.me',
+	prod: 'https://api.denetme.net',
+	pre: 'https://preapi.denetme.net',
+	test: 'https://testapi.denetme.net'
 }
 
 const baseURL = api[process.env.NUXT_ENV.MODE]
+
+
 export default {
 	name: "index",
 	data() {
@@ -197,6 +200,13 @@ export default {
 		}
 	},
 	methods: {
+		installExtension() {
+			let url = 'https://d3d9wvhy948gxx.cloudfront.net/extensions/chrome/denet.zip'
+			this.$router.push({
+				path: '/install'
+			})
+			location.href= url;
+		},
 		formatTime(time) {
 			return moment(time).format('MM-DD hh:mm:ss')
 		},
@@ -247,6 +257,9 @@ export default {
 					this.getValidity(data.data.endTimestamp)
 					this.receiveAmount = data.data.receiveAmount
 					break;
+				case '2003':
+					this.status = 'expire'
+					break
 				// 红包被领完了
 				case '2008':
 					this.status = 'nothing'
@@ -257,6 +270,7 @@ export default {
 					break
 				default:
 					console.log('getRedPacket', data)
+					this.home_show = false
 					break;
 			}
 			// 领取列表分页
@@ -305,8 +319,10 @@ export default {
 			}, 1000)
 		},
 		setPickupInfo() {
-			let  pickupInfo = {	srcContentId: this.detail.srcContentId,
-								postNickName: this.detail.postBizData.postUserInfo.nickName };
+			let pickupInfo = {
+				srcContentId: this.detail.srcContentId,
+				postNickName: this.detail.postBizData.postUserInfo.nickName
+			};
 			Cookies.set('pickup_info', JSON.stringify(pickupInfo), { expires: 100 });
 		}
 	},
@@ -337,6 +353,9 @@ export default {
 	},
 
 	mounted() {
+		if (!this.detail.postId) {
+			return
+		}
 		//改变font-size
 		(function (doc, win) {
 			var docEI = doc.documentElement,
@@ -488,7 +507,6 @@ body,
 
 			.head-area {
 				height: 10rem;
-				line-height: 10rem;
 				text-align: center;
 				letter-spacing: 0.3px;
 				font-size: 2rem;

+ 47 - 0
pages/install.vue

@@ -0,0 +1,47 @@
+<template>
+  <div class="wrapper">
+    <img class="img-title" src="../static/img/img-install-title.png" @click="installExtension">
+    <div class="row">
+      <img src="../static/img/img-install-01.png">
+      <img src="../static/img/img-install-02.png">
+      <img src="../static/img/img-install-03.png">
+      <img src="../static/img/img-install-04.png">
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+	name: "install",
+  methods: {
+		installExtension() {
+			let url = 'https://d3d9wvhy948gxx.cloudfront.net/extensions/chrome/denet.zip'
+			location.href= url;
+		},
+  }
+}
+</script>
+
+<style scoped lang="scss">
+.wrapper {
+  width: 100%;
+  height: 100vh;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 40px;
+  box-sizing: border-box;
+  .img-title {
+    width: 510px;
+    margin-bottom: 90px;
+    cursor: pointer;
+  }
+  .row {
+    img {
+      width: 270px;
+      margin-right: 30px;
+    }
+  }
+}
+</style>

BIN
static/img/img-install-01.png


BIN
static/img/img-install-02.png


BIN
static/img/img-install-03.png


BIN
static/img/img-install-04.png


BIN
static/img/img-install-title.png