airDropPool.vue 5.04 KB
Newer Older
xulili's avatar
xulili committed
1 2 3 4 5 6 7
<template>
  <div class="air-drop-pool">
    <div class="nav">
      <van-icon
        name="arrow-left"
        size="20"
        class="nav-left"
leiqingsong's avatar
leiqingsong committed
8
        @click="handlerBack"
xulili's avatar
xulili committed
9 10 11 12
      />
      <span class="nav-title">空投池</span>
    </div>
    <div class="air-panel-box">
leiqingsong's avatar
leiqingsong committed
13 14 15
      <div class="air-panel">
        <div class="notice-bar">
          <img src="@/assets/images/icon-notice.png" alt="" />
xulili's avatar
xulili committed
16 17 18 19 20 21 22 23 24
          <div class="notice-bar-show" id="scroll-box">
            <div class="user-id-list">
              <p v-for="(item, index) in userPoolVos" :key="index">
                {{ item.userId }}
              </p>
              <p v-for="(item, index) in userPoolVos" :key="index + 'us'">
                {{ item.userId }}
              </p>
            </div>
leiqingsong's avatar
leiqingsong committed
25
          </div>
xulili's avatar
xulili committed
26
        </div>
leiqingsong's avatar
leiqingsong committed
27
      </div>
xulili's avatar
xulili committed
28 29
    </div>
    <div class="air-panel-num">
leiqingsong's avatar
leiqingsong committed
30 31 32
      <div class="air-panel-num-content">
        <img src="@/assets/images/parachute.png" alt="" />
        <p>
xulili's avatar
xulili committed
33
          本月<span>{{ total }}</span> 人在池
leiqingsong's avatar
leiqingsong committed
34 35
        </p>
      </div>
xulili's avatar
xulili committed
36 37 38 39 40
    </div>
  </div>
</template>

<script>
xulili's avatar
xulili committed
41
import { queryAerialDelivery } from "@/api/airDropPool";
xulili's avatar
xulili committed
42
export default {
leiqingsong's avatar
leiqingsong committed
43
  name: "AirDrop",
xulili's avatar
xulili committed
44 45
  data() {
    return {
xulili's avatar
xulili committed
46
      total: 0,
leiqingsong's avatar
leiqingsong committed
47
      userPoolVos: [],
xulili's avatar
xulili committed
48
      timer: null
leiqingsong's avatar
leiqingsong committed
49
    };
xulili's avatar
xulili committed
50
  },
xulili's avatar
xulili committed
51 52 53 54
  mounted() {
    this.queryData();
  },
  methods: {
leiqingsong's avatar
leiqingsong committed
55 56 57 58 59 60 61 62
    handlerBack() {
      try {
        this.$bridgeToAppFun.navigateBack();
      } catch {
        console.log("不能和App交互");
        this.$router.go(-1);
      }
    },
xulili's avatar
xulili committed
63 64 65
    queryData() {
      const _this = this;
      queryAerialDelivery().then(res => {
leiqingsong's avatar
leiqingsong committed
66
        console.log("空投池", res);
xulili's avatar
xulili committed
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
        if (res.code === 0) {
          _this.total = res.data.total;
          _this.userPoolVos = res.data.userPoolVos;
          _this.$nextTick(() => {
            _this.scroll();
          });
        } else {
          _this.$toast(res.msg);
        }
      });
    },
    scroll() {
      this.timer = setInterval(this.autoScrollLine, 100);
    },
    autoScrollLine() {
      let box = document.getElementById("scroll-box");
      let parent = document.getElementsByClassName("user-id-list")[0];
      const _this = this;
      if (box) {
        if (box.scrollTop != null && box.scrollTop >= parent.offsetHeight) {
          box.scrollTop = 0;
        } else {
          box.scrollTop += 1;
        }
        if (box.scrollTop % box.offsetHeight == 0) {
          clearInterval(_this.timer);
          box.scrollTop = 0;
          setTimeout(() => {
            _this.timer = setInterval(_this.autoScrollLine, 100);
          }, 0);
        }
      }
    }
  }
xulili's avatar
xulili committed
101 102 103 104 105
};
</script>

<style lang="scss" scoped>
$white: #ffffff;
leiqingsong's avatar
leiqingsong committed
106
.air-drop-pool {
xulili's avatar
xulili committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
  width: 100%;
  height: 100vh;
  background-image: url("../assets/images/空投池背景.png");
  background-size: cover;
  .nav {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 46px;
    color: #333333;
    .nav-left {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 52px;
      height: 100%;
      line-height: 46px;
      text-align: center;
    }
    .nav-title {
      max-width: 60%;
      margin: 0 auto;
      font-weight: bold;
      font-size: 16px;
    }
  }
leiqingsong's avatar
leiqingsong committed
134 135 136 137 138 139 140 141 142 143 144 145 146 147
  .air-panel-box {
    padding: 25px 15px 0px 15px;
    box-sizing: border-box;
    .air-panel {
      height: 110px;
      background-color: #ffffff;
      box-shadow: 0px 2px 12px 0px rgba(6, 0, 1, 0.04);
      border-radius: 4px;
    }
  }
  .air-panel-num {
    padding: 10px 15px 15px 15px;
    box-sizing: border-box;
    height: calc(100vh - 220px);
xulili's avatar
xulili committed
148
  }
leiqingsong's avatar
leiqingsong committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
  .air-panel-num-content {
    padding: 20px 15px;
    height: 100%;
    box-shadow: 0px 2px 12px 0px rgba(6, 0, 1, 0.04);
    border-radius: 4px;
    background-size: cover;
    background-color: #ffffff;
    img {
      object-fit: contain;
      width: 100%;
      height: 100%;
    }
    p {
      font-size: 16px;
      font-weight: normal;
      font-stretch: normal;
      color: #333333;
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      align-items: center;
    }
    span {
      font-size: 32px;
      font-weight: normal;
      font-stretch: normal;
      letter-spacing: -1px;
      color: #333333;
      margin: 0 20px;
    }
xulili's avatar
xulili committed
181
  }
leiqingsong's avatar
leiqingsong committed
182 183 184 185 186 187
  .notice-bar {
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 20px 0 50px;
xulili's avatar
xulili committed
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205
    position: relative;
    &::before,
    &::after {
      content: "";
      display: inline-block;
      width: calc(100% - 81px);
      height: 33.33%;
      position: absolute;
      background-color: #ffffff;
      opacity: 0.4;
      left: 81px;
    }
    &::before {
      top: 0;
    }
    &::after {
      top: 66.66%;
    }
leiqingsong's avatar
leiqingsong committed
206 207 208
    img {
      width: 16px;
      margin-right: 15px;
xulili's avatar
xulili committed
209
    }
leiqingsong's avatar
leiqingsong committed
210 211
    .notice-bar-show {
      height: 100%;
xulili's avatar
xulili committed
212 213
      overflow: scroll;

leiqingsong's avatar
leiqingsong committed
214 215
      p {
        font-size: 16px;
xulili's avatar
xulili committed
216 217
        color: #999;
        height: 36.6px;
leiqingsong's avatar
leiqingsong committed
218 219
        margin: 0;
        padding: 0;
xulili's avatar
xulili committed
220 221
        display: flex;
        align-items: center;
leiqingsong's avatar
leiqingsong committed
222 223 224 225 226
        color: #333;
      }
      .dark {
        opacity: 0.4;
      }
xulili's avatar
xulili committed
227
    }
leiqingsong's avatar
leiqingsong committed
228
  }
xulili's avatar
xulili committed
229 230
}
</style>