diff --git a/滦平县报告对比/lu/axios.js b/滦平县报告对比/lu/axios.js index 60024a7..19f7419 100644 --- a/滦平县报告对比/lu/axios.js +++ b/滦平县报告对比/lu/axios.js @@ -32,6 +32,7 @@ export const $post = async ({ url, data = {} }) => { + console.log(data) let token = getToken() ? getToken() : ''; if (noLogin.indexOf(url) === -1 && token === '') { uni.$lu.toast("请登录") diff --git a/滦平县报告对比/pages/main/home/home.vue b/滦平县报告对比/pages/main/home/home.vue index 39ea95c..af70b06 100644 --- a/滦平县报告对比/pages/main/home/home.vue +++ b/滦平县报告对比/pages/main/home/home.vue @@ -8,6 +8,7 @@ ref } from 'vue' import { + ReportListAction, $image, $response } from '@/api' @@ -22,15 +23,40 @@ }); const id_number = ref('') const phone=ref('') + const GetReportList = async () => { + uni.showLoading({ + title:'加载中...' + }) + const data={ + id_number:id_number.value, + phone:phone.value + } + console.log(data) + const response = await ReportListAction(data) + uni.hideLoading() + $response(response, () => { + if( response.data.list?.length>0){ + uni.navigateTo({ + url: `/pages/main/list/list?hospital=4&id_number=${id_number.value}&phone=${phone.value}` + }) + }else{ + uni.$lu.toast("暂无报告"); + } + }) + } const toPage = () => { if(id_number.value.length===0 || phone.value.length===0){ uni.$lu.toast("请输入身份证和电话"); return false; } + + GetReportList() + } + onShow(()=>{ uni.navigateTo({ - url: `/pages/main/list/list?hospital=4&id_number=${id_number.value}&phone=${phone.value}` + url: `/pages/main/home/home?hospital=4` }) - } + })