From 22c039a8eb658cea9b57939c1a51c1d4c0f5e022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=80=AA?= <690927457@qq.com> Date: Wed, 1 Nov 2023 00:33:57 +0800 Subject: [PATCH] =?UTF-8?q?2023.11.1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 13 +++- api/index.js | 13 ++-- api/request.js | 12 +++- components/mySwiper.vue | 4 +- config/index.js | 2 +- pages.json | 21 +++++++ pages/index/done.vue | 84 +++++++++++++++++++++++++ pages/index/index.vue | 108 +++++++++++++++++++++------------ pages/index/todo.vue | 84 +++++++++++++++++++++++++ pages/index/visionList.vue | 104 +++++++++++++++++++++++++++++++ pages/index/visionTest.vue | 17 +++++- pages/user/index.vue | 13 +++- pages/user/star.vue | 22 ++++++- pages/wikipedia/detail.vue | 42 +++++++++++-- pages/wikipedia/index.vue | 45 ++++++-------- static/default_icon.png | Bin 0 -> 7641 bytes static/default_search_icon.png | Bin 0 -> 16401 bytes store/index.js | 1 + 18 files changed, 497 insertions(+), 88 deletions(-) create mode 100644 pages/index/done.vue create mode 100644 pages/index/todo.vue create mode 100644 pages/index/visionList.vue create mode 100644 static/default_icon.png create mode 100644 static/default_search_icon.png diff --git a/App.vue b/App.vue index 0fe4984..e8346d4 100644 --- a/App.vue +++ b/App.vue @@ -20,10 +20,13 @@ onLaunch((e) => { console.log('App onLaunch') let userInfo = uni.getStorageSync('userInfo') + let operation_info = uni.getStorageSync('operation_info') if(userInfo) { // 已经登录过 - store.userInfo = userInfo } + if(operation_info) { + store.operation_info = operation_info + } }) \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 1755bab..716d171 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -14,7 +14,6 @@ if(store.userInfo && !store.operation_info) { //登录过 且 未填写手术信息 // getHospitalList() setTimeout(()=>{ - // console.log(inputDialog.value) inputDialog.value.open() },0) } @@ -29,40 +28,22 @@ const blur_h = ref(0) const surgery_time = ref(null) // 手术时间 const isSurgery = ref(-1) //是否已经手术 0为手术,1已经手术 - const lbt_list = ref([ - { - banner_name: "首页轮播2", - createtime: 1694851490, - deletetime: null, - id: 6, - image: "http://niunai.zhitou1688.com/uploads/20230922/ea3b3348df5d2b41eb49ddbf86b83516.png", - is_show: 1, - type: "index", - url: "", - weigh: 6, - },{ - banner_name: "首页轮播2", - createtime: 1694851490, - deletetime: null, - id: 6, - image: "/static/vip2.png", - is_show: 1, - type: "index", - url: "", - weigh: 6, - } - ]) + const lbt_list = ref([]) // 失去焦点的监听 // watch(blur_h,(val1,val2) => { // // hospitals.value = null - // console.log('监听 ',choosed_h.value) // if(!choosed_h) { // 未选择值 // } // }) + const h_queryParams = ref({ + page:1, + pageSize:1000, + key:'' + }) // 函数 async function getHospitalList() { - const res = await api.getHospitalList() + const res = await api.getHospitalList(h_queryParams.value) if(res.code == 0) { hospitals.value = res.data.list } @@ -70,24 +51,24 @@ async function getLbtList() { // 获取轮播图 const res = await api.getLbtList() if(res.code == 0) { - + if(res.data.list) { + lbt_list.value = res.data.list + } } } function toClose() { inputDialog.value.close() } function radioChange(e) { - console.log(e) isSurgery.value = e.detail.value } const single = ref('') function maskClick(e){ - console.log('maskClick事件:', e); } const hValue = ref('') // 医院 const hValueId = ref('') // 医院id function onClickH(e) { - // console.log(hValue.value) + h_queryParams.value.key = hValue.value getHospitalList() } @@ -97,7 +78,6 @@ }) } function toChooseH(item) { - console.log(item) choosed_h.value = item hValue.value = item.name hospitals.value = null @@ -105,28 +85,62 @@ // function blurFunc() { // blur_h.value = 1 // hospitals.value = null - // // console.log('blurFunc!!',blur_h.value) // } function focusFunc() { // blur_h.value = 0 - console.log('focusFunc') } function toBlur(){ - // console.log('toBlur') hospitals.value = null } async function toSave() { + if(isSurgery.value == -1) { + return + } + if(!surgery_time.value) { + return + } + if(!choosed_h.value || !choosed_h.value.ID) { + return + } let user_info = JSON.parse(uni.getStorageSync('userInfo')) - const res = await api.hospital({ + let h_query = { isSurgery:isSurgery.value, surgery_time:surgery_time.value, userId:user_info.userId, hospitalId:choosed_h.value?.ID - }) - console.log(res) + } + const res = await api.hospital(h_query) if(res.code == 0) { + uni.showToast({ + title:"保存成功", + icon:"success", + duration:2000 + }) + uni.setStorageSync('operation_info',JSON.stringify(h_query)) + store.operation_info = JSON.stringify(h_query) toClose() } + else{ + uni.showToast({ + title:"操作失败", + icon:"error", + duration:2000 + }) + } + } + function todoFunc(state) { + let url = '/pages/index/todo' + if(state === 2) { + url = '/pages/index/done' + } + uni.navigateTo({ + url + }) + } + function toVisionList() { + uni.navigateTo({ + url:"/pages/index/visionList" + }) }