2023.11.7

prod
阿怪 11 months ago
parent e0a0f1ac1e
commit b1e3735af0

@ -12,9 +12,10 @@ const API = {
saveVision:data => net.POST("/vision",data),// 保存视力测试结果
getLbtList:data => net.GET("/banner/list",data),// 获取轮播图
hospital:data => net.PUT("/user/hospital",data),// 修改医院信息
getHospitalInfo:id => net.GET("/hospital/"+id),// 根据ID获取医院信息
getTodoist:data => net.GET("/user/todo",data),// 获取待办事项
getVisionList:data => net.GET("/vision",data),// 获取测试记录
todoFinished:data => net.PUT("/vision",data),// 修改待办列表状态
getVisionList:data => net.GET("/vision/list",data),// 获取测试记录
todoFinished:data => net.PUT("/user/todo",data),// 修改待办列表状态
// 百科
getArticleList:data => net.GET("/article/list",data),// 百科列表
getArticleDetail:data => net.GET("/article/"+data.id),// 文章详情

@ -1,6 +1,6 @@
// isdev 为 true 表示开发环境 false 表示发布环境
const isdev = true;
const baseUrl = isdev ? 'http://4a1840b2.r12.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
const baseUrl = isdev ? 'http://4ca5004.r15.cpolar.top' : 'http://eb467b6.r19.cpolar.top';// 办公室接口 & 测试环境
// const baseUrl = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境
// const baseUrl = 'https://api.gwkjxb.com';// 正式环境(由于本地测试后台没有启动,暂时通用正式服)

@ -81,6 +81,13 @@
"navigationBarTitleText": "测试记录",
"enablePullDownRefresh": true
}
},
{
"path": "pages/index/note_list",
"style": {
"navigationBarTitleText": "注意事项",
"enablePullDownRefresh": true
}
}
],
"globalStyle": {

@ -13,13 +13,10 @@
const store = useStore()
//
onLoad((e) => {
// console.log(e)
c_index.value = parseInt(e.state_index)
list_box.value[c_index.value].queryParams.isFinish = c_index.value?0:1
// console.log(store.systemInfo)
if(store.systemInfo) {
swiper_h.value = store.systemInfo.windowHeight
// console.log(swiper_h.value)
}
getList()
})
@ -116,7 +113,6 @@
}
function tabChange(currentIndex) {
c_index.value = currentIndex
console.log('tabChange is done!!!!!!!')
// if(list_box.value[c_index.value].list.length === 0) {
// queryStateInitFunc()
// getList()
@ -125,7 +121,6 @@
}
function scroll_func(e) {
c_index.value = e.detail.current
console.log('scroll_func is done!!!!!!!')
if(list_box.value[c_index.value].list.length === 0) {
queryStateInitFunc()
getList()
@ -144,9 +139,7 @@
title:'温馨提示',
content:"确定要完成该事务吗?",
success:async function(res) {
// console.log(res)
if(res.confirm) {
// console.log(handle_info.value)
const res_ = await api.todoFinished({
id:handle_info.value.ID,
isFinish:1
@ -157,7 +150,6 @@
duration:2000,
mask:true,
success() {
console.log(res_)
if(res_.code === 0) {
list_box.value[c_index.value].list.splice(handle_info_index.value,1)
list_box.value[0].list = []
@ -203,9 +195,8 @@
{{util.timestampToDate(handle_info?.CreatedAt)}}
</view>
</view>
<view v-if="!handle_info?.isFinish" class="pb-item pb-item-btn" @tap="finishFunc"></view>
<view v-if="!handle_info?.isFinish" class="pb-item pb-item-btn" @tap="finishFunc"></view>
</view>
</view>
</uni-popup>
</view>
@ -242,6 +233,9 @@
.pb-title{
text-align: center;
margin-bottom: 40rpx;
padding-top: 20rpx;
font-size: 32rpx;
font-weight: 900;
}
background-color: white;
padding: 20rpx;

@ -110,6 +110,7 @@
userId:user_info.userId,
hospitalId:choosed_h.value?.ID
}
// console.log(h_query);return
const res = await api.hospital(h_query)
if(res.code == 0) {
uni.showToast({
@ -157,6 +158,11 @@
url:"/pages/index/visionList"
})
}
function toNote(index) {
uni.navigateTo({
url:"/pages/index/note_list?index="+index
})
}
</script>
<template>
<view class="content page-box">
@ -199,15 +205,15 @@
注意事项
</view>
<view class="ac-parts">
<view class="ac-part" style="background: linear-gradient(45deg, #ffa2a2,#ffd3d3, #ffffff00);">
<view @tap="toNote(0)" class="ac-part" style="background: linear-gradient(45deg, #ffa2a2,#ffd3d3, #ffffff00);">
术前注意事项
<uni-icons type="forward" color="#ffa2a2" size="20"></uni-icons>
</view>
<view class="ac-part" style="background: linear-gradient(45deg, #f9b275,#fff3e9, #ffffff00);">
<view @tap="toNote(1)" class="ac-part" style="background: linear-gradient(45deg, #f9b275,#fff3e9, #ffffff00);">
术中注意事项
<uni-icons type="forward" color="#f9b275" size="20"></uni-icons>
</view>
<view class="ac-part" style="background: linear-gradient(45deg, #8fdc8a,#fdfdfd, #ffffff00);">
<view @tap="toNote(2)" class="ac-part" style="background: linear-gradient(45deg, #8fdc8a,#fdfdfd, #ffffff00);">
术后注意事项
<uni-icons type="forward" color="#8fdc8a" size="20"></uni-icons>
</view>

@ -0,0 +1,281 @@
<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'
import ccNewsTabs from '@/uni_modules/cc-newsTabs/components/cc-newsTabs/cc-newsTabs.vue'
const store = useStore()
//
onLoad((e) => {
c_index.value = parseInt(e.index)
list_box.value[c_index.value].queryParams.state = c_index.value==0?1:c_index.value==1?2:3
if(store.systemInfo) {
swiper_h.value = store.systemInfo.windowHeight
}
getList()
})
onPullDownRefresh(()=> { //
init()
getList()
})
onReachBottom(() => { //
list_box.value[c_index.value].queryParams.page++
getList()
})
//
const inputDialog = ref()
const state_index = ref(0)
const swiper_h = ref(0)
const list = ref([])
const list_box = ref([
{
show_index:0,
state:1,
list:[],
queryParams:{
page:1,
pageSize:10,
statet:1
}
},
{
show_index:1,
state:2,
list:[],
queryParams:{
page:1,
pageSize:10,
statet:2
}
},
{
show_index:1,
state:3,
list:[],
queryParams:{
page:1,
pageSize:10,
statet:3
}
}
])
const queryParams = ref({
page:1,
pageSize:10,
state:1
})
const c_index = ref(-1)
const tabArr = ref([
{
name: '手术前',
id: '1',
},
{
name: '手术中',
id: '2',
},
{
name: '手术后',
id: '3',
}
])
//
function init(){
// list.value = []
list_box.value[c_index.value].list = []
list_box.value[c_index.value].queryParams.page = 1
list_box.value[c_index.value].queryParams.pageSize = 10
}
function queryStateInitFunc() {
list_box.value[c_index.value].queryParams.state = c_index.value?0:1
}
async function getList() {
uni.showLoading({
mask:true
})
const res = await api.getTodoist(list_box.value[c_index.value].queryParams)
uni.hideLoading();
if(res.code === 0) {
if(res.data && res.data.length > 0) {
// list.value.push(...res.data)
list_box.value[c_index.value].list.push(...res.data)
}
else{
list_box.value[c_index.value].queryParams.page--
}
}
else{
uni.showToast({
title:res.msg,
icon:"error",
duration:2000,
mask:true,
success() {
if(res.code === 7) //
{
store.afterFailLogin(2000)
}
}
})
}
}
function tabChange(currentIndex) {
c_index.value = currentIndex
// if(list_box.value[c_index.value].list.length === 0) {
// queryStateInitFunc()
// getList()
// }
}
function scroll_func(e) {
c_index.value = e.detail.current
if(list_box.value[c_index.value].list.length === 0) {
queryStateInitFunc()
getList()
}
}
const handle_info = ref(null)
const handle_info_index = ref(0)
function handle_func(item,i) {
handle_info.value = item
handle_info_index.value = i
inputDialog.value.open()
}
function finishFunc() {
// api.todoFinished
uni.showModal({
title:'温馨提示',
content:"确定要完成该事务吗?",
success:async function(res) {
if(res.confirm) {
const res_ = await api.todoFinished({
id:handle_info.value.ID,
state:1
})
uni.showToast({
title:res_.msg,
icon:"error",
duration:2000,
mask:true,
success() {
if(res_.code === 0) {
list_box.value[c_index.value].list.splice(handle_info_index.value,1)
list_box.value[0].list = []
inputDialog.value.close()
}
}
})
}
}
})
}
</script>
<template>
<view class="todoBox page-box">
<cc-newsTabs :tabArr="tabArr" :o_index="c_index" @tabChange="tabChange"></cc-newsTabs>
<swiper :current="c_index" @change="scroll_func" :style="{'--size':swiper_h+'px'}" class="swiper" circular :indicator-dots="false" :autoplay="false" >
<swiper-item v-for="(item1,i1) in list_box">
<view class="todoBox">
<view v-for="(item,i) in item1.list" @tap="handle_func(item,i)" class="td-item swiper-item uni-bg-green">
<view class="td-content text-ellipsis-2">
{{item.content}}
</view>
<view class="td-info small-text">
{{util.timestampToDate(item.CreatedAt)}}
</view>
</view>
</view>
</swiper-item>
</swiper>
<uni-popup ref="inputDialog" >
<view class="pop-box">
<view class="pb-title">注意事项</view>
<view class="pb-content">
<view class="pb-item">
<!-- <view class="pb-item-left">事项说明</view> -->
<view class="pb-item-right">
{{handle_info?.content}}
</view>
</view>
<!-- <view class="pb-item">
<view class="pb-item-left">创建时间</view>
<view class="pb-item-right">
{{util.timestampToDate(handle_info?.CreatedAt)}}
</view>
</view> -->
<!-- <view v-if="!handle_info?.state" class="pb-item pb-item-btn" @tap="finishFunc"></view> -->
</view>
</view>
</uni-popup>
</view>
</template>
<style scoped lang="scss">
.swiper{
height: var(--size);
}
.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;
}
}
}
.pb-item-btn{
padding: 20rpx 0;
text-align: center;
color: white;
background: #26758d;
justify-content: center;
width: 66%;
margin: 0 auto;
border-radius: 10rpx;
}
.pop-box{
.pb-title{
text-align: center;
margin-bottom: 40rpx;
padding-top: 20rpx;
font-size: 32rpx;
font-weight: 900;
}
background-color: white;
padding: 20rpx;
width: 80%;
margin: 0 auto;
border-radius: 20rpx;
}
.pb-item{
display: flex;
align-items: center;
margin-bottom: 40rpx;
// justify-content: space-between;
.pb-item-left{
width: 30%;
color: gray;
}
.pb-item-right{
position: relative;
margin-left: 10rpx;
width: 75%;
}
}
:deep(){
.uni-popup__wrapper{
width: 100%;
}
}
</style>

@ -8,7 +8,7 @@
<template>
<view class="feedbackBox">
<view class="writeBox">
<textarea class="textarea" v-model="txt"></textarea>
<textarea placeholder="输入您的问题" class="textarea" v-model="txt"></textarea>
</view>
<view class="btn-part">
<view class="btn">提交</view>

@ -1,7 +1,7 @@
<script setup>
import { onLoad } from "@dcloudio/uni-app"
// import mySwiper from "@/components/mySwiper.vue"
import {ref,onMounted,nextTick} from "vue"
import {ref,onMounted,nextTick,computed} from "vue"
import {useStore} from '@/store/index.js'
import api from "@/api/index.js"
onLoad(() => {
@ -9,11 +9,73 @@
userinfo.value = JSON.parse(uni.getStorageSync('userInfo'))
console.log(userinfo.value)
avatar.value = uni.getStorageSync('avatarUrl')
h_info.value = JSON.parse(uni.getStorageSync('operation_info'))
if(h_info.value) {
// console.log(h_info.value)
getHospital(h_info.value.hospitalId)
}
})
const userinfo = ref(null)
const userinfo = ref({})
const avatar = ref(null)
const h_info = ref(null)
const inputDialog = ref(null)
const input_title = ref(null)
// const userForm = ref(null)
//
async function getHospital(id) {
const res = await api.getHospitalInfo(id)
if(res.code === 0) {
h_info.value.name = res.data.name
}
else{
uni.showToast({
title:res.msg,
icon:"error",
duration:2000,
mask:true,
success() {}
})
}
}
const edit_type= ref(null)
function toDetail(type) {
edit_type.value = type
switch(type){
case 1: //
inputDialog.value.open()
input_title.value = '修改昵称'
break;
case 2: //
inputDialog.value.open()
input_title.value = '修改电话'
break;
default:
break;
}
}
function finishFunc() {
}
const startDate = computed(() => getDate('start'))
const endDate = computed(() => getDate('end'))
const date = ref(null)
function getDate(type) {
const date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (type === 'start') {
year = year - 60;
} else if (type === 'end') {
year = year + 2;
}
month = month > 9 ? month : '0' + month;
day = day > 9 ? day : '0' + day;
return `${year}-${month}-${day}`;
}
function bindDateChange() {
}
</script>
@ -34,7 +96,7 @@
</view>
</view>
</view>
<view class="rb-card" @tap="toDetail(1)">
<view class="rb-card" @tap="toDetail(2)">
<view class="rbc-content">
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
<uni-icons type="phone" color="gray" size="26"></uni-icons>
@ -45,29 +107,51 @@
</view>
</view>
</view>
<view class="rb-card" @tap="toDetail(1)">
<view class="rb-card" @tap="toDetail(3)">
<view class="rbc-content">
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
<uni-icons type="calendar" color="gray" size="26"></uni-icons>
手术时间</view>
<view class="rbc-content-row rbc-content-right">
2023-10-1
{{h_info?.surgery_time}}
<uni-icons type="forward" color="gray" size="20"></uni-icons>
</view>
</view>
</view>
<view class="rb-card" @tap="toDetail(1)">
<view class="rb-card" @tap="toDetail(4)">
<view class="rbc-content">
<view class="rbc-content-row rbc-content-left rbc-content-left-box">
<uni-icons type="paperplane" color="gray" size="26"></uni-icons>
手术医院</view>
<view class="rbc-content-row rbc-content-right">
金山医院
{{h_info?.name}}
<uni-icons type="forward" color="gray" size="20"></uni-icons>
</view>
</view>
</view>
</view>
<!--修改姓名/电话 弹窗 -->
<uni-popup ref="inputDialog" >
<view class="pop-box">
<view class="pb-title">{{input_title}}</view>
<view class="pb-content">
<view class="pb-item">
<!-- <view class="pb-item-left">事项说明</view> -->
<view class="pb-item-right">
<!-- <input v-if="edit_type == 1" class="uni-input" v-model="userinfo.nickname" focus placeholder="输入您的姓名" />
<input v-else class="uni-input" v-model="userinfo.phone" focus placeholder="输入您的电话" /> -->
<uni-easyinput :inputBorder="false" v-if="edit_type == 1" borderColor="#26758d" v-model="userinfo.nickname" focus placeholder="输入您的姓名"></uni-easyinput>
<uni-easyinput :inputBorder="false" v-else borderColor="#26758d" v-model="userinfo.phone" focus placeholder="输入您的电话"></uni-easyinput>
</view>
</view>
<view class="pb-item pb-item-btn" @tap="finishFunc"></view>
</view>
</view>
</uni-popup>
<!-- 手术时间 -->
<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
<view class="uni-input"> {{h_info?.surgery_time}}</view>
</picker>
</view>
</template>
<style scoped lang="scss">
@ -153,5 +237,49 @@
}
.user-box{
background: #f6f6f6;
}
.pb-item-btn{
padding: 20rpx 0;
text-align: center;
color: white;
background: #26758d;
justify-content: center;
width: 66%;
margin: 0 auto;
border-radius: 10rpx;
}
.pop-box{
.pb-title{
text-align: center;
margin-bottom: 40rpx;
padding-top: 20rpx;
font-size: 32rpx;
font-weight: 900;
}
background-color: white;
padding: 20rpx;
width: 80%;
margin: 0 auto;
border-radius: 20rpx;
}
.pb-item{
display: flex;
align-items: center;
margin-bottom: 40rpx;
// justify-content: space-between;
.pb-item-left{
width: 30%;
color: gray;
}
.pb-item-right{
position: relative;
// margin-left: 10rpx;
width:100%;
}
}
:deep(){
.uni-popup__wrapper{
width: 100%;
}
}
</style>

@ -6,6 +6,7 @@
// import mySwiper from "@/components/mySwiper.vue"
import {ref,onMounted,nextTick} from "vue"
import {useStore} from '@/store/index.js'
import emptyCard from "@/components/emptyCard.vue"
import api from "@/api/index.js"
import util from "@/utils"
onLoad((e) => {
@ -60,6 +61,7 @@
<uni-icons color="gray" @tap="starFunc(1)" v-else type="star" size="30"></uni-icons>
</view>
</view>
<emptyCard title="暂无内容" v-if="!a_info"></emptyCard>
</view>
</template>
<style scoped lang="scss">

@ -162,6 +162,8 @@ export const useStore = defineStore('main2', {
uni.removeStorageSync('userInfo');
uni.removeStorageSync('access_token');
uni.removeStorageSync('avatarUrl');
this.userInfo = null
this.operation_info = null
uni.switchTab({
url:'/pages/user/index'
})

@ -8,6 +8,7 @@
:class="{current: index === tabCurrentIndex}" :id="'tab'+index" @click="changeTab(index)">{{item.name}}
</view> -->
<view v-for="(item,index) in tabArr" :key="item.id" class="nav-item"
:style="{width:tab_width+'%'}"
:class="{current: index === o_index}" :id="'tab'+index" @click="changeTab(index)">{{item.name}}
</view>
</scroll-view>
@ -22,16 +23,18 @@
scrollTimer = false,
tabBar;
export default {
data() {
return {
tabCurrentIndex: 0, //
scrollLeft: 0, //
tab_width:0,
}
},
mounted() {
console.log(this.tabArr)
this.tab_width = parseFloat(100/this.tabArr.length)
},
props: {
tabArr: {
type: Array,
default () {
@ -47,7 +50,6 @@
},
methods: {
//tab
async changeTab(e) {
@ -160,14 +162,15 @@
.nav-item {
display: inline-block;
/* width: 150upx; */
width: 50%;
/* width: 33.33%; */
height: 90upx;
text-align: center;
line-height: 90upx;
font-size: 30upx;
color: #303133;
/* color: #303133; */
color: gray;
position: relative;
font-weight: 900;
&:after {
content: '';
width: 0;

Loading…
Cancel
Save