岩仔88 3 weeks ago
parent 74fa77f994
commit bc3d46b41f

@ -18,15 +18,14 @@ const noLogin = [
const getParams = (key) => { const getParams = (key) => {
let params_str = window.location.href.split('?')[1] const pages = getCurrentPages();
let params_arr = params_str.split('&') if (pages.length === 0) return false;
for (let i in params_arr) {
if (params_arr[i].indexOf(key + '=') !== -1) { const currentPage = pages[pages.length - 1];
return params_arr[i].split('=')[1] // uni-app 中页面参数统一在 options 里H5 的 query / 小程序的 options
} const value = currentPage.options?.[key];
} return value || false;
return false };
}
export const $post = async ({ export const $post = async ({
url, url,
@ -40,7 +39,7 @@ export const $post = async ({
} }
if (requests[url]) return false; if (requests[url]) return false;
requests[url] = true requests[url] = true
data.hospital = getParams('hospital') data.hospital = getParams('hospital') || '4'
let res = await uni.request({ let res = await uni.request({
url: $api(url), url: $api(url),
method: 'post', method: 'post',

@ -52,6 +52,11 @@
GetReportList() GetReportList()
} }
// onShow(()=>{
// uni.navigateTo({
// url: `/pages/main/home/home?hospital=4`
// })
// })
</script> </script>
<template> <template>
<view style=" background-color: #fff;height: 100vh;" class="gradient-box gradient-2"> <view style=" background-color: #fff;height: 100vh;" class="gradient-box gradient-2">

Loading…
Cancel
Save