10.25修改

This commit is contained in:
阿怪 2023-10-25 00:18:08 +08:00
parent f55439859b
commit 6a45185641
7 changed files with 125 additions and 16 deletions

View File

@ -18,9 +18,10 @@
import {useStore} from '@/store/index.js'
const store = useStore()
onLaunch((e) => {
console.log('App onLaunch')
console.log('App onLaunch')
let userInfo = uni.getStorageSync('userInfo')
if(userInfo) {
if(userInfo) { //
store.userInfo = userInfo
}
})

View File

@ -10,6 +10,8 @@ const API = {
// 首页
getHospitalList:data => net.GET('/hospital/list',data), // 获取医院信息
saveVision:data => net.POST("/vision",data),// 保存视力测试结果
getLbtList:data => net.GET("/banner/list",data),// 获取轮播图
hospital:data => net.PUT("/user/hospital",data),// 修改医院信息
// 百科
getArticleList:data => net.GET("/article/list",data),// 百科列表
getArticleDetail:data => net.GET("/article/"+data.id),// 百科列表

View File

@ -1,6 +1,6 @@
// isdev 为 true 表示开发环境 false 表示发布环境
const isdev = true;
const baseUrl = isdev ? 'http://18b10cba.r6.cpolar.top' : 'http://18b10cba.r6.cpolar.top';// 办公室接口 & 测试环境
const baseUrl = isdev ? 'http://eb467b6.r19.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';// 正式环境(由于本地测试后台没有启动,暂时通用正式服)

View File

@ -4,23 +4,31 @@
import uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
import { onLoad } from "@dcloudio/uni-app"
import mySwiper from "@/components/mySwiper.vue"
import {ref,onMounted,nextTick} from "vue"
import {ref,onMounted,nextTick,watch} from "vue"
import api from '@/api/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?.has_operation) { //
operation_flag.value = true
getLbtList()
if(store.userInfo && !store.operation_info) { //
// getHospitalList()
setTimeout(()=>{
// console.log(inputDialog.value)
inputDialog.value.open()
},0)
}
})
//
const hospitals = ref(null)
// const hospitals_show = ref(false)
const inputDialog = ref()
const inputClose = ref()
const operation_flag = ref(false)
const choosed_h = ref(null)
const blur_h = ref(0)
const surgery_time = ref(null) //
const isSurgery = ref(-1) // 01
const lbt_list = ref([
{
banner_name: "首页轮播2",
@ -44,26 +52,82 @@
weigh: 6,
}
])
//
// watch(blur_h,(val1,val2) => {
// // hospitals.value = null
// console.log(' ',choosed_h.value)
// if(!choosed_h) { //
// }
// })
//
async function getHospitalList() {
const res = await api.getHospitalList()
if(res.code == 0) {
hospitals.value = res.data.list
}
}
async function getLbtList() { //
const res = await api.getLbtList()
if(res.code == 0) {
}
}
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);
console.log('maskClick事件:', e);
}
const hValue = ref('') //
const hValueId = ref('') // id
function onClickH(e) {
// console.log(hValue.value)
getHospitalList()
}
function toExam() { //
uni.navigateTo({
url:"/pages/index/visionTest"
})
}
function toChooseH(item) {
console.log(item)
choosed_h.value = item
hValue.value = item.name
hospitals.value = null
}
// 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() {
let user_info = JSON.parse(uni.getStorageSync('userInfo'))
const res = await api.hospital({
isSurgery:isSurgery.value,
surgery_time:surgery_time.value,
userId:user_info.userId,
hospitalId:choosed_h.value.ID
})
console.log(res)
if(res.code == 0) {
}
}
</script>
<template>
<view class="content page-box">
@ -104,7 +168,7 @@
</view>
</view>
</view>
<uni-popup ref="inputDialog" :is-mask-click='false'>
<uni-popup ref="inputDialog" @tap="toBlur" :is-mask-click='false'>
<view class="pop-box">
<view class="pb-title">完善手术信息</view>
<view class="pb-content">
@ -121,15 +185,21 @@
<view class="pb-item-left">手术时间</view>
<view class="pb-item-right">
<!-- <uni-datetime-picker type="date" :clear-icon="false" v-model="single" @maskClick="maskClick" /> -->
<uniDatetimePicker type="date" :clear-icon="false" v-model="single" @maskClick="maskClick" ></uniDatetimePicker>
<uniDatetimePicker type="date" :clear-icon="false" v-model="surgery_time" @maskClick="maskClick" ></uniDatetimePicker>
</view>
</view>
<view class="pb-item">
<view class="pb-item-left">医院名称</view>
<view class="pb-item-right">
<uniEasyinput suffixIcon="search" v-model="hValue" focus placeholder="请输入内容" @iconClick="onClickH"></uniEasyinput>
<uniEasyinput @tap.stop="focusFunc" suffixIcon="search" v-model="hValue" focus placeholder="请输入内容" @iconClick="onClickH"></uniEasyinput>
<view class="h_res_show_aprt" v-if="hospitals">
<view v-for="(item,i) in hospitals" @tap.stop="toChooseH(item)" class="h_res_show_aprt_row text-ellipsis-1">
{{item.name}}
</view>
</view>
</view>
</view>
<view class="pb-item pb-item-btn" @tap="toSave">提交</view>
</view>
</view>
<view class="pop-close" @tap="toClose">
@ -141,6 +211,36 @@
</view>
</template>
<style scoped lang="scss">
.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
}
}
.mc-row{
display:flex;
// width: 100%;
@ -166,6 +266,7 @@
width: 30%;
}
.pb-item-right{
position: relative;
margin-left: 10rpx;
width: 75%;
}

View File

@ -77,6 +77,7 @@
avatarUrl.value = file.data.file.url
uni.setStorageSync('avatarUrl', file.data.file.url);//
const up_res = await updateFunc() //
// isInfo // 使
uni.switchTab({
url:"/pages/user/index"
})

View File

@ -55,9 +55,12 @@
})
}
function toUserInfo() {
uni.navigateTo({
url:"/pages/user/userInfo"
})
if(is_login.value) {
uni.navigateTo({
url:"/pages/user/userInfo"
})
}
}
function getPhoneNumber (e) {
// tel_code.value = e.detail.code
@ -81,7 +84,7 @@
const res = await api.getToken(data)
if(res.code === 200) {
if(res.data.newUser) { //
toUserInfo()
toLogin()
}
else{
uni.setStorageSync('avatarUrl', res.data.avatar);//avatarUrl

View File

@ -23,7 +23,8 @@ export const useStore = defineStore('main2', {
cartList:[],
cartChange:false,
remark_text:'',
address:''
address:'',
operation_info:null, // 手术信息
}
},
actions:{