You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

625 lines
16 KiB
Vue

12 months ago
<script setup>
// 引入依赖
11 months ago
import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
11 months ago
import unCombox from '@/uni_modules/uni-combox/components/uni-combox/uni-combox.vue'
11 months ago
import { onLoad,onShow } from "@dcloudio/uni-app"
12 months ago
import mySwiper from "@/components/mySwiper.vue"
10 months ago
import aikefu from "@/components/aikefu.vue"
11 months ago
import {ref,onMounted,nextTick,watch} from "vue"
import api from '@/api/index.js'
12 months ago
import {useStore} from '@/store/index.js'
11 months ago
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
12 months ago
const store = useStore()
9 months ago
const h_index = ref(0)
11 months ago
onShow((e) => {
11 months ago
getLbtList()
6 months ago
// if(!store.userInfo && !store.operation_info) { //没登录过 且 未填写手术信息
if(!store.userInfo) { //没登录过
// getHospitalList()
6 months ago
// setTimeout(()=>{
// inputDialog.value.open()
// },0)
6 months ago
} else {
// setTimeout(()=>{
// inputDialog.value.close()
// },0)
getTodayTodoList()
6 months ago
}
12 months ago
})
11 months ago
12 months ago
// 变量
9 months ago
const hospitals = ref([])
11 months ago
// const hospitals_show = ref(false)
12 months ago
const inputDialog = ref()
const inputClose = ref()
11 months ago
const choosed_h = ref(null)
const blur_h = ref(0)
const surgery_time = ref(null) // 手术时间
const isSurgery = ref(-1) //是否已经手术 0为手术1已经手术
11 months ago
const lbt_list = ref([])
11 months ago
// 失去焦点的监听
// watch(blur_h,(val1,val2) => {
// // hospitals.value = null
// if(!choosed_h) { // 未选择值
// }
// })
11 months ago
const h_queryParams = ref({
page:1,
pageSize:1000,
key:''
})
const todayTodoList = ref([])
const todayTodoListShow = ref({})
11 months ago
// 函数
async function getTodayTodoList() {
const userInfo = uni.getStorageSync('userInfo')
if(userInfo) {
let user_info = JSON.parse(userInfo)
if(user_info.userId) {
const res = await api.todayTodoList({userId:user_info.userId})
if(res.code == 0) {
todayTodoList.value = res.data
// 测试开始
// let o = [
// {
// remindTime: '2024.1.1',
// content: '测试'
// },
// {
// remindTime: '2024.1.1',
// content: '快去测试343232423快去测试快去测试快去测试快去测试快去测试'
// },
// ]
// console.log(o)
// todayTodoList.value.push(...o)
// 测试结束
if(todayTodoList.value.length > 0) {
showTodo()
}
}
}
}
}
function showTodo() {
let start_num = 0
setInterval(() => {
if(!(start_num < todayTodoList.value.length)) {
start_num = 0
}
todayTodoListShow.value = todayTodoList.value[start_num]
start_num++
}, 2000)
}
6 months ago
function subscribeFunc() {
uni.requestSubscribeMessage({
         tmplIds: ['PgxoZOOSDgBcmIGd_EVLDnYUmL3eu6NQTAZCsHQeuWY'],
         success: (res) => {
             console.log(res);
        },
fail(res) {
 console.log(res);
}
    })
}
11 months ago
async function getHospitalList() {
11 months ago
const res = await api.getHospitalList(h_queryParams.value)
11 months ago
if(res.code == 0) {
hospitals.value = res.data.list
9 months ago
console.log(hospitals.value )
11 months ago
}
}
async function getLbtList() { // 获取轮播图
const res = await api.getLbtList()
if(res.code == 0) {
11 months ago
if(res.data.list) {
lbt_list.value = res.data.list
}
11 months ago
}
}
11 months ago
function toClose() {
inputDialog.value.close()
}
function radioChange(e) {
11 months ago
isSurgery.value = e.detail.value
11 months ago
}
const single = ref('')
function maskClick(e){
11 months ago
}
const hValue = ref('') // 医院
const hValueId = ref('') // 医院id
11 months ago
function onClickH() {
11 months ago
h_queryParams.value.key = hValue.value
11 months ago
getHospitalList()
11 months ago
}
function toExam() { // 视力测试
uni.navigateTo({
url:"/pages/index/visionTest"
})
11 months ago
}
11 months ago
function toChooseH(item) {
11 months ago
// console.log(item)
11 months ago
choosed_h.value = item
hValue.value = item.name
11 months ago
// hospitals.value = null
11 months ago
}
// function blurFunc() {
// blur_h.value = 1
// hospitals.value = null
// }
function focusFunc() {
// blur_h.value = 0
}
function toBlur(){
9 months ago
// hospitals.value = null
11 months ago
}
async function toSave() {
11 months ago
if(isSurgery.value == -1) {
return
}
if(!surgery_time.value) {
return
}
9 months ago
// if(!choosed_h.value || !choosed_h.value.ID) {
// return
// }
11 months ago
let user_info = JSON.parse(uni.getStorageSync('userInfo'))
11 months ago
let h_query = {
11 months ago
isSurgery:parseInt(isSurgery.value),
11 months ago
surgery_time:surgery_time.value,
userId:user_info.userId,
9 months ago
// hospitalId:choosed_h.value?.ID
hospitalId:hospitals.value[h_index.value]?.ID
11 months ago
}
11 months ago
// console.log(h_query);return
11 months ago
const res = await api.hospital(h_query)
11 months ago
if(res.code == 0) {
11 months ago
uni.showToast({
title:"保存成功",
icon:"success",
duration:2000
})
uni.setStorageSync('operation_info',JSON.stringify(h_query))
store.operation_info = JSON.stringify(h_query)
11 months ago
toClose()
11 months ago
}
11 months ago
else{
uni.showToast({
11 months ago
title:res.msg,
11 months ago
icon:"error",
11 months ago
duration:2000,
success() {
if(res.code === 7) // 登录失败
{
// // 清空缓存
// uni.removeStorageSync('userInfo');
// uni.removeStorageSync('access_token');
// uni.removeStorageSync('avatarUrl');
// uni.switchTab({
// url:'/pages/user/index'
// })
store.afterFailLogin()
}
}
11 months ago
})
}
}
11 months ago
function todoFunc(state_index) {
11 months ago
let url = '/pages/index/todo'
11 months ago
url = '/pages/index/done?state_index='+state_index
// if(state_index === 0) {
// url = '/pages/index/done?state_index='+state_index
// }
6 months ago
subscribeFunc()
11 months ago
uni.navigateTo({
url
})
}
function toVisionList() {
uni.navigateTo({
url:"/pages/index/visionList"
})
11 months ago
}
11 months ago
function toNote(index) {
uni.navigateTo({
url:"/pages/index/note_list?index="+index
})
}
9 months ago
function bindPickerChange(e) {
h_index.value = e.detail.value
}
6 months ago
// 手机号登录
async function getPhoneNumber (e) {
await store.getAccess_token({code:e.detail.code})
toClose()
}
12 months ago
</script>
<template>
<view class="content page-box">
<!-- 背景图 -->
<view class="bg-imgs-card">
7 months ago
<image src="https://jmyl-app.oss-cn-chengdu.aliyuncs.com/miniapp/bg.png" mode="aspectFill"></image>
</view>
12 months ago
<!-- 轮播图 -->
<mySwiper :indicatorDots="true" :isRadius="true" height="160" class="index-siwper margin-b-card" :lbt_list="lbt_list" style="width: 100%;" />
<!-- <view class="main-cards" @tap="toExam">
11 months ago
<view class="mc-row">
<view>视力测试</view>
<uni-icons type="forward" color="#9bc027" size="20"></uni-icons>
</view>
</view> -->
<!-- 提示弹幕 -->
<!-- <view class="todayTodoListBox" v-if="todayTodoList.length>0">
<uni-icons type="sound-filled" color="#fc9467" size="30"></uni-icons>
<view class="tlb-item-box">
<view class="tlb-item" @tap="todoFunc(1)">
<view class="tlb-content ">{{todayTodoListShow.remindTime}}: &nbsp;{{todayTodoListShow.content}}</view>
</view>
</view>
</view> -->
11 months ago
<view class="attention-card">
<!-- <view class="part-title">
11 months ago
测试记录
</view> -->
<!-- <view class="ac-parts">
11 months ago
<view @tap="toVisionList" class="ac-part" style="color: gray;" >
视力测试记录
<uni-icons type="forward" color="gray" size="20"></uni-icons>
</view>
</view> -->
11 months ago
</view>
<!-- <view class="attention-card">
11 months ago
<view class="part-title">
事务处理
</view>
</view> -->
11 months ago
<view class="main-cards">
11 months ago
<view @tap="todoFunc(0)" class="mc-part" style="margin-left: 0;">
<image class="mc-bg-card" src="../../static/style/done.png" mode=""></image>
11 months ago
<view class="mc-part-text">已完成事项</view>
<!-- <image src="../../static/done.png" mode="widthFix"></image> -->
11 months ago
</view>
11 months ago
<view @tap="todoFunc(1)" class="mc-part mc-part2" style="margin-right: 0;">
<image class="mc-bg-card" src="../../static/style/undone.png" mode=""></image>
11 months ago
<view class="mc-part-text">待完成事项</view>
<!-- <image style="transform: rotate(0deg);" src="../../static/undone.png" mode="widthFix"></image> -->
11 months ago
</view>
</view>
<view class="attention-card">
<!-- <view class="part-title">
11 months ago
注意事项
</view> -->
11 months ago
<view class="ac-parts">
<!-- <view @tap="toNote(0)" class="ac-part" style="background: linear-gradient(45deg, #ffa2a2,#ffd3d3, #ffffff00);">
11 months ago
术前注意事项
<uni-icons type="forward" color="#ffa2a2" size="20"></uni-icons>
</view> -->
<view @tap="toNote(0)" class="ac-part" >
<view class="note-text">术前注意事项</view>
<image class="note-bg" src="../../static/style/note1.png" mode=""></image>
11 months ago
</view>
<view @tap="toNote(1)" class="ac-part" >
<view class="note-text">术中注意事项</view>
<image class="note-bg" src="../../static/style/note3.png" mode=""></image>
12 months ago
</view>
<view @tap="toNote(2)" class="ac-part" >
<view class="note-text">术后注意事项</view>
<image class="note-bg" src="../../static/style/note2.png" mode=""></image>
11 months ago
</view>
</view>
</view>
<view class="test-card" @tap="toExam">
<view class="test-text">视力自测小助手</view>
<image class="test-img" src="../../static/style/test.png" mode=""></image>
</view>
<aikefu />
<!-- 提示弹幕 -->
<view class="todayTodoListBox" v-if="todayTodoList.length>0">
<uni-icons type="sound-filled" color="#fc9467" size="30" style="margin-right: 5px;"></uni-icons>
<view class="tlb-item-box">
<view class="tlb-item" @tap="todoFunc(1)">
<view class="tlb-content ">{{todayTodoListShow.remindTime}}: &nbsp;{{todayTodoListShow.content}}</view>
</view>
</view>
</view>
11 months ago
<uni-popup ref="inputDialog" @tap="toBlur" :is-mask-click='false'>
12 months ago
<view class="pop-box">
6 months ago
<view class="pb-title">您好, 请先登录</view>
11 months ago
<view class="pb-content">
6 months ago
<!-- <view class="pb-item">
11 months ago
<view class="pb-item-left">已经手术</view>
<view class="pb-item-right">
<radio-group @change="radioChange">
<label class="radio"><radio value="1" /></label>
<label class="radio"><radio value="0" /></label>
</radio-group>
</view>
</view>
<view class="pb-item">
<view class="pb-item-left">手术时间</view>
<view class="pb-item-right">
11 months ago
<uniDatetimePicker type="date" :clear-icon="false" v-model="surgery_time" @maskClick="maskClick" ></uniDatetimePicker>
11 months ago
</view>
</view>
<view class="pb-item">
<view class="pb-item-left">医院名称</view>
<view class="pb-item-right">
9 months ago
<picker @change="bindPickerChange" :value="h_index" :range="hospitals" range-key="name">
<view class="uni-input">{{hospitals[h_index]?.name}}</view>
</picker>
11 months ago
</view>
6 months ago
</view> -->
<!-- <view class="pb-item pb-item-btn" @tap="toSave"></view> -->
<!-- <view class="pb-item pb-item-btn" @tap="toSave"></view> -->
<button class="buy-btn" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"></button>
11 months ago
</view>
12 months ago
</view>
6 months ago
<!-- <view class="pop-close" @tap="toClose">
12 months ago
关闭
6 months ago
</view> -->
12 months ago
</uni-popup>
12 months ago
</view>
</template>
11 months ago
<style scoped lang="scss">
.todayTodoListBox{
display: flex;
// align-items: center;
margin-top: 1vh;
.tlb-item-box{
color: #f97a44;
font-weight: 900;
font-size: 4.2vw;
display: flex;
align-items: center;
.tlb-item{
display: flex;
align-items: center;
}
}
}
6 months ago
.buy-btn{
display: block;
margin-top:1rem;
background-color: #26758d;
color: white;
border-radius: 50rpx;
font-weight: 200;
font-size: 24rpx;
width: 80%;
padding: 10rpx 0;
margin: 0 auto;
}
.test-card{
padding: 30rpx 20rpx;
margin: 20rpx 0;
margin-top: 60rpx;
position: relative;
width: 50%;
.test-text{
position: relative;
z-index: 2;
}
.test-img{
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
z-index: 1;
}
}
.bg-imgs-card{
width: 100%;
height: 100%;
position: absolute;
top: 0px;
left: 0px;
image{
width: 100%;
height: 100%;
}
z-index: -1;
}
11 months ago
.pb-item-btn{
padding: 20rpx 0;
text-align: center;
color: white;
background: #26758d;
justify-content: center;
width: 66%;
margin: 0 auto;
border-radius: 10rpx;
}
.h_res_show_aprt{
position: absolute;
bottom: 100%;
width: 100%;
background: white;
z-index: 10;
box-shadow: 1px 2px 10px #02020236;
border: 1px solid #e3e3e3;
max-height: 400rpx;
overflow-y: auto;
left: 0;
.h_res_show_aprt_row{
padding: 20rpx 10rpx;
border-bottom: 2rpx #e3e3e3 solid;
color: gray;
}
.h_res_show_aprt_row:last-child{
border-bottom:unset
}
}
11 months ago
.mc-row{
display:flex;
// width: 100%;
// justify-content: space-between;
width: 100%;
justify-content: space-between;
border: 1px solid #9bc027;
padding: 20px 10px;
border-radius: 10px;
color: #9bc027;
font-size: 16px;
font-weight: 900;
}
11 months ago
.radio{
margin-right:20rpx;
}
.pb-item{
display: flex;
align-items: center;
margin-bottom: 40rpx;
// justify-content: space-between;
.pb-item-left{
width: 30%;
11 months ago
color: gray;
11 months ago
}
.pb-item-right{
11 months ago
position: relative;
11 months ago
margin-left: 10rpx;
width: 75%;
}
}
:deep(){
.uni-popup__wrapper{
width: 100%;
}
}
11 months ago
.part-title{
border-left: 10rpx solid #fe915d;
padding-left: 20rpx;
font-weight: 900;
}
.attention-card{
// margin-top: 20rpx;
11 months ago
width: 100%;
.ac-parts{
margin-top: 20rpx;
.ac-part{
// display: flex;
// align-items: center;
// justify-content: space-between;
11 months ago
padding:30rpx 20rpx;
// color: white;
11 months ago
margin: 20rpx 0;
position: relative;
.note-text{
position: relative;
z-index: 2;
}
.note-bg{
position: absolute;
/* z-index: 1; */
height: 100%;
width: 100%;
right: 0px;
top: 0px;
z-index: 1;
}
11 months ago
}
}
}
.main-cards{
.mc-part{
.mc-part-text{
position: relative;
z-index: 10;
font-size: 28rpx;
11 months ago
font-weight: 900;
display: flex;
align-items: center;
height: 100%;
11 months ago
}
width: 50%;
/* text-align: center; */
background: linear-gradient(220deg, #9cd2bc, #fff);
// color: white;
color: #484848;
11 months ago
padding: 40rpx 20rpx;
margin: 0 20rpx;
border-radius: 20rpx;
height: 100rpx;
position: relative;
overflow: hidden;
image{
position: absolute;
left: 0;
top: 0px;
width: 100%;
height: 100%;
// position: absolute;
// width: 66%;
// right: 0;
// bottom: -20%;
// z-index: 1;
// transform: rotate(45deg);
11 months ago
}
}
.mc-part2{
background: linear-gradient(220deg, #9cd2bc, #fff);
11 months ago
// text-align: right;
}
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin-top: 20rpx;
}
12 months ago
.pop-box{
11 months ago
.pb-title{
text-align: center;
margin-bottom: 40rpx;
}
12 months ago
background-color: white;
padding: 20rpx;
11 months ago
width: 80%;
margin: 0 auto;
border-radius: 20rpx;
}
.pop-close{
text-align: center;
color: white;
margin-top: 20rpx;
12 months ago
}
.page-box{
padding: 0 20rpx;
11 months ago
min-height: unset;
12 months ago
}
.content {
display: flex;
flex-direction: column;
// align-items: center;
12 months ago
justify-content: center;
position: relative;
height: 100%;
12 months ago
}
.logo {
height: 200rpx;
width: 200rpx;
margin-top: 200rpx;
margin-left: auto;
margin-right: auto;
margin-bottom: 50rpx;
}
.text-area {
display: flex;
justify-content: center;
}
.title {
font-size: 36rpx;
color: #8f8f94;
}
image{will-change: transform}
</style>
12 months ago