feat: 订单模块基本完成
This commit is contained in:
23
src/utils/routeUtil.ts
Normal file
23
src/utils/routeUtil.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import Taro from "@tarojs/taro";
|
||||
|
||||
export function getCurrentFullPath(): string {
|
||||
const pages = Taro.getCurrentPages();
|
||||
const currentPage = pages.at(-1);
|
||||
|
||||
if (currentPage) {
|
||||
console.log(currentPage, "currentPage get");
|
||||
const route = currentPage.route;
|
||||
const options = currentPage.options || {};
|
||||
|
||||
const query = Object.keys(options)
|
||||
.map((key) => `${key}=${options[key]}`)
|
||||
.join("&");
|
||||
|
||||
return query ? `/${route}?${query}` : `/${route}`;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
export function reloadPage() {
|
||||
Taro.reLaunch({ url: getCurrentFullPath() })
|
||||
}
|
||||
Reference in New Issue
Block a user