From df74f02d3bb4e9045d53e4a229f3b5e04d5b248f Mon Sep 17 00:00:00 2001 From: jazz <jazzxhunter@163.com> Date: 星期五, 22 十二月 2023 16:01:19 +0800 Subject: [PATCH] update_202312221600_卸麻通知和称谓显示v1 --- src/pages/room/detail.vue | 41 +++++++++++++++++++++++++++++------------ 1 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue index 176048d..bfc6358 100644 --- a/src/pages/room/detail.vue +++ b/src/pages/room/detail.vue @@ -234,7 +234,7 @@ // import xioFn from './utils/xio_fn.js' var isUseDefault = false // 鏄惁宸蹭娇鐢ㄩ粯璁ゅ浜� var isUseDefaultChg = 0// 宸蹭娇鐢ㄩ粯璁ゅ浜哄悗鎴块棿鏄惁鏈夋敼鍙樼姸鎬� -var isOffNarcosis = '0'// 鏄惁鍗搁夯锛岄粯璁ゅ凡鍗搁夯锛屽嵆涓嶅脊鍑哄脊妗� +var offNarcosisIds = [] // 鏄惁宸查�氱煡鍗搁夯id鏁扮粍 export default { name: 'RoomDetail', components: { @@ -296,10 +296,13 @@ console.log('roomDetail mounted') // 璁板綍褰撳墠鐨勬不鐤桰D var curTreatId = localStorage.getItem('curTreatId') - var localIsOffNarcosis = localStorage.getItem('isOffNarcosis') - // 鏄惁宸查�氱煡鍗搁夯 - if (localIsOffNarcosis) { - isOffNarcosis = localIsOffNarcosis + var localOffNarcosisIds = localStorage.getItem('offNarcosisIds') + // 鑾峰彇鏄惁宸查�氱煡鍗搁夯鏁扮粍 + if (localOffNarcosisIds) { + offNarcosisIds = JSON.parse(localOffNarcosisIds) + } else { + offNarcosisIds = [] + this.setLocalStorageOffNarcosisIds() } this.curTreatId = curTreatId || '' this.id = this.$route.query.id || '' @@ -320,10 +323,16 @@ this.pollingAjaxFn(this, 'getData', 'detail', 8000) // this.getData() }, + // 璁剧疆宸查�氱煡鍗搁夯id鏁扮粍 + setLocalStorageOffNarcosisIds() { + localStorage.setItem('offNarcosisIds', JSON.stringify(offNarcosisIds)) + }, // 鍗搁夯閫氱煡纭 offNarcosisNoticeConfirm() { - isOffNarcosis = '1' - localStorage.setItem('isOffNarcosis', '1') + if (this.occupyInfoView) { + offNarcosisIds.push(this.occupyInfoView.visitOrderId) + this.setLocalStorageOffNarcosisIds() + } }, // 鏄剧ず閫氱煡鍗搁夯寮圭獥 showOffNarcosisNotice() { @@ -393,9 +402,19 @@ } } // console.log('999999999999999999999999999', res) - // todo 寮圭獥鏄剧ず鍒ゆ柇 - // isOffNarcosis === '0' - // this.showOffNarcosisNotice() + var offNarcosisTimer = null + offNarcosisTimer = setTimeout(() => { + console.log('================================>', this.occupyInfoView) + if (this.occupyInfoView && this.occupyInfoView.hempStatus === 1 && this.occupyInfoView.visitOrderId) { + var flag + offNarcosisIds && offNarcosisIds.length && (flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.visitOrderId })) + if (!flag) { + this.showOffNarcosisNotice() + } + } + clearTimeout(offNarcosisTimer) + offNarcosisTimer = null + }, 500) }) }, // 杩斿洖 @@ -403,8 +422,6 @@ // 閲嶇疆榛樿宸蹭娇鐢ㄥ浜虹殑鍙傛暟 isUseDefault = false isUseDefaultChg = 0 - isOffNarcosis = '0' - localStorage.setItem('isOffNarcosis', '0') // 鍏抽棴璁℃椂 this.stopCountGetTime('detail') // 鍏抽棴杞 -- Gitblit v1.8.0