Init project

This commit is contained in:
lifizer
2023-09-20 21:49:33 +08:00
parent 85a5989c96
commit c9ceac9f37
710 changed files with 125705 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
export default {
// 通用导航
commonJump: (uniapp_url) => {
let query = uniapp_url.indexOf("?name=");
if (query > -1) {
let start = query + 6;
let name = uniapp_url.substring(start)
uni.setStorageSync("name", name)
uni.switchTab({
url: uniapp_url
})
}
switch (uniapp_url) {
case "":
uni.showToast({
title: "开发中,敬请期待",
icon: 'none'
})
break;
case "/pages/shop/GoodsClass/index":
uni.switchTab({
url: uniapp_url
})
break;
case "/pages/cloud/haveFun":
uni.switchTab({
url: uniapp_url
})
break;
default:
uni.navigateTo({
url: uniapp_url
})
break;
}
},
navToGoods: (id) => {
uni.navigateTo({
url: "/pages/shop/GoodsCon/index?id=" + id
})
},
diffSSS: (date) => {
if (typeof date !== "string") return 0;
date = date.substring(0, 19);
date = date.replace(/-/g, '/');
let timestamp = new Date(date).getTime();
let now = new Date().getTime();
return timestamp - now;
}
}