123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- export const showToast = (title, icon = "none", time = 2000) => {
- uni.showToast({
- title: title,
- icon: icon,
- duration: time,
- });
- };
- export const loading = {
- show(title) {
- uni.showLoading({
- title: title || "加载中",
- });
- },
- hide() {
- uni.hideLoading();
- },
- };
- export const getNowDate = (number) => {
- let date = new Date();
- let year = date.getFullYear();
- let month = date.getMonth() + 1;
- let day = date.getDate();
- if (number == 2) {
- return `${year}-${month < 10? '0'+month:month}`;
- } else if (number == 3) {
- return `${year}-${month < 10? '0'+month:month}-${day < 10? '0'+day:day}`;
- }
- };
|