|
@@ -663,6 +663,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+import axios from "axios";
|
|
|
import { getUserInfo } from "@api/user";
|
|
import { getUserInfo } from "@api/user";
|
|
|
import { swiper, swiperSlide } from "vue-awesome-swiper";
|
|
import { swiper, swiperSlide } from "vue-awesome-swiper";
|
|
|
import "@assets/css/swiper.min.css";
|
|
import "@assets/css/swiper.min.css";
|
|
@@ -891,9 +892,11 @@ export default {
|
|
|
var processUri = function(params) {
|
|
var processUri = function(params) {
|
|
|
that.$router.push({ path: params.uri });
|
|
that.$router.push({ path: params.uri });
|
|
|
};
|
|
};
|
|
|
|
|
+ this.$store.commit("LOAD");
|
|
|
|
|
|
|
|
JPush.init(processUri);
|
|
JPush.init(processUri);
|
|
|
WeChat.init();
|
|
WeChat.init();
|
|
|
|
|
+ this.checkUpdate();
|
|
|
|
|
|
|
|
this.updateVIP();
|
|
this.updateVIP();
|
|
|
// this.getFollow();
|
|
// this.getFollow();
|
|
@@ -914,6 +917,38 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ checkUpdate() {
|
|
|
|
|
+ var that = this;
|
|
|
|
|
+ if (typeof(cordova) == "undefined") {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ axios.get("http://qndownload.shotshock.shop/version?ts=" + Date.parse(new Date())).then(res => {
|
|
|
|
|
+ var ver = res.data.version
|
|
|
|
|
+ var url = res.data.download
|
|
|
|
|
+ console.log(JSON.stringify(res.data))
|
|
|
|
|
+ console.log(navigator.platform)
|
|
|
|
|
+ cordova.getAppVersion.getVersionNumber().then(version => {
|
|
|
|
|
+ console.log("current version: " + version);
|
|
|
|
|
+ console.log("remote version: " + ver);
|
|
|
|
|
+ if (ver > version) {
|
|
|
|
|
+ console.log("current need update !");
|
|
|
|
|
+ that.$dialog.confirm({
|
|
|
|
|
+ mes: "检查到有新版本,点击确定去下载!",
|
|
|
|
|
+ title: "更新提示",
|
|
|
|
|
+ opts: () => {
|
|
|
|
|
+ cordova.InAppBrowser.open(url, "_system")
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ console.log("current alreay is latest !");
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ // that.$dialog.error("检查更新失败!")
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
updateVIP() {
|
|
updateVIP() {
|
|
|
var userinfo = this.$store.state.app.userInfo;
|
|
var userinfo = this.$store.state.app.userInfo;
|
|
|
if (this.$store.state.app.token) {
|
|
if (this.$store.state.app.token) {
|