Browse Source

feat: 完成空投管理首页

million 2 years ago
parent
commit
776047afe5

+ 1 - 0
front/admin-front/.eslintignore

@@ -2,3 +2,4 @@ build/*.js
 src/assets
 public
 dist
+*

+ 1 - 1
front/admin-front/package.json

@@ -4,7 +4,7 @@
   "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint",
   "author": "Pan <panfree23@gmail.com>",
   "scripts": {
-    "dev": "vue-cli-service serve --mode dev",
+    "dev": "vue-cli-service serve --mode test",
     "build:prod": "vue-cli-service build --mode prod",
     "build:test": "vue-cli-service build --mode test",
     "preview": "node build/index.js --preview",

+ 2 - 2
front/admin-front/src/api/constant.js

@@ -2,5 +2,5 @@ export default {
   baseUrl: process.env.VUE_APP_BASE_API,
   baseIp: process.env.VUE_APP_BASE_IP,
   systemId: "90703bb0ee2883f1a0c70bd28cf261cd",
-  systemGroupId: "bc2bf74753bb410687d2557da6dbfd3e",
-};
+  systemGroupId: "7651d3cf64e941f38aaff653049a129c",
+};

+ 8 - 0
front/admin-front/src/assets/airdrop/add.svg

@@ -0,0 +1,8 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_608_2" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
+<rect width="20" height="20" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_608_2)">
+<path d="M9.16663 15.8334V10.8334H4.16663V9.16669H9.16663V4.16669H10.8333V9.16669H15.8333V10.8334H10.8333V15.8334H9.16663Z" fill="white"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/airdrop/airline_seat_recline_extra.svg

@@ -0,0 +1,8 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_131_376" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="16">
+<rect width="16" height="16" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_131_376)">
+<path d="M5.66667 4.00004C5.3 4.00004 4.98611 3.86949 4.725 3.60837C4.46389 3.34726 4.33333 3.03337 4.33333 2.66671C4.33333 2.30004 4.46389 1.98615 4.725 1.72504C4.98611 1.46393 5.3 1.33337 5.66667 1.33337C6.03333 1.33337 6.34722 1.46393 6.60833 1.72504C6.86944 1.98615 7 2.30004 7 2.66671C7 3.03337 6.86944 3.34726 6.60833 3.60837C6.34722 3.86949 6.03333 4.00004 5.66667 4.00004ZM9.33333 13.3334H5.03333C4.66667 13.3334 4.33056 13.2028 4.025 12.9417C3.71944 12.6806 3.52778 12.3667 3.45 12L2 4.66671H3.36667L4.83333 12H9.33333V13.3334ZM13 14.6667L11.0667 11.3334H6.43333C6.11111 11.3334 5.83056 11.2362 5.59167 11.0417C5.35278 10.8473 5.2 10.5889 5.13333 10.2667L4.4 6.70004C4.27778 6.16671 4.40278 5.69449 4.775 5.28337C5.14722 4.87226 5.6 4.66671 6.13333 4.66671C6.52222 4.66671 6.875 4.78337 7.19167 5.01671C7.50833 5.25004 7.71111 5.56671 7.8 5.96671L8.53333 9.33337H10.7C10.9333 9.33337 11.15 9.39449 11.35 9.51671C11.55 9.63893 11.7111 9.80004 11.8333 10L14.1667 14L13 14.6667Z" fill="#222222"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/airdrop/airplanemode_active.svg

@@ -0,0 +1,8 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_131_385" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="16">
+<rect width="16" height="16" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_131_385)">
+<path d="M5.66665 14.6667V13.6667L6.99998 12.6667V9.00004L1.33331 10.6667V9.33337L6.99998 6.00004V2.33337C6.99998 2.0556 7.0972 1.81949 7.29165 1.62504C7.48609 1.4306 7.7222 1.33337 7.99998 1.33337C8.27776 1.33337 8.51387 1.4306 8.70831 1.62504C8.90276 1.81949 8.99998 2.0556 8.99998 2.33337V6.00004L14.6666 9.33337V10.6667L8.99998 9.00004V12.6667L10.3333 13.6667V14.6667L7.99998 14L5.66665 14.6667Z" fill="#2980FF"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/airdrop/dangerous.svg

@@ -0,0 +1,8 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_131_394" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="16">
+<rect width="16" height="16" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_131_394)">
+<path d="M5.5 14L2 10.5V5.5L5.5 2H10.5L14 5.5V10.5L10.5 14H5.5ZM6.1 10.8333L8 8.93333L9.9 10.8333L10.8333 9.9L8.93333 8L10.8333 6.1L9.9 5.16667L8 7.06667L6.1 5.16667L5.16667 6.1L7.06667 8L5.16667 9.9L6.1 10.8333Z" fill="#EB5757"/>
+</g>
+</svg>

+ 8 - 0
front/admin-front/src/assets/airdrop/file_download_done.svg

@@ -0,0 +1,8 @@
+<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
+<mask id="mask0_131_353" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="16" height="16">
+<rect width="16" height="16" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_131_353)">
+<path d="M3.33332 13.3334V12H12.6667V13.3334H3.33332ZM6.36665 10.6667L2.56665 6.87004L3.51665 5.91669L6.36665 8.76669L12.4811 2.65002L13.4333 3.60002L6.36665 10.6667Z" fill="#828282"/>
+</g>
+</svg>

+ 10 - 0
front/admin-front/src/assets/airdrop/filter_list.svg

@@ -0,0 +1,10 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g opacity="0.8">
+<mask id="mask0_131_241" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
+<rect width="20" height="20" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_131_241)">
+<path d="M8.54169 14.7917V13.5417H11.4583V14.7917H8.54169ZM5.20836 10.4647V9.21476H14.7916V10.4647H5.20836ZM2.70835 6.1378V4.88782H17.2916V6.1378H2.70835Z" fill="#222222"/>
+</g>
+</g>
+</svg>

+ 10 - 0
front/admin-front/src/assets/airdrop/unfold_more.svg

@@ -0,0 +1,10 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g opacity="0.8">
+<mask id="mask0_131_246" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="20" height="20">
+<rect width="20" height="20" fill="#D9D9D9"/>
+</mask>
+<g mask="url(#mask0_131_246)">
+<path d="M10 17.1955L6.52246 13.7179L7.42627 12.8141L10 15.3878L12.5737 12.8141L13.4775 13.7179L10 17.1955ZM7.42627 7.23715L6.52246 6.33332L10 2.85577L13.4775 6.33332L12.5737 7.23715L10 4.66342L7.42627 7.23715Z" fill="#222222"/>
+</g>
+</g>
+</svg>

+ 2 - 2
front/admin-front/src/layout/components/Sidebar/index.vue

@@ -95,7 +95,7 @@ export default {
 <style lang="scss" scoped>
 .hamburger {
   position: absolute;
-  top: 90.2%;
+  bottom: 10%;
 }
 .divider {
   width: 360px;
@@ -132,4 +132,4 @@ export default {
   cursor: pointer;
   margin-left: -20px;
 }
-</style>
+</style>

+ 53 - 54
front/admin-front/src/router/index.js

@@ -56,25 +56,25 @@ export const constantRoutes = [{
       }
     }]
   },
-  {
-    path: '/user',
-    component: Layout,
-    props: true,
-    meta: {
-      roles: ['admin'],
-      title: "用户管理",
-      icon: 'user',
-    },
-    children: [{
-      path: 'index',
-      name: 'user',
-      component: () => import('@/views/user/index'),
-      meta: {
-        title: '用户管理',
-        icon: 'user'
-      }
-    }]
-  },
+  // {
+  //   path: '/user',
+  //   component: Layout,
+  //   props: true,
+  //   meta: {
+  //     roles: ['admin'],
+  //     title: "用户管理",
+  //     icon: 'user',
+  //   },
+  //   children: [{
+  //     path: 'index',
+  //     name: 'user',
+  //     component: () => import('@/views/user/index'),
+  //     meta: {
+  //       title: '用户管理',
+  //       icon: 'user'
+  //     }
+  //   }]
+  // },
   // {
   //   path: '/role',
   //   component: Layout,
@@ -87,30 +87,30 @@ export const constantRoutes = [{
   //     }
   //   ]
   // },
-  {
-    path: '/sys-param',
-    component: Layout,
-    meta: {
-      roles: ['admin'],
-      title: "系统参数",
-      icon: 'sys-param',
-    },
-    children: [{
-      path: 'index',
-      name: 'sys-param',
-      component: () => import('@/views/sys-param/index'),
-      meta: {
-        title: '系统参数',
-        icon: 'sys-param'
-      }
-    }]
-  },
+  // {
+  //   path: '/sys-param',
+  //   component: Layout,
+  //   meta: {
+  //     roles: ['admin'],
+  //     title: "系统参数",
+  //     icon: 'sys-param',
+  //   },
+  //   children: [{
+  //     path: 'index',
+  //     name: 'sys-param',
+  //     component: () => import('@/views/sys-param/index'),
+  //     meta: {
+  //       title: '系统参数',
+  //       icon: 'sys-param'
+  //     }
+  //   }]
+  // },
 
   {
     path: '/autoplay',
     component: Layout,
     meta: {
-      title: '自动化交互',
+      title: '交互管理',
       icon: 'autoplay'
     },
     children: [{
@@ -118,7 +118,7 @@ export const constantRoutes = [{
       name: 'autoplay',
       component: () => import('@/views/autoplay/index'),
       meta: {
-        title: '自动化交互',
+        title: '交互管理',
         icon: 'autoplay'
       }
     }]
@@ -137,20 +137,19 @@ export const constantRoutes = [{
       }
     }]
   },
-  {
-    path: '/strategy',
-    component: Layout,
-    children: [{
-      path: 'index',
-      name: 'strategy',
-      component: () => import('@/views/strategy/index'),
-      meta: {
-        title: '策略管理',
-        icon: 'strategy'
-      }
-    }]
-  },
-
+  // {
+  //   path: '/strategy',
+  //   component: Layout,
+  //   children: [{
+  //     path: 'index',
+  //     name: 'strategy',
+  //     component: () => import('@/views/strategy/index'),
+  //     meta: {
+  //       title: '策略管理',
+  //       icon: 'strategy'
+  //     }
+  //   }]
+  // },
   {
     path: '/address',
     component: Layout,
@@ -189,4 +188,4 @@ export function resetRouter() {
   router.matcher = newRouter.matcher // reset router
 }
 
-export default router
+export default router

+ 347 - 66
front/admin-front/src/views/airdrop/index.vue

@@ -1,49 +1,141 @@
 <template>
   <div class="app-container">
-    <el-form ref="form" :model="form" label-width="120px">
-      <el-form-item label="Activity name">
-        <el-input v-model="form.name" />
-      </el-form-item>
-      <el-form-item label="Activity zone">
-        <el-select v-model="form.region" placeholder="please select your zone">
-          <el-option label="Zone one" value="shanghai" />
-          <el-option label="Zone two" value="beijing" />
-        </el-select>
-      </el-form-item>
-      <el-form-item label="Activity time">
-        <el-col :span="11">
-          <el-date-picker v-model="form.date1" type="date" placeholder="Pick a date" style="width: 100%;" />
-        </el-col>
-        <el-col :span="2" class="line">-</el-col>
-        <el-col :span="11">
-          <el-time-picker v-model="form.date2" type="fixed-time" placeholder="Pick a time" style="width: 100%;" />
-        </el-col>
-      </el-form-item>
-      <el-form-item label="Instant delivery">
-        <el-switch v-model="form.delivery" />
-      </el-form-item>
-      <el-form-item label="Activity type">
-        <el-checkbox-group v-model="form.type">
-          <el-checkbox label="Online activities" name="type" />
-          <el-checkbox label="Promotion activities" name="type" />
-          <el-checkbox label="Offline activities" name="type" />
-          <el-checkbox label="Simple brand exposure" name="type" />
-        </el-checkbox-group>
-      </el-form-item>
-      <el-form-item label="Resources">
-        <el-radio-group v-model="form.resource">
-          <el-radio label="Sponsor" />
-          <el-radio label="Venue" />
-        </el-radio-group>
-      </el-form-item>
-      <el-form-item label="Activity form">
-        <el-input v-model="form.desc" type="textarea" />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" @click="onSubmit">Create</el-button>
-        <el-button @click="onCancel">Cancel</el-button>
-      </el-form-item>
-    </el-form>
+    <div class="app-container-head">
+      <div class="app-container-head-left">
+        <div class="app-container-head-left-item">
+          <div class="app-container-head-left-item-count">
+            {{ head.projectsNumber }}
+          </div>
+          <div class="app-container-head-left-item-name">
+            空投项目
+          </div>
+        </div>
+        <div class="app-container-head-left-divider"/>
+        <div class="app-container-head-left-item">
+          <div class="app-container-head-left-item-count">
+            {{ head.ongoingNumber }}
+          </div>
+          <div class="app-container-head-left-item-name">
+            正在进行
+          </div>
+        </div>
+      </div>
+      <div class="app-container-head-right">
+        <div class="app-container-head-right-button">
+          <img src="../../assets/airdrop/add.svg" alt="add">
+          添加项目
+        </div>
+      </div>
+    </div>
+    <div class="app-container-table">
+      <div class="app-container-table-title">
+        <div class="app-container-table-title-left">
+          空投列表
+        </div>
+        <div class="app-container-table-title-right">
+          总计数量: {{table.totalNumber}}
+        </div>
+      </div>
+      <div class="app-container-table-screening">
+        <div class="app-container-table-screening-item">
+          账号类型
+          <img src="../../assets/airdrop/filter_list.svg" alt="filter_list">
+        </div>
+        <div class="app-container-table-screening-item">
+          余额
+          <img src="../../assets/airdrop/unfold_more.svg" alt="unfold_more">
+        </div>
+      </div>
+      <div class="app-container-table-main">
+        <el-table
+          :data="tableData"
+          style="width: 100%">
+          <el-table-column
+            label="项目名称"
+            width="280">
+            <template v-slot="scope">
+              <div class="projectName">
+                {{scope.row.projectName}}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="任务总数/已完成"
+            width="385">
+            <template v-slot="scope">
+              <div class="progress">
+                <div class="score">
+                  {{scope.row.totalNumber}} / {{scope.row.completedNumber}}
+                </div>
+                <div class="progressBar">
+                  <el-progress :show-text="false" :stroke-width="12" :percentage="(scope.row.completedNumber/scope.row.totalNumber*100)"></el-progress>
+                </div>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="状态"
+            width="215">
+            <template v-slot="scope">
+              <div v-if="scope.row.status === 0" class="status-0" style="color: #828282">
+                <img src="../../assets/airdrop/file_download_done.svg" alt="file_download_done">
+                已空投
+              </div>
+              <div v-if="scope.row.status === 1" class="status-0" style="color: #EB5757">
+                <img src="../../assets/airdrop/dangerous.svg" alt="dangerous">
+                未空投
+              </div>
+              <div v-if="scope.row.status === 2" class="status-0" style="color: #2980FF">
+                <img src="../../assets/airdrop/airplanemode_active.svg" alt="airplanemode_active">
+                进行中
+              </div>
+              <div v-if="scope.row.status === 3" class="status-0" style="color: #222222">
+                <img src="../../assets/airdrop/airline_seat_recline_extra.svg" alt="airline_seat_recline_extra">
+                未开始
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="累计Gas"
+            width="170">
+            <template v-slot="scope">
+              <div class="gas">
+                {{scope.row.gas}}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="官网"
+            width="185">
+            <template v-slot="scope">
+              <div class="website">
+                <a target="_blank" :href="scope.row.officialWebsite">
+                  {{scope.row.officialWebsite}}
+                </a>
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="开始时间"
+            width="130">
+            <template v-slot="scope">
+              <div class="startTime">
+                {{scope.row.startTime}}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column
+            label="结束时间">
+            <template v-slot="scope">
+              <div class="endTime">
+                {{scope.row.endTime}}
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+    </div>
+
   </div>
 </template>
 
@@ -51,35 +143,224 @@
 export default {
   data() {
     return {
-      form: {
-        name: '',
-        region: '',
-        date1: '',
-        date2: '',
-        delivery: false,
-        type: [],
-        resource: '',
-        desc: ''
-      }
+      head: {
+        projectsNumber:85,
+        ongoingNumber:5
+      },
+      table:{
+        totalNumber:22222
+      },
+      tableData: [{
+        projectName:'Zk',
+        totalNumber:5,
+        completedNumber:2,
+        status:0,
+        gas:1,
+        officialWebsite:"https://nytimes.com",
+        startTime:'16/08/2013',
+        endTime:'16/08/2013'
+      }, {
+        projectName:'LayerZero',
+        totalNumber:4,
+        completedNumber:1,
+        status:1,
+        gas:23,
+        officialWebsite:"https://nytimes.com",
+        startTime:'16/08/2013',
+        endTime:'16/08/2013'
+      }, {
+        projectName:'StarkNet',
+        totalNumber:1,
+        completedNumber:0,
+        status:2,
+        gas:23,
+        officialWebsite:"https://nytimes.com",
+        startTime:'16/08/2013',
+        endTime:'16/08/2013'
+      }, {
+        projectName:'Sei',
+        totalNumber:3,
+        completedNumber:2,
+        status:3,
+        gas:23,
+        officialWebsite:"https://nytimes.com",
+        startTime:'16/08/2013',
+        endTime:'16/08/2013'
+      }]
     }
   },
   methods: {
-    onSubmit() {
-      this.$message('submit!')
-    },
-    onCancel() {
-      this.$message({
-        message: 'cancel!',
-        type: 'warning'
-      })
-    }
+
   }
 }
 </script>
 
-<style scoped>
-.line{
-  text-align: center;
+<style lang="scss" scoped>
+.app-container{
+  .app-container-head{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    .app-container-head-left{
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      gap:60px;
+      .app-container-head-left-item{
+        display: flex;
+        flex-direction: column;
+        gap:8px;
+        .app-container-head-left-item-count{
+          font-weight: 700;
+          font-size: 21px;
+          line-height: 28px;
+          color: #181818;
+        }
+        .app-container-head-left-item-name{
+          font-weight: 700;
+          font-size: 12px;
+          line-height: 16px;
+          color: #8e8f91;
+        }
+      }
+      .app-container-head-left-divider{
+        width: 1px;
+        height: 50px;
+        border-right:1px solid #e4e6ea;
+      }
+    }
+
+    .app-container-head-right{
+      .app-container-head-right-button{
+        width: 148px;
+        height: 52px;
+        display: flex;
+        flex-direction: row;
+        justify-content: center;
+        align-items: center;
+        gap: 4px;
+        background: #4A76FF;
+        border-radius: 10px;
+        font-weight: 700;
+        font-size: 15px;
+        line-height: 20px;
+        color: #FFFFFF;
+      }
+    }
+  }
+  .app-container-table{
+    margin-top: 80px;
+    .app-container-table-title{
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      .app-container-table-title-left{
+        font-weight: 700;
+        font-size: 21px;
+        line-height: 28px;
+        color: #181818;
+      }
+      .app-container-table-title-right{
+        font-weight: 400;
+        font-size: 21px;
+        line-height: 28px;
+        color: #898a8c;
+      }
+    }
+    .app-container-table-screening{
+      display: flex;
+      align-items: center;
+      gap:100px;
+      padding: 20px 0;
+      margin: 40px 0;
+      border-top: 1px solid #f5f5f5;
+      border-bottom: 1px solid #f5f5f5;
+      .app-container-table-screening-item{
+        display: flex;
+        align-items: center;
+        gap:6px;
+        font-weight: 400;
+        font-size: 15px;
+        line-height: 20px;
+        color: #4d4d4e;
+      }
+    }
+    .app-container-table-main {
+      .projectName{
+        font-weight: 700;
+        font-size: 17px;
+        line-height: 22px;
+        color: #222222;
+      }
+      .progress{
+        display: flex;
+        align-items: center;
+        gap: 30px;
+        .score{
+          font-weight: 700;
+          font-size: 17px;
+          line-height: 22px;
+          color: #222222;
+        }
+        .progressBar{
+          width: 160px;
+        }
+      }
+      .status-0{
+        width: 76px;
+        height: 26px;
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        gap:4px;
+        background: #F5F5F5;
+        border: 1px solid #2980FF;
+        border-radius: 26px;
+
+        font-weight: 400;
+        font-size: 12px;
+        line-height: 16px;
+      }
+      .gas{
+        font-weight: 700;
+        font-size: 17px;
+        line-height: 22px;
+        color: #181818;
+      }
+      .website{
+        font-weight: 400;
+        font-size: 12px;
+        line-height: 16px;
+        text-decoration-line: underline;
+        color: #2980FF;
+      }
+      .startTime{
+        font-weight: 400;
+        font-size: 14px;
+        line-height: 18px;
+        color: #898a8c;
+      }
+      .endTime{
+        font-weight: 400;
+        font-size: 14px;
+        line-height: 18px;
+        color: #898a8c;
+      }
+    }
+  }
+}
+::v-deep .el-table__row>td{
+  border: none;
+}
+::v-deep .el-table th.is-leaf{
+  border: none;
+  font-weight: 400;
+  font-size: 14px;
+  line-height: 18px;
+  color: #4d4d4e ;
+}
+::v-deep .el-table::before{
+  height: 0;
 }
 </style>