From c92a6c546d54eb177c5cdadbab1e1ef02a2d907b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Tue, 10 Oct 2023 17:15:30 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E7=BA=A6=E7=AD=9B=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 7 +- pages/medicalservice/medicalservice.vue | 52 +++---- pagesB/orderlist/orderlist.vue | 25 ++-- pagesB/screenorder/screenorder.vue | 176 ++++++++++++------------ 4 files changed, 131 insertions(+), 129 deletions(-) diff --git a/pages.json b/pages.json index 30f9cc8..8354f64 100644 --- a/pages.json +++ b/pages.json @@ -269,14 +269,15 @@ "path": "nursestation/nursestation", "style": { "navigationBarTitleText": "护理机构详情", - "onReachBottomDistance": 100, //距离底部多远时触发 单位为px + "onReachBottomDistance": 40, //距离底部多远时触发 单位为px "enablePullDownRefresh": true //设置参数为true } }, { "path": "site/site", "style": { "navigationBarTitleText": "护理机构", - "onReachBottomDistance": 100, //距离底部多远时触发 单位为px + "navigationStyle": "custom", // 隐藏系统导航栏 + "onReachBottomDistance": 20, //距离底部多远时触发 单位为px "enablePullDownRefresh": true //设置参数为true } }, { @@ -544,4 +545,4 @@ // } ] } -} \ No newline at end of file +} diff --git a/pages/medicalservice/medicalservice.vue b/pages/medicalservice/medicalservice.vue index b48e88d..89d353e 100644 --- a/pages/medicalservice/medicalservice.vue +++ b/pages/medicalservice/medicalservice.vue @@ -71,24 +71,24 @@ // 筛查预约 // this.userInfo - // let userInfo = uni.getStorageSync('userInfo') - // if (!userInfo) { - // uni.showModal({ - // title: "提示", - // content: "您还未注册,是否去注册?", - // confirmText: '是', - // cancelText: '否', - // success(res) { - // if (res.confirm) { - // uni.redirectTo({ - // url: "/pages/login/login?mode=注册" - // }) - // } else { - // wx.exitMiniProgram() - // } - // }, - // }) - // } else { + let userInfo = uni.getStorageSync('userinfo') + if (!userInfo) { + uni.showModal({ + title: "提示", + content: "您还未注册,是否去注册?", + confirmText: '是', + cancelText: '否', + success(res) { + if (res.confirm) { + uni.redirectTo({ + url: "/pages/register/register" + }) + } else { + wx.exitMiniProgram() + } + }, + }) + } else { // if (!uni.getStorageSync('userInfo').identity) { // uni.navigateTo({ // url: '../../pagesB/modifyInfo/modifyInfo' @@ -97,28 +97,28 @@ // } this.patientId = uni.getStorageSync('patientId'); getScreening(this.patientId).then(res => { - if (res.data.code == 200) { - // let userInfo = JSON.stringify(this.userInfo) + if (res.code == 200) { + let userinfo = JSON.stringify(userInfo) if (!res.data) { uni.navigateTo({ - url: '/pagesB/screenorder/screenorder' + url: `/pagesB/screenorder/screenorder?userinfo=${userinfo}` }) } else { uni.navigateTo({ - url: '/pagesB/orderlist/orderlist' + url: `/pagesB/orderlist/orderlist?userinfo=${userinfo}` }) } } }) - // } + } // uni.navigateTo({ // url: '/pagesB/screenorder/screenorder' // }) - uni.navigateTo({ - url: '/pagesB/orderlist/orderlist' - }) + // uni.navigateTo({ + // url: '/pagesB/orderlist/orderlist' + // }) }, //跳转健康常识item gohealthitem(item) { diff --git a/pagesB/orderlist/orderlist.vue b/pagesB/orderlist/orderlist.vue index d39bb6d..e2cb9b9 100644 --- a/pagesB/orderlist/orderlist.vue +++ b/pagesB/orderlist/orderlist.vue @@ -4,7 +4,7 @@ 新增预约 @@ -75,12 +76,12 @@ datetimerange: [Date.now(), this.todayEndTime()], test: ['1'], formData: { - residentName: '', - identity: '370921199810180329', - certType: '1', - gender: '', - birthday: '1998-10-18', - phone: '18854188230', + patientName: '', + identity: '', + certType: '', + sex: '', + birthDate: '', + phone: '', address: '', disease: '', height: '', @@ -125,7 +126,7 @@ value: '1' }], rules: { - residentName: [{ + patientName: [{ required: true, message: '请填写姓名', trigger: ['blur', 'change'] @@ -182,48 +183,46 @@ } } }, + onReady() { + this.$refs.form1.setRules(this.rules); + }, onLoad(e) { - console.log(e, '55') - // if (e) { - // this.userInfo = JSON.parse(e.userInfo) - // this.diseaseValue = this.userInfo.disease.split(',') - // if (this.userInfo.gender == '1') { - // this.userInfo.gender = '男' - // } else { - // this.userInfo.gender = '女' - // } - // this.userInfo.age = getAgeFun(this.userInfo.birthday) - // } - // this.init() + if (e) { + this.userInfo = JSON.parse(e.userInfo) + this.formData.disease = this.userInfo.diseaseList.join(',') + + if (this.userInfo.sex == 'MALE') { + this.userInfo.sex = '男' + } else { + this.userInfo.sex = '女' + } + this.userInfo.age = getAgeFun(this.userInfo.birthDate) + } this.getDeptAndPro() }, + methods: { getDeptAndPro() { getDeptList().then(res => { - console.log(res, '1') - // if (res.data.code == 200) { this.DeptList = res.data.map(item => { - console.log(item, '888') return { text: item.hospitalName, value: item.id } }) - // } }) getProlist({ projectType: 1, status: 0 }).then(res => { - // if (res.data.code == 200) { - this.ProList = res.data.map(item => { - console.log(item, '999') - return { - text: item.projectName, - value: item.projectId - } - }) - // } + if (res.code == 200) { + this.ProList = res.data.map(item => { + return { + text: item.projectName, + value: item.projectId + } + }) + } }) }, changeDept(e) { @@ -240,41 +239,38 @@ return todayTime }, changeDisease() { - if (this.formData.disease.length != 0 && this.formData.disease.find(item => item != '0')) { - this.disease[3].disable = true + if (this.formData.diseaseList.length != 0 && this.formData.diseaseList.find(item => item != '0')) { + this.diseaseList[3].disable = true } - if (this.formData.disease.length != 0 && this.formData.disease.find(item => item == '0')) { - this.disease[0].disable = true - this.disease[1].disable = true - this.disease[2].disable = true - this.formData.disease = ['0'] - this.disease[3].disable = false + if (this.formData.diseaseList.length != 0 && this.formData.diseaseList.find(item => item == '0')) { + this.diseaseList[0].disable = true + this.diseaseList[1].disable = true + this.diseaseList[2].disable = true + this.formData.diseaseList = ['0'] + this.diseaseList[3].disable = false } - if (this.formData.disease.length == 0) { - for (let item in this.disease) { - this.disease[item].disable = false + if (this.formData.diseaseList.length == 0) { + for (let item in this.diseaseList) { + this.diseaseList[item].disable = false } } }, changeCheckbox(e) { if (e.detail.value.length != 0 && e.detail.value.find(item => item != '0')) { - this.disease[3].disable = true + this.diseaseList[3].disable = true } if (e.detail.value.length != 0 && e.detail.value.find(item => item == '0')) { - this.disease[0].disable = true - this.disease[1].disable = true - this.disease[2].disable = true + this.diseaseList[0].disable = true + this.diseaseList[1].disable = true + this.diseaseList[2].disable = true } if (e.detail.value.length == 0) { - for (let item in this.disease) { - this.disease[item].disable = false + for (let item in this.diseaseList) { + this.diseaseList[item].disable = false } } }, process() { - let _this = this - console.log(this.formData, '123') - if (!this.formData.hospitalId) { uni.showModal({ title: '提示', @@ -297,24 +293,23 @@ return } - this.formData.patientId = uni.getStorageSync('patientId'); - // this.formData.identity = this.userInfo.identity - // this.formData.disease = this.userInfo.disease + this.formData.patientId = uni.getStorageSync('patientId'); + this.formData.identity = this.userInfo.cardNo + this.formData.diseaseList = this.userInfo.diseaseList this.formData.applyStartTime = this.datetimerange[0] this.formData.applyEndTime = this.datetimerange[1] - if (this.formData.gender == '男') { - this.formData.gender = '1' + if (this.formData.sex == '男') { + this.formData.sex = 'MALE' } else { - this.formData.gender = '2' + this.formData.sex = 'FEMALE' } screenOrder(this.formData).then(res => { - // this.formData.disease = this.formData.disease.split(',') - if (this.formData.gender == '1') { - this.formData.gender = '男' + // this.formData.diseaseList = this.formData.diseaseList.slice(',') + if (this.formData.sex == 'MALE') { + this.formData.sex = '男' } else { - this.formData.gender = '女' + this.formData.sex = '女' } - console.log(res,'55') if (res.code == 200) { uni.showToast({ title: '预约成功', @@ -322,29 +317,40 @@ }); setTimeout(() => { // uni.navigateTo({ - // url: `../screensuccess/screensuccess?registerId=${res.data.data}` - // url: `/pageB/orderlist/orderlist?patientId=${this.formData.patientId}` - // url: '/pageB/orderlist/orderlist'/ + // url: `../screensuccess/screensuccess?registerId=${res.data.data}` + // url: `/pageB/orderlist/orderlist?patientId=${this.formData.patientId}` + // url: '/pageB/orderlist/orderlist'/ // }) uni.navigateBack({ delta: 1 }) }, 1000) + } else if (res.code == 500) { + this.$refs.uToast.show({ + title: res.msg, + type: 'error' + }) + } }) }, submit() { - // console.log(8) - // this.$refs.form1.validate().then(res => { - // console.log(res,'555') - this.process() - // }).catch(errors => { - return - // }) + let that = this + that.$refs.form1.validate(valid => { + // console.log(111) + if (valid) { + + + + } + }).catch(errors => { + return + }) + }, IdentityBlur(e) { - this.formData.gender = getSex(e) - this.formData.birthday = getBirthday(e) + this.formData.sex = getSex(e) + this.formData.birthDate = getBirthday(e) } } } @@ -446,4 +452,4 @@ /deep/.u-button__text { font-size: 34rpx !important; } - + \ No newline at end of file