Files
gxtyzx-uniapp/dist/dev/mp-weixin/utils/common.js
T

48 lines
1.0 KiB
JavaScript

"use strict";
const common_vendor = require("../common/vendor.js");
require("./request.js");
require("../store/modules/user.js");
const openUrl = (item) => {
if (item.target == "uni.navigateTo") {
return common_vendor.index.navigateTo({
url: item.path
});
}
if (item.target == "uni.switchTab") {
return common_vendor.index.switchTab({
url: item.path
});
}
if (item.target == "uni.redirectTo") {
return common_vendor.index.redirectTo({
url: item.path
});
}
if (item.target == "uni.reLaunch") {
return common_vendor.index.reLaunch({
url: item.path
});
}
};
const getWeek = (text) => {
const week = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六"
];
return week[text];
};
const getKey = (text) => {
text = text.replaceAll("-", "");
text = text.replaceAll(":", "");
text = text.replaceAll(" ", "");
return text;
};
exports.getKey = getKey;
exports.getWeek = getWeek;
exports.openUrl = openUrl;