代码提交
This commit is contained in:
@ -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,
|
||||
}
|
||||
}
|
||||
|
@ -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
15
hooks/useScroll.js
Normal 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
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user