2023.11.1修改
This commit is contained in:
84
pages/index/done.vue
Normal file
84
pages/index/done.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
// 引入依赖
|
||||
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'
|
||||
import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
// import mySwiper from "@/components/mySwiper.vue"
|
||||
import {ref,onMounted,nextTick,watch} from "vue"
|
||||
import api from '@/api/index.js'
|
||||
import util from "@/utils/index.js"
|
||||
import {useStore} from '@/store/index.js'
|
||||
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
const store = useStore()
|
||||
// 生命周期
|
||||
onLoad((e) => {
|
||||
getList()
|
||||
})
|
||||
onPullDownRefresh(()=> { // 下拉刷新
|
||||
init()
|
||||
getList()
|
||||
})
|
||||
onReachBottom(() => { // 上滑触底
|
||||
queryParams.value.page++
|
||||
getList()
|
||||
})
|
||||
// 变量
|
||||
const list = ref([])
|
||||
const queryParams = ref({
|
||||
page:1,
|
||||
pageSize:10,
|
||||
isFinish:1
|
||||
})
|
||||
// 函数
|
||||
function init(){
|
||||
list.value = []
|
||||
queryParams.value.page = 1
|
||||
queryParams.value.pageSize = 10
|
||||
}
|
||||
async function getList() {
|
||||
const res = await api.getTodoist(queryParams.value)
|
||||
if(res.code === 0) {
|
||||
if(res.data && res.data.length > 0) {
|
||||
list.value.push(...res.data)
|
||||
}
|
||||
else{
|
||||
queryParams.value.page--
|
||||
}
|
||||
}
|
||||
else{
|
||||
uni.showToast({
|
||||
title:"获取失败",
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="todoBox page-box">
|
||||
<view class="td-item" v-for="(item,i) in list">
|
||||
<view class="td-content text-ellipsis-2">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="td-info small-text">
|
||||
{{util.timestampToDate(item.CreatedAt)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.todoBox{
|
||||
padding: 20rpx;
|
||||
.td-item{
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eaeaea;
|
||||
margin-bottom: 20rpx;
|
||||
.td-content{
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
.td-info{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -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>
|
||||
|
84
pages/index/todo.vue
Normal file
84
pages/index/todo.vue
Normal file
@@ -0,0 +1,84 @@
|
||||
<script setup>
|
||||
// 引入依赖
|
||||
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'
|
||||
import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
// import mySwiper from "@/components/mySwiper.vue"
|
||||
import {ref,onMounted,nextTick,watch} from "vue"
|
||||
import api from '@/api/index.js'
|
||||
import util from "@/utils/index.js"
|
||||
import {useStore} from '@/store/index.js'
|
||||
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
const store = useStore()
|
||||
// 生命周期
|
||||
onLoad((e) => {
|
||||
getList()
|
||||
})
|
||||
onPullDownRefresh(()=> { // 下拉刷新
|
||||
init()
|
||||
getList()
|
||||
})
|
||||
onReachBottom(() => { // 上滑触底
|
||||
queryParams.value.page++
|
||||
getList()
|
||||
})
|
||||
// 变量
|
||||
const list = ref([])
|
||||
const queryParams = ref({
|
||||
page:1,
|
||||
pageSize:10,
|
||||
isFinish:0
|
||||
})
|
||||
// 函数
|
||||
function init(){
|
||||
list.value = []
|
||||
queryParams.value.page = 1
|
||||
queryParams.value.pageSize = 10
|
||||
}
|
||||
async function getList() {
|
||||
const res = await api.getTodoist(queryParams.value)
|
||||
if(res.code === 0) {
|
||||
if(res.data && res.data.length > 0) {
|
||||
list.value.push(...res.data)
|
||||
}
|
||||
else{
|
||||
queryParams.value.page--
|
||||
}
|
||||
}
|
||||
else{
|
||||
uni.showToast({
|
||||
title:"获取失败",
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="todoBox page-box">
|
||||
<view class="td-item" v-for="(item,i) in list">
|
||||
<view class="td-content text-ellipsis-2">
|
||||
{{item.content}}
|
||||
</view>
|
||||
<view class="td-info small-text">
|
||||
{{util.timestampToDate(item.CreatedAt)}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.todoBox{
|
||||
padding: 20rpx;
|
||||
.td-item{
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eaeaea;
|
||||
margin-bottom: 20rpx;
|
||||
.td-content{
|
||||
padding-bottom:20rpx;
|
||||
}
|
||||
.td-info{
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
104
pages/index/visionList.vue
Normal file
104
pages/index/visionList.vue
Normal file
@@ -0,0 +1,104 @@
|
||||
<script setup>
|
||||
// 引入依赖
|
||||
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'
|
||||
import { onLoad,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
import emptyCard from "@/components/emptyCard.vue"
|
||||
import {ref,onMounted,nextTick,watch} from "vue"
|
||||
import api from '@/api/index.js'
|
||||
import util from "@/utils/index.js"
|
||||
import {useStore} from '@/store/index.js'
|
||||
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
|
||||
const store = useStore()
|
||||
// 生命周期
|
||||
onLoad((e) => {
|
||||
if(store.userInfo){
|
||||
let user_info = JSON.parse(store.userInfo)
|
||||
queryParams.value.userId = user_info.userId
|
||||
}
|
||||
getList()
|
||||
})
|
||||
onPullDownRefresh(()=> { // 下拉刷新
|
||||
init()
|
||||
getList()
|
||||
})
|
||||
onReachBottom(() => { // 上滑触底
|
||||
queryParams.value.page++
|
||||
getList()
|
||||
})
|
||||
// 变量
|
||||
const list = ref([])
|
||||
const queryParams = ref({
|
||||
page:1,
|
||||
pageSize:10,
|
||||
userId:0
|
||||
})
|
||||
// 函数
|
||||
function init(){
|
||||
list.value = []
|
||||
queryParams.value.page = 1
|
||||
queryParams.value.pageSize = 10
|
||||
}
|
||||
async function getList() {
|
||||
const res = await api.getVisionList(queryParams.value)
|
||||
if(res.code === 0) {
|
||||
if(res.data.list && res.data.list.length > 0) {
|
||||
list.value.push(...res.data.list)
|
||||
}
|
||||
else{
|
||||
queryParams.value.page--
|
||||
}
|
||||
}
|
||||
else{
|
||||
uni.showToast({
|
||||
title:"获取失败",
|
||||
icon:"error",
|
||||
duration:2000
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<view class="visinoListBox page-box">
|
||||
<view class="vl-item-box" v-if="list.length > 0">
|
||||
<view class="vl-item" v-for="(item,i) in list">
|
||||
<view class="vl-title">{{util.timestampToDate(item.CreatedAt)}}</view>
|
||||
<view class="vl-row-box">
|
||||
<view class="vl-row">
|
||||
<view class="vlr-left">右眼</view>
|
||||
<view class="vlr-left">{{item.rightEyeVision}}</view>
|
||||
</view>
|
||||
<view class="vl-row">
|
||||
<view class="vlr-left">左眼</view>
|
||||
<view class="vlr-left">{{item.leftEyeVision}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<emptyCard v-else></emptyCard>
|
||||
</view>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
.visinoListBox{
|
||||
.vl-item-box{
|
||||
padding: 20rpx;
|
||||
.vl-item{
|
||||
.vl-title{
|
||||
border-left: 4rpx solid red;
|
||||
}
|
||||
.vl-row-box{
|
||||
.vl-row{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.vlr-left{
|
||||
|
||||
}
|
||||
.vlr-right{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@@ -138,14 +138,25 @@
|
||||
}
|
||||
async function okFunc() { // 结束测试
|
||||
// inputDialog3.value.open()
|
||||
uni.showLoading({
|
||||
mask:true
|
||||
})
|
||||
const res = await api.saveVision({
|
||||
leftEyeVision:vision_info.value.left,
|
||||
rightEyeVision:vision_info.value.right,
|
||||
leftEyeVision:vision_info.value.left+'',
|
||||
rightEyeVision:vision_info.value.right+'',
|
||||
userId:userInfo.value.userId
|
||||
})
|
||||
uni.hideLoading()
|
||||
if(res.code == 0) {
|
||||
uni.showToast({
|
||||
title:"保存成功",
|
||||
icon:"success",
|
||||
duration:2000,
|
||||
success: function (res){
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
|
||||
uni.navigateBack()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user