已支付订单列表:where.payStatus = 1;

This commit is contained in:
2024-07-10 22:44:18 +08:00
parent 9dd834adb5
commit 1311eb03b8
611 changed files with 92828 additions and 400 deletions
+47
View File
@@ -0,0 +1,47 @@
"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;
+18
View File
@@ -0,0 +1,18 @@
"use strict";
const common_vendor = require("../common/vendor.js");
class Cal {
jia(num1, num2) {
return new common_vendor.Decimal(num1).add(new common_vendor.Decimal(num2));
}
jian(num1, num2) {
return new common_vendor.Decimal(num1).sub(new common_vendor.Decimal(num2));
}
cheng(num1, num2) {
return new common_vendor.Decimal(num1).mul(new common_vendor.Decimal(num2));
}
chu(num1, num2) {
return new common_vendor.Decimal(num1).div(new common_vendor.Decimal(num2));
}
}
const cal = new Cal();
exports.cal = cal;
+89
View File
@@ -0,0 +1,89 @@
"use strict";
const store_modules_user = require("../store/modules/user.js");
function arrayHas(array, value) {
if (!value) {
return true;
}
if (!array) {
return false;
}
if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++) {
if (array.indexOf(value[i]) === -1) {
return false;
}
}
return true;
}
return array.indexOf(value) !== -1;
}
function arrayHasAny(array, value) {
if (!value) {
return true;
}
if (!array) {
return false;
}
if (Array.isArray(value)) {
for (let i = 0; i < value.length; i++) {
if (array.indexOf(value[i]) !== -1) {
return true;
}
}
return false;
}
return array.indexOf(value) !== -1;
}
function hasRole(value) {
const userStore = store_modules_user.useUserStore();
return arrayHas(userStore == null ? void 0 : userStore.roles, value);
}
function hasAnyRole(value) {
const userStore = store_modules_user.useUserStore();
return arrayHasAny(userStore == null ? void 0 : userStore.roles, value);
}
function hasPermission(value) {
const userStore = store_modules_user.useUserStore();
return arrayHas(userStore == null ? void 0 : userStore.authorities, value);
}
function hasAnyPermission(value) {
const userStore = store_modules_user.useUserStore();
return arrayHasAny(userStore == null ? void 0 : userStore.authorities, value);
}
const permission = {
install(app) {
app.directive("role", {
mounted: (el, binding) => {
var _a;
if (!hasRole(binding.value)) {
(_a = el.parentNode) == null ? void 0 : _a.removeChild(el);
}
}
});
app.directive("any-role", {
mounted: (el, binding) => {
var _a;
if (!hasAnyRole(binding.value)) {
(_a = el.parentNode) == null ? void 0 : _a.removeChild(el);
}
}
});
app.directive("permission", {
mounted: (el, binding) => {
var _a;
if (!hasPermission(binding.value)) {
(_a = el.parentNode) == null ? void 0 : _a.removeChild(el);
}
}
});
app.directive("any-permission", {
mounted: (el, binding) => {
var _a;
if (!hasAnyPermission(binding.value)) {
(_a = el.parentNode) == null ? void 0 : _a.removeChild(el);
}
}
});
}
};
exports.permission = permission;
+35
View File
@@ -0,0 +1,35 @@
"use strict";
const common_vendor = require("../common/vendor.js");
const config_setting = require("../config/setting.js");
const http = new common_vendor.Request();
http.setConfig((config) => {
config.baseURL = config_setting.API_BASE_URL;
return config;
});
http.interceptors.request.use((config) => {
const token = common_vendor.index.getStorageSync("access_token");
config.header = {
...config.header,
TenantId: config_setting.TENANT_ID
};
if (token) {
config.header.Authorization = token;
}
if (config.data) {
config.data.tenantId = config_setting.TENANT_ID;
}
return config;
}, (config) => {
return Promise.reject(config);
});
http.interceptors.response.use((response) => {
if (response.data.code == 401) ;
if (response.data.code == 1) {
return Promise.reject(response.data);
}
return response;
}, (response) => {
console.log(response);
return Promise.reject(response);
});
exports.http = http;
+1
View File
@@ -0,0 +1 @@
"use strict";
+2
View File
@@ -0,0 +1,2 @@
"use strict";
require("../common/vendor.js");