优化返回页面
This commit is contained in:
32
unpackage/dist/dev/mp-weixin/components/VerifyLogin.js
vendored
Normal file
32
unpackage/dist/dev/mp-weixin/components/VerifyLogin.js
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../common/vendor.js");
|
||||
function VerifyLogin() {
|
||||
return new Promise((resolve, reject) => {
|
||||
common_vendor.index.getStorage({
|
||||
key: "userinfo",
|
||||
success: (res) => {
|
||||
if (res.data) {
|
||||
if (res.data.nickName) {
|
||||
resolve(true);
|
||||
} else {
|
||||
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
|
||||
common_vendor.index.reLaunch({ url: "/pages/UserInformation/UserInformation" });
|
||||
resolve(false);
|
||||
}
|
||||
} else {
|
||||
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
|
||||
common_vendor.index.navigateTo({ url: "/pages/login/login" });
|
||||
resolve(false);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
common_vendor.index.__f__("error", "at components/VerifyLogin.js:22", "获取用户信息失败", err);
|
||||
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
|
||||
common_vendor.index.navigateTo({ url: "/pages/login/login" });
|
||||
reject(err);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
exports.VerifyLogin = VerifyLogin;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/components/VerifyLogin.js.map
|
||||
@@ -1,8 +1,10 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const components_request = require("../request.js");
|
||||
const components_formatDate = require("../formatDate.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
inject: ["$global"],
|
||||
data() {
|
||||
return {
|
||||
page: 0,
|
||||
@@ -27,6 +29,7 @@ const _sfc_main = {
|
||||
}
|
||||
});
|
||||
},
|
||||
formatDate: components_formatDate.formatDate,
|
||||
async pkList() {
|
||||
const res = await components_request.request({
|
||||
url: "pk/pkList",
|
||||
@@ -38,10 +41,10 @@ const _sfc_main = {
|
||||
},
|
||||
userInfo: false
|
||||
});
|
||||
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:64", res);
|
||||
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:66", res);
|
||||
if (res.code === 200) {
|
||||
this.list.push(...res.data);
|
||||
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:67", this.list);
|
||||
common_vendor.index.__f__("log", "at components/contentList/contentList.vue:69", this.list);
|
||||
}
|
||||
},
|
||||
onScrollToLower() {
|
||||
@@ -69,7 +72,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
f: common_vendor.t(item.sex === "1" ? "男" : "女"),
|
||||
g: item.sex === "1" ? 1 : "",
|
||||
h: item.sex === "2" ? 1 : "",
|
||||
i: common_vendor.t(_ctx.formatDate(item.pkTime)),
|
||||
i: common_vendor.t($options.formatDate(item.pkTime)),
|
||||
j: common_vendor.t(item.coin + "K"),
|
||||
k: common_vendor.o$1(($event) => $options.goDetail(item)),
|
||||
l: "4813d59a-0-" + i0
|
||||
|
||||
@@ -1,2 +1,13 @@
|
||||
"use strict";
|
||||
function formatDate(timestamp) {
|
||||
const date = new Date(timestamp * 1e3);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(date.getDate()).padStart(2, "0");
|
||||
const hour = String(date.getHours()).padStart(2, "0");
|
||||
const minute = String(date.getMinutes()).padStart(2, "0");
|
||||
const second = String(date.getSeconds()).padStart(2, "0");
|
||||
return `${year}-${month}-${day} ${hour}:${minute}:${second}`;
|
||||
}
|
||||
exports.formatDate = formatDate;
|
||||
//# sourceMappingURL=../../.sourcemap/mp-weixin/components/formatDate.js.map
|
||||
|
||||
@@ -24,15 +24,17 @@ function request(urldata) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$global.lastPage = common_vendor.index.page.route;
|
||||
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
|
||||
common_vendor.index.reLaunch({ url: "/pages/UserInformation/UserInformation" });
|
||||
}
|
||||
} else {
|
||||
this.$global.lastPage = common_vendor.index.page.route;
|
||||
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
|
||||
common_vendor.index.navigateTo({ url: "/pages/login/login" });
|
||||
}
|
||||
},
|
||||
fail: function(res) {
|
||||
common_vendor.index.setStorageSync("lastPage", getCurrentPages()[getCurrentPages().length - 1].route);
|
||||
common_vendor.index.navigateTo({ url: "/pages/login/login" });
|
||||
reject(res);
|
||||
}
|
||||
});
|
||||
@@ -45,7 +47,7 @@ function request(urldata) {
|
||||
method,
|
||||
header,
|
||||
success: function(res) {
|
||||
common_vendor.index.__f__("log", "at components/request.js:48", "请求成功2", res);
|
||||
common_vendor.index.__f__("log", "at components/request.js:50", "请求成功2", res);
|
||||
resolve(res.data);
|
||||
},
|
||||
fail: function(res) {
|
||||
|
||||
Reference in New Issue
Block a user