| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- import Apis from '@/common/apis/index'
- export default {
- async initData() {
- try {
- uni.showLoading({
- title: '加载中...'
- })
- const res = await Apis.GetAssociation()
- this.userList = res.data
- this.currentPatient = this.userList.length ? this.userList[0] : null
- this.$store.commit('SET_CURRENT_PATIENT', this.currentPatient)
- this.initHealthReport();
- } catch (e) {
- //TODO handle the exception
- }
- },
- async initHealthReport() {
- try {
- const res = await Apis.GetHealthReport({
- id: this.currentPatient.id
- })
- res.data.forEach((v) => {
- v.date = v.time && v.time.split(' ')[0]
- })
- this.currentPatient = {
- ...this.currentPatient,
- ...res.data[0]
- }
- this.data = res.data
- uni.hideLoading()
- } catch (e) {
- //TODO handle the exception
- }
- },
- onEnterPage(page) {
- if (!this.userInfo) {
- return uni.navigateTo({
- url: '../login/index'
- })
- }
- switch (page) {
- case 'addPatient':
- uni.navigateTo({
- url: '../addPatient/index'
- })
- break
- }
- },
- bindLookMemo(name){
- this.popupData.title = name
- this.popupData.img = ''
- switch (name) {
- case '球镜':
- this.popupData.content =
- '球镜(S)代表近视或者远视的度数,单位为屈光度(D),其屈光力大小在各个方向相同。当球镜符号为(﹣)时代表近视,符号为(+)时代表远视。医学上用于记录的方式与我们生活中所说的眼镜度数略有不同,-3.00DS代表“300度近视”,而+2.50DS则代表“250度远视”。'
- break
- case '柱镜':
- this.popupData.content =
- '柱镜(C)表示散光的度数,单位为屈光度(D),散光是指眼睛在不同方向上的屈光力并不相同,使外界的平行光线进入眼睛后不能形成一个焦点,此时需要通过柱镜进行矫正。当柱镜符号为(﹣)时代表近视散光,符号为(+)时代表远视散光。如-0.50DC代表“50度近视散光”,+0.75DC代表“75度远视散光”。'
- break
- case '轴位':
- this.popupData.content =
- '轴位(A)代表柱镜所在轴的方向。当眼睛存在散光时,需要通过柱镜对屈光状态进行矫正,此时精确验配柱镜的轴位可以良好的改善视觉效果,如果眼镜散光轴位验配误差较大,则有可能导致镜片适应不良、视物变形、头晕甚至呕吐。'
- break
- }
- this.$refs.popupShow.open()
- },
- bindChangeUserPopup() {
- this.$refs.userPopup.open()
- },
- bindConfirmUser() {
- uni.showLoading({
- title: '加载中...'
- })
- this.currentPatient = this.userList.length ? this.userList[this.userValue[0]] : null
- this.$store.commit('SET_CURRENT_PATIENT', this.currentPatient)
- this.initHealthReport();
- this.$refs.userPopup.close()
- },
- bindChangeDate(item, index) {
- this.dateIndex = index
- this.scrollView = 'bl' + item.code
- },
- bindChangeUserList(event) {
- this.userValue = event.detail.value
- },
- }
|