File was renamed from src/pages/home/desktop/App.vue |
| | |
| | | mounted() { |
| | | document.getElementById('app').style.backgroundImage = process.env.VUE_APP_MAIN_URL; |
| | | let _that = this; |
| | | // eslint-disable-next-line |
| | | axios.get(process.env.VUE_APP_USER_DATA_URL).then(function (res) { |
| | | if (res.data.success) { |
| | | res.data.data.docks.forEach(function (item) { |
| | | _that.$store.commit('desktop/addDock', item); |
| | | }); |
| | | } |
| | | setTimeout(function () { |
| | | _that.$refs.dock_model.initDockItem(); |
| | | }, 100); |
| | | }); |
| | | // eslint-disable-next-line |
| | | axios.get(process.env.VUE_APP_MESSAGE_URL).then(function (res) { |
| | | if (res.data.success) { |
| | | res.data.data.forEach(function (item) { |
| | | _that.addMessage(item); |
| | | }) |
| | | } |
| | | }); |
| | | // eslint-disable-next-line |
| | | axios.get(process.env.VUE_APP_WEATHER_URL).then(function (res) { |
| | | if (res.data.success) { |
| | | _that.addWeather(res.data.data); |
| | | } |
| | | }); |
| | | let user_res = require("./mock/userData.json") |
| | | if (user_res.success) { |
| | | user_res.data.docks.forEach(function (item) { |
| | | _that.$store.commit('desktop/addDock', item); |
| | | }); |
| | | } |
| | | |
| | | setTimeout(function () { |
| | | _that.$refs.dock_model.initDockItem(); |
| | | }, 100); |
| | | // axios.get(process.env.VUE_APP_USER_DATA_URL).then(function (res) { |
| | | |
| | | // }); |
| | | |
| | | let msgResp = require("./mock/messages.json") |
| | | if (msgResp.success) { |
| | | msgResp.data.forEach(function (item) { |
| | | _that.addMessage(item); |
| | | }) |
| | | } |
| | | // axios.get(process.env.VUE_APP_MESSAGE_URL).then(function (res) { |
| | | |
| | | // }); |
| | | |
| | | let weather = require("./mock/weather.json") |
| | | if (weather.success) { |
| | | _that.addWeather(weather.data.data); |
| | | } |
| | | // axios.get(process.env.VUE_APP_WEATHER_URL).then(function (res) { |
| | | |
| | | // }); |
| | | |
| | | setTimeout(function () { |
| | | _that.addMessage({ |
| | |
| | | }, true); |
| | | }, 6000); |
| | | |
| | | console.log(this.$store.state.desktop) |
| | | }, |
| | | methods: { |
| | | addMessage: function (message, ding) { |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | background-size: 100% 100%; |
| | | background-image: url("../../../assets/img/desktop/main.jpg"); |
| | | } |
| | | </style> |