10.25修改
This commit is contained in:
parent
f55439859b
commit
6a45185641
5
App.vue
5
App.vue
@ -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
|
||||
}
|
||||
})
|
||||
|
@ -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),// 百科列表
|
||||
|
@ -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';// 正式环境(由于本地测试后台没有启动,暂时通用正式服)
|
||||
|
||||
|
@ -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) //是否已经手术 0为手术,1已经手术
|
||||
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%;
|
||||
}
|
||||
|
@ -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"
|
||||
})
|
||||
|
@ -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
|
||||
|
@ -23,7 +23,8 @@ export const useStore = defineStore('main2', {
|
||||
cartList:[],
|
||||
cartChange:false,
|
||||
remark_text:'',
|
||||
address:''
|
||||
address:'',
|
||||
operation_info:null, // 手术信息
|
||||
}
|
||||
},
|
||||
actions:{
|
||||
|
Loading…
Reference in New Issue
Block a user