nieyuge 2 năm trước cách đây
mục cha
commit
57d828c2e8
5 tập tin đã thay đổi với 243 bổ sung0 xóa
  1. 5 0
      nuxt.config.js
  2. 231 0
      pages/nft.vue
  3. BIN
      static/subject/img-example.png
  4. 6 0
      static/svg/icon-loading.svg
  5. 1 0
      static/svg/icon-nft.svg

+ 5 - 0
nuxt.config.js

@@ -55,6 +55,11 @@ export default {
         path: '/install',
         component: resolve(__dirname, 'pages/install.vue')
       },
+      {
+        name: 'nft',
+        path: '/nft/:id?',
+        component: resolve(__dirname, 'pages/nft.vue')
+      },
       {
         name: 'custom',
         path: '*',

+ 231 - 0
pages/nft.vue

@@ -0,0 +1,231 @@
+<template>
+    <div class="nft-content">
+        <div class="logo">
+            <img src="/img/icon-logo.png" alt />
+        </div>
+        <div class="show">
+            <img
+                v-if="isLoading"
+                class="loading"
+                src="../static/svg/icon-loading.svg" />
+            <div class="center" v-else>
+                <div class="img">
+                    <img :src="detail.pageImagePath" />
+                </div>
+                <div class="info">
+                    <img class="tag" src="../static/svg/icon-nft.svg" />
+                    <div class="title">{{detail.nftProjectName}}</div>
+                    <button class="buy" @click="installExtension">Install Denet to Buy</button>
+                </div>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import axios from 'axios'
+import Cookies from 'js-cookie'
+
+const api = {
+	prod: 'https://api.denetme.net',
+	pre: 'https://preapi.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]
+
+export default {
+    name: 'ntf',
+    data() {
+        return {
+            isLoading: true,
+            appVersionCode: 3,
+            jumpUrl: jumpUrl,
+            detail: {},
+            config: {},
+            title: 'DeNet Giveaway',
+            metaTitle: 'DeNet: An Easy Web3 Tool For GIVEAWAY / AIRDROP',
+        }
+    },
+    head() {
+		return {
+			type: '',
+			title: this.title,
+			appVersionCode: 3,
+			meta: [
+				// facebook 
+				{
+					name: 'og:url',
+					content: this.jumpUrl + 'nft/' + this.$route.params.id
+				},
+				{
+					name: 'og:title',
+					content: this.metaTitle
+				},
+				{
+					name: 'og:image',
+					content: this.detail.linkImagePath || ''
+				},
+				// twitter
+				{
+					name: 'twitter:card',
+					content: 'summary_large_image'
+				},
+				{
+					name: 'twitter:url',
+					content: this.jumpUrl + 'nft/' + this.$route.params.id
+				},
+				{
+					name: 'twitter:title',
+					content: this.metaTitle
+				},
+				{
+					name: 'twitter:image',
+					content: this.detail.linkImagePath || ''
+				}
+			]
+		}
+	},
+    mounted() {
+        this.setCookieMid();
+        this.getConfig();
+        this.getData();
+    },
+    methods: {
+        getData() {
+            if (this.$route.params && this.$route.params.id) {
+                axios.post(`${baseURL}/denet/nft/project/getNftProjectInfo`, {
+                    baseInfo: {
+                        appVersionCode: this.appVersionCode,
+                        mid: this.mid
+                    },
+                    params: {
+                        nftProjectId: this.$route.params.id || ''
+                    }
+                }).then(res => {
+                    let { code, data } = res.data;
+                    if (code === 0) {
+                        this.detail = data;
+                        this.isLoading = false;
+                    }
+                })
+            }
+        },
+        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);
+			});
+		},
+        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 })
+			}
+		},
+        installExtension() {
+            let { extensionsInstallUrl } = this.config;
+            window.open(extensionsInstallUrl)
+        },
+        async getConfig() {
+			let { data } = await axios.post(`${baseURL}/denet/base/config/getFrontConfig`, {
+				baseInfo: {
+					appVersionCode: this.appVersionCode,
+					mid: this.mid
+				},
+				params: {}
+			})
+			if (data.code == 0) {
+				this.config = data.data;
+			}
+		},
+    }
+}
+</script>
+
+<style lang="scss">
+html,
+body,
+#__nuxt,
+#__layout {
+	width: 100%;
+	height: 100%;
+	padding: 0;
+	margin: 0;
+}
+
+.nft-content {
+    overflow: hidden;
+    width: 100%;
+    height: 100%;
+    background: linear-gradient(180deg, #FFFFFF 0%, #F0F7FE 94.31%);
+    .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);
+        .loading {
+            margin: auto;
+            width: 40px;
+            border-radius: 50%;
+        }
+        .center {
+            display: flex;
+            margin: -50px auto 0;
+            max-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 {
+                    font-size: 3.6vw;
+                    font-family: 'SF Pro Display';
+                    font-weight: bold;
+                    word-break: break-word;
+                }
+                .buy {
+                    overflow: hidden;
+                    width: 55%;
+                    height: 3.5vw;
+                    border: 0;
+                    margin-top: .6vw;
+                    color: #FFFFFF;
+                    font-size: 1vw;
+                    font-weight: 700;
+                    background: #1D9BF0;
+                    border-radius: 1000px;
+                }
+            }
+        }
+    }
+}
+</style>

BIN
static/subject/img-example.png


+ 6 - 0
static/svg/icon-loading.svg

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="margin: auto; background: rgb(255, 255, 255); display: block; shape-rendering: auto;" width="200px" height="200px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">
+<circle cx="50" cy="50" fill="none" stroke="#389aff" stroke-width="12" r="35" stroke-dasharray="164.93361431346415 56.97787143782138">
+  <animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform>
+</circle>
+<!-- [ldio] generated by https://loading.io/ --></svg>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1 - 0
static/svg/icon-nft.svg


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác