2023.11.1修改

This commit is contained in:
2023-11-01 00:33:57 +08:00
parent 11cecc737f
commit 22c039a8eb
18 changed files with 497 additions and 88 deletions

View File

@@ -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"
})
}
</script>
<template>
@@ -139,12 +153,28 @@
<uni-icons type="forward" color="#9bc027" size="20"></uni-icons>
</view>
</view>
<view class="attention-card">
<view class="part-title">
测试记录
</view>
<view class="ac-parts">
<view @tap="toVisionList" class="ac-part" style="color: gray;" >
视力测试记录
<uni-icons type="forward" color="gray" size="20"></uni-icons>
</view>
</view>
</view>
<view class="attention-card">
<view class="part-title">
事务处理
</view>
</view>
<view class="main-cards">
<view class="mc-part" style="margin-left: 0;">
<view @tap="todoFunc(2)" class="mc-part" style="margin-left: 0;">
<view class="mc-part-text">已完成事项</view>
<image src="../../static/done.png" mode="widthFix"></image>
</view>
<view class="mc-part mc-part2" style="margin-right: 0;">
<view @tap="todoFunc(1)" class="mc-part mc-part2" style="margin-right: 0;">
<view class="mc-part-text">待完成事项</view>
<image style="transform: rotate(0deg);" src="../../static/undone.png" mode="widthFix"></image>
</view>