代码提交

This commit is contained in:
黄少君
2023-11-15 19:59:37 +08:00
parent dcab74274f
commit 35b43ffd97
43 changed files with 1265 additions and 387 deletions

View File

@ -18,6 +18,9 @@ export const usePage = getPage => {
// 分类ID
const sid = ref('')
// 优惠券ID
const couponId = ref('')
// 是否新品,不为空的字符串即可
const news = ref('')
@ -45,6 +48,7 @@ export const usePage = getPage => {
keyword: keyword.value,
type: type.value,
sid: sid.value,
couponId: couponId.value,
news: news.value,
isIntegral: isIntegral.value,
})
@ -92,6 +96,7 @@ export const usePage = getPage => {
listEmpty,
news,
sid,
couponId,
refresh: handleRefresh,
}
}

View File

@ -127,6 +127,9 @@ export const useRouter = () => {
function getParams(options) {
if (typeof options !== 'object') return {}
if (!options[PARAMS_KEY]) return {}
// #ifdef MP-WEIXIN
console.log(typeof options[PARAMS_KEY],options[PARAMS_KEY],decodeURIComponent(options[PARAMS_KEY]))
// #endif
return JSON.parse(decodeURIComponent(options[PARAMS_KEY]));
}

15
hooks/useScroll.js Normal file
View File

@ -0,0 +1,15 @@
import { onPageScroll } from "@dcloudio/uni-app";
import { onBeforeUnmount, ref } from "vue";
const scrollTop = ref(0)
export function useScroll(){
onPageScroll((e)=>{
scrollTop.value = e.scrollTop
})
onBeforeUnmount(()=>{
scrollTop.value = 0
})
return {
scrollTop
}
}