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' import {useStore} from '@/store/index.js'
const store = useStore() const store = useStore()
onLaunch((e) => { onLaunch((e) => {
console.log('App onLaunch') console.log('App onLaunch')
let userInfo = uni.getStorageSync('userInfo') let userInfo = uni.getStorageSync('userInfo')
if(userInfo) { if(userInfo) { //
store.userInfo = userInfo store.userInfo = userInfo
} }
}) })

View File

@ -10,6 +10,8 @@ const API = {
// 首页 // 首页
getHospitalList:data => net.GET('/hospital/list',data), // 获取医院信息 getHospitalList:data => net.GET('/hospital/list',data), // 获取医院信息
saveVision:data => net.POST("/vision",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),// 百科列表 getArticleList:data => net.GET("/article/list",data),// 百科列表
getArticleDetail:data => net.GET("/article/"+data.id),// 百科列表 getArticleDetail:data => net.GET("/article/"+data.id),// 百科列表

View File

@ -1,6 +1,6 @@
// isdev 为 true 表示开发环境 false 表示发布环境 // isdev 为 true 表示开发环境 false 表示发布环境
const isdev = true; 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 = isdev ? 'http://192.168.1.133:8899' : 'https://api.gwkjxb.com';// 办公室接口 & 正式环境
// const baseUrl = '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 uniEasyinput from '@/uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue'
import { onLoad } from "@dcloudio/uni-app" import { onLoad } from "@dcloudio/uni-app"
import mySwiper from "@/components/mySwiper.vue" 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 {useStore} from '@/store/index.js'
// import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue' // import uniIcons from '@/uni_modules/uni-icons/components/uni-icons/uni-icons.vue'
const store = useStore() const store = useStore()
onLoad((e) => { onLoad((e) => {
if(!store.userInfo?.has_operation) { // getLbtList()
operation_flag.value = true if(store.userInfo && !store.operation_info) { //
// getHospitalList()
setTimeout(()=>{ setTimeout(()=>{
// console.log(inputDialog.value) // console.log(inputDialog.value)
inputDialog.value.open() inputDialog.value.open()
},0) },0)
} }
}) })
// //
const hospitals = ref(null)
// const hospitals_show = ref(false)
const inputDialog = ref() const inputDialog = ref()
const inputClose = 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([ const lbt_list = ref([
{ {
banner_name: "首页轮播2", banner_name: "首页轮播2",
@ -44,26 +52,82 @@
weigh: 6, 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() { function toClose() {
inputDialog.value.close() inputDialog.value.close()
} }
function radioChange(e) { function radioChange(e) {
console.log(e) console.log(e)
isSurgery.value = e.detail.value
} }
const single = ref('') const single = ref('')
function maskClick(e){ function maskClick(e){
// console.log('maskClick:', e); console.log('maskClick事件:', e);
} }
const hValue = ref('') // const hValue = ref('') //
const hValueId = ref('') // id const hValueId = ref('') // id
function onClickH(e) { function onClickH(e) {
// console.log(hValue.value) // console.log(hValue.value)
getHospitalList()
} }
function toExam() { // function toExam() { //
uni.navigateTo({ uni.navigateTo({
url:"/pages/index/visionTest" 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> </script>
<template> <template>
<view class="content page-box"> <view class="content page-box">
@ -104,7 +168,7 @@
</view> </view>
</view> </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="pop-box">
<view class="pb-title">完善手术信息</view> <view class="pb-title">完善手术信息</view>
<view class="pb-content"> <view class="pb-content">
@ -121,15 +185,21 @@
<view class="pb-item-left">手术时间</view> <view class="pb-item-left">手术时间</view>
<view class="pb-item-right"> <view class="pb-item-right">
<!-- <uni-datetime-picker type="date" :clear-icon="false" v-model="single" @maskClick="maskClick" /> --> <!-- <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> </view>
<view class="pb-item"> <view class="pb-item">
<view class="pb-item-left">医院名称</view> <view class="pb-item-left">医院名称</view>
<view class="pb-item-right"> <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> </view>
<view class="pb-item pb-item-btn" @tap="toSave">提交</view>
</view> </view>
</view> </view>
<view class="pop-close" @tap="toClose"> <view class="pop-close" @tap="toClose">
@ -141,6 +211,36 @@
</view> </view>
</template> </template>
<style scoped lang="scss"> <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{ .mc-row{
display:flex; display:flex;
// width: 100%; // width: 100%;
@ -166,6 +266,7 @@
width: 30%; width: 30%;
} }
.pb-item-right{ .pb-item-right{
position: relative;
margin-left: 10rpx; margin-left: 10rpx;
width: 75%; width: 75%;
} }

View File

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

View File

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

View File

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