App.vue 10.1 KB
Newer Older
yma16's avatar
yma16 已提交
1
<template>
Y
yma16 已提交
2
  <div id="app">
yma16's avatar
yma16 已提交
3
    <el-container>
Y
yma16 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 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 101 102 103 104 105 106 107 108
      <el-aside v-if="navigate_flag ? false : true">
        <router-link to="/">
          <svg
            class="icon"
            aria-hidden="true"
            style="width: auto; height: auto; padding-top: 5%"
          >
            <use xlink:href="#iconshejitouxiangai"></use>
          </svg>
        </router-link>
        <el-menu
          default-active=""
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-user-solid"></i>
              <span slot="title">开发人员</span>
            </template>
            <el-menu-item-group>
              <el-submenu index="1-1">
                <template slot="title">yma16</template>
                <el-menu-item index="1-1-1">stay hungry</el-menu-item>
                <a @click="toecharts">
                  <el-menu-item index="1-1-2">echarts</el-menu-item>
                </a>
                <a @click="toadmin">
                  <el-menu-item index="1-1-3">superuser</el-menu-item>
                </a>
              </el-submenu>
              <el-submenu index="1-2">
                <template slot="title">location</template>
                <el-menu-item index="1-2-1" @click="jumpRouter('Home')"
                  >guiyang</el-menu-item
                >
              </el-submenu>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-setting"></i>管理后台</template
            >
            <el-menu-item-group>
              <el-submenu index="2-1">
                <template slot="title">登录</template>
              </el-submenu>
              <el-submenu index="2-2">
                <template slot="title">注册</template>
              </el-submenu>
            </el-menu-item-group>
          </el-submenu>

          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-chat-line-round" :click="onlinewebsocket"></i
              >线上聊天</template
            >
          </el-submenu>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header>
          <a v-on:click="changeNavigate" style="cursor: pointer"
            ><i class="el-icon-s-promotion"></i>&nbsp;&nbsp;<span
              style="font-weight: bold"
              >{{ authSlogan }}</span
            ></a
          >
          <i style="font-weight: bold; font-style: normal" v-if="chat_flag"
            >&nbsp;&nbsp;在线聊天室</i
          >
          <div style="float: right; overflow: hidden; align-height: 60px">
            <a href="https://codechina.csdn.net/qq_38870145/myblogvue"
              ><img
                src="@/assets/img/code-china.png"
                style="cursor: pointer; height: 24px"
            /></a>
            <a href="https://github.com/yongma16"
              ><img
                src="@/assets/img/github-fill.png"
                style="cursor: pointer; height: 24px"
            /></a>
          </div>

          <!-- <a v-on:click="changeNavigate"><i class="el-icon-menu"></i></a> -->
        </el-header>

        <el-main id="mainappid" class="mainappclass">
          <!-- 路由 -->
          <router-view />
        </el-main>

        <el-footer>
          <div class="footer_font">
            <div style="float: left"></div>
            Copyright &copy;2022 yongma16.xyz&nbsp;&nbsp;&nbsp;浏览量:{{
              readCount
            }}
          </div>
        </el-footer>
      </el-container>
yma16's avatar
yma16 已提交
109 110
    </el-container>
    <!-- <img src="./assets/logo.png"> -->
Y
yma16 已提交
111
  </div>
yma16's avatar
yma16 已提交
112 113 114
</template>

<script>
Y
yma16 已提交
115
import axios from "axios";
yma16's avatar
yma16 已提交
116
export default {
Y
yma16 已提交
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
  name: "App",
  data() {
    return {
      authSlogan: "Yma16",
      chat_flag: false,
      msg: "yma16",
      navigate_flag: true,
      value: new Date(),
      baseurl: "http://114.116.52.53/",
      // baseurl: 'http://yongma16.xyz/',
      src: "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
      url: "/image/logo/logo.jpg",
      srcList: [
        "https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
        "https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
      ],
      headerData: ["从现在开始,种一棵树", "从现在开始,种一棵树"],
      readCount: 0,
    };
  },
  mounted() {
    this.addReadCountFun();
    this.readCountFun();
  },
  methods: {
    addReadCountFun: function () {
      console.log("addfun");
      let clientip = "未知";
      try {
        console.log("ip待定");
      } catch (e) {
        console.log(e);
      }
      console.log("最终ip", clientip);
      axios
        .post(this.baseurl + "count/add/", {
          ip: clientip,
        })
        .then((res) => {
          console.log(res);
        })
        .catch((e) => {
          console.log(e);
        });
yma16's avatar
yma16 已提交
161
    },
Y
yma16 已提交
162 163 164 165 166 167 168 169 170 171 172
    readCountFun: function () {
      let that = this;
      axios
        .get(that.baseurl + "count/get/")
        .then((res) => {
          console.log(res, "count");
          this.readCount = res.data.num;
        })
        .catch((error) => {
          console.log(error);
        });
yma16's avatar
yma16 已提交
173
    },
Y
yma16 已提交
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
    changeNavigate: function () {
      this.navigate_flag = !this.navigate_flag; // 取反
    },

    handleOpen(key, keyPath) {
      console.log(key, keyPath);
      if (key === "3") {
        console.log("打开3号");
        this.chat_flag = true;
        this.onlinewebsocket(); // 调用跳转
      }
      if (key === "2-1") {
        this.chat_flag = false;
        this.loginAction(); // 调用跳转
      }
      if (key === "2-2") {
        this.chat_flag = false;
        this.registerAction(); // 调用跳转
      }
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
      console.log("关闭");
      if (key === "3") {
        this.chat_flag = false;
      }
    },
    jumpRouter: function (params) {
      this.$router
        .push({
          name: `${params}`,
        })
        .catch((error) => {
          console.log(error);
        });
    },
    onlinewebsocket: function () {
      // console.log(this.$router);
      this.$router
        .push({
          path: "/onlinewebsocket",
        })
        .catch((error) => {
          console.log(error);
        });
    },
    toecharts: function () {
      // console.log(this.$router);
      this.$router
        .push({
          path: "/bilicom",
        })
        .catch((error) => {
          console.log(error);
        });
    },
    toadmin: function () {
      this.$router
        .push({
          path: "/mavoneditor",
        })
        .catch((error) => {
          console.log(error);
        });
    },
    loginAction: function () {
      this.$router
        .push({
          path: "/login",
        })
        .catch((error) => {
          console.log(error);
        });
    },
    registerAction: function () {
      this.$router
        .push({
          path: "/register",
        })
        .catch((error) => {
          console.log(error);
        });
    },
  },
};
yma16's avatar
yma16 已提交
259 260 261 262 263 264 265
</script>

<style>
html,
body,
#app,
.el-container {
Y
yma16 已提交
266 267 268 269 270 271
  margin: 0px;
  padding: 0%;
  border: 0px;
  height: 100%;
  /* background: url(../static/utils/fx_background/image/gg.jpg) center top no-repeat; */
  /* background: url(/image/snow/gg.jpg) center top no-repeat; */
yma16's avatar
yma16 已提交
272 273 274
}

body {
Y
yma16 已提交
275 276
  background-color: #2f214b;
  /* background: url(/image/snow/gg.jpg) center top no-repeat; */
yma16's avatar
yma16 已提交
277 278 279
}

.el-header {
Y
yma16 已提交
280 281 282 283 284
  background-color: #d4beb4;
  /* color: rgb(48, 76, 77); */
  text-align: left;
  line-height: 60px;
  /* background: url(/image/snow/gg.jpg) center top no-repeat; */
yma16's avatar
yma16 已提交
285 286 287
}

.footer_font {
Y
yma16 已提交
288 289 290 291 292
  position: relative;
  top: 25%;
  /* height: 100%; */
  margin: 0;
  padding: 0;
yma16's avatar
yma16 已提交
293 294 295
}

.el-footer {
Y
yma16 已提交
296 297 298 299 300 301
  height: 100%;
  background-color: #bba8a4;
  color: #333;
  text-align: center;
  /* line-height: 60px; */
  box-sizing: border-box;
yma16's avatar
yma16 已提交
302 303 304
}

.el-aside {
Y
yma16 已提交
305 306 307 308 309 310
  background-color: #be9a90;
  color: #333;
  text-align: center;
  line-height: 80px;
  width: 80px;
  min-height: 60px;
yma16's avatar
yma16 已提交
311 312 313
}

.activeleft {
Y
yma16 已提交
314 315
  transform: translateX(-100vw);
  /* 左移100 */
yma16's avatar
yma16 已提交
316 317 318
}

.activeright {
Y
yma16 已提交
319 320
  transform: translateX(100vw);
  /* 右移100 */
yma16's avatar
yma16 已提交
321 322 323
}

.el-main {
Y
yma16 已提交
324 325 326 327 328 329
  /* background-color: #e9eef3; */
  text-align: left;
  opacity: 1;
  /* background: url(../static/utils/fx_background/image/gg.jpg) center top no-repeat; */
  margin: 0;
  padding: 0;
yma16's avatar
yma16 已提交
330 331 332
}

.mainappclass {
Y
yma16 已提交
333 334 335
  margin: 0;
  padding: 0;
  overflow: auto;
yma16's avatar
yma16 已提交
336 337 338
}

.mainappclass::-webkit-scrollbar {
Y
yma16 已提交
339
  display: none;
yma16's avatar
yma16 已提交
340 341
}

Y
yma16 已提交
342 343 344 345 346
body > .el-container {
  color: #475669;
  opacity: 0.5;
  padding: 0%;
  margin-bottom: 40px;
yma16's avatar
yma16 已提交
347 348 349 350
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
Y
yma16 已提交
351
  line-height: 260px;
yma16's avatar
yma16 已提交
352 353 354
}

.el-container:nth-child(7) .el-aside {
Y
yma16 已提交
355
  line-height: 320px;
yma16's avatar
yma16 已提交
356 357 358
}

.el-carousel__item h3 {
Y
yma16 已提交
359 360 361 362 363
  color: #475669;
  font-size: 14px;
  opacity: 0.5;
  line-height: 150px;
  margin: 0;
yma16's avatar
yma16 已提交
364 365 366
}

.el-carousel__item:nth-child(2n) {
Y
yma16 已提交
367 368
  /* background-image: url("/image/navigation/previewFix.jpg"); */
  transition-duration: 2s;
yma16's avatar
yma16 已提交
369 370 371
}

.el-carousel__item:nth-child(2n + 1) {
Y
yma16 已提交
372 373
  /* background-image: url("/image/navigation/original.jpg"); */
  transition-duration: 2s;
yma16's avatar
yma16 已提交
374 375 376
}

.footerclass {
Y
yma16 已提交
377 378
  position: relative;
  display: flex;
yma16's avatar
yma16 已提交
379 380 381
}

.midfooter {
Y
yma16 已提交
382 383 384 385
  position: relative;
  left: 50%;
  top: 50%;
  transform: translateX(-50%, -50%);
yma16's avatar
yma16 已提交
386 387 388
}

.heart {
Y
yma16 已提交
389 390 391 392 393 394 395 396
  width: 30px;
  height: 30px;
  position: relative;
  background: pink;
  transform: rotate(45deg);
  animation-name: change;
  animation-duration: 2s;
  animation-iteration-count: infinite;
yma16's avatar
yma16 已提交
397 398 399
}

.heart::before {
Y
yma16 已提交
400 401 402 403 404 405 406
  content: "";
  width: 30px;
  height: 30px;
  background: pink;
  border-radius: 50%;
  position: absolute;
  transform: translateX(-15px);
yma16's avatar
yma16 已提交
407 408 409
}

.heart::after {
Y
yma16 已提交
410 411 412 413 414 415 416 417 418
  content: "";
  width: 30px;
  height: 30px;
  background: pink;
  border-radius: 50%;
  position: absolute;
  /* 定位 */
  transform: translate(0px, -15px);
  /* transform: translateX(-100px); */
yma16's avatar
yma16 已提交
419 420 421
}

@keyframes change {
Y
yma16 已提交
422 423 424
  0% {
    transform: rotate(45deg) scale(0.25);
  }
yma16's avatar
yma16 已提交
425

Y
yma16 已提交
426 427 428
  50% {
    transform: rotate(45deg) scale(0.5);
  }
yma16's avatar
yma16 已提交
429

Y
yma16 已提交
430 431 432
  100% {
    transform: rotate(45deg) scale(0.25);
  }
yma16's avatar
yma16 已提交
433 434 435
}

@keyframes backdiv {
Y
yma16 已提交
436 437 438
  50% {
    background: #ffe6f2;
  }
yma16's avatar
yma16 已提交
439 440
}
</style>