From 1c200b3f9934e5c655b9d69a59b626cac14fd63e Mon Sep 17 00:00:00 2001
From: jazz <jazzxhunter@163.com>
Date: 星期三, 27 十二月 2023 12:18:43 +0800
Subject: [PATCH] update_202312271217_门店选择修改

---
 src/pages/room/detail.vue |   89 +++++++++++++++++++++++++++++++++-----------
 1 files changed, 66 insertions(+), 23 deletions(-)

diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue
index 176048d..776f69f 100644
--- a/src/pages/room/detail.vue
+++ b/src/pages/room/detail.vue
@@ -124,17 +124,24 @@
               </div>
             </div>
           </div>
-          <div v-show="!isShowAppellationName" class="name">
-            <el-popover
-              placement="top"
-              width="400"
-              popper-class="top_tx"
-              trigger="click"
-              :popper-options="{ removeOnDestroy: true }"
-            >
-              <div>{{ occupyInfoView.userName }}</div>
-              <div slot="reference" class="tx ell">{{ occupyInfoView.userName }}</div>
-            </el-popover>
+          <div v-show="!isShowAppellationName" class="flex flex-center">
+            <div class="flex flex-ver">
+              <div class="name">
+                <el-popover
+                  placement="top"
+                  width="400"
+                  popper-class="top_tx"
+                  trigger="click"
+                  :popper-options="{ removeOnDestroy: true }"
+                >
+                  <div>{{ occupyInfoView.userName }}</div>
+                  <div slot="reference" class="tx ell">{{ occupyInfoView.userName }}</div>
+                </el-popover>
+              </div>
+              <div class="name_icon" @click="tapAppellationHandle">
+                <img class="img" src="static/imgs/eye.png">
+              </div>
+            </div>
           </div>
           <div v-if="occupyInfoView.ciq" class="ciq">({{ occupyInfoView.ciq }})</div>
           <div v-if="occupyInfoView.startTime" class="time">瀹夋帓娌荤枟鏃堕棿锛歿{ occupyInfoView.startTime }} 寮�濮�</div>
@@ -234,7 +241,8 @@
 // import xioFn from './utils/xio_fn.js'
 var isUseDefault = false // 鏄惁宸蹭娇鐢ㄩ粯璁ゅ浜�
 var isUseDefaultChg = 0// 宸蹭娇鐢ㄩ粯璁ゅ浜哄悗鎴块棿鏄惁鏈夋敼鍙樼姸鎬�
-var isOffNarcosis = '0'// 鏄惁鍗搁夯锛岄粯璁ゅ凡鍗搁夯锛屽嵆涓嶅脊鍑哄脊妗�
+var offNarcosisIds = [] // 鏄惁宸查�氱煡鍗搁夯id鏁扮粍
+var isOffNarcosisShow = false // 鏄惁鏄剧ず宸查�氱煡鍗搁夯寮圭獥
 export default {
   name: 'RoomDetail',
   components: {
@@ -296,10 +304,17 @@
     console.log('roomDetail mounted')
     // 璁板綍褰撳墠鐨勬不鐤桰D
     var curTreatId = localStorage.getItem('curTreatId')
-    var localIsOffNarcosis = localStorage.getItem('isOffNarcosis')
-    // 鏄惁宸查�氱煡鍗搁夯
-    if (localIsOffNarcosis) {
-      isOffNarcosis = localIsOffNarcosis
+    var localOffNarcosisIds = localStorage.getItem('offNarcosisIds')
+    var localIsOffNarcosisShow = localStorage.getItem('isOffNarcosisShow')
+    // 鑾峰彇鏄惁宸查�氱煡鍗搁夯鏁扮粍
+    if (localOffNarcosisIds) {
+      offNarcosisIds = JSON.parse(localOffNarcosisIds)
+    } else {
+      offNarcosisIds = []
+      this.setLocalStorageOffNarcosisIds()
+    }
+    if (localIsOffNarcosisShow) {
+      isOffNarcosisShow = localIsOffNarcosisShow
     }
     this.curTreatId = curTreatId || ''
     this.id = this.$route.query.id || ''
@@ -320,10 +335,25 @@
       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) {
+        if (offNarcosisIds && offNarcosisIds.length) {
+          var flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId })
+          if (!flag) {
+            offNarcosisIds.push(this.occupyInfoView.userId)
+          }
+        } else if (offNarcosisIds) {
+          offNarcosisIds.push(this.occupyInfoView.userId)
+        }
+        this.setLocalStorageOffNarcosisIds()
+      }
+      isOffNarcosisShow = true
+      localStorage.setItem('isOffNarcosisShow', true)
     },
     // 鏄剧ず閫氱煡鍗搁夯寮圭獥
     showOffNarcosisNotice() {
@@ -380,6 +410,10 @@
               o.appellationName = o.userName[0] + `${o.gender ? ['濂冲+', '鍏堢敓', '濂冲+'][o.gender] : '濂冲+'}`
             })
           }
+          // 宸插崰鐢ㄧ敤鎴锋暟鎹鐞�
+          if (res.data.occupyInfo && res.data.occupyInfo.userName) {
+            res.data.occupyInfo.appellationName = res.data.occupyInfo.userName[0] + `${res.data.occupyInfo.gender ? ['濂冲+', '鍏堢敓', '濂冲+'][res.data.occupyInfo.gender] : '濂冲+'}`
+          }
           // 宸叉湁鍗犵敤鐨勶紝鏇存敼宸蹭娇鐢ㄩ粯璁ゅ浜虹殑鐘舵��
           res.data.occupyInfo && (isUseDefaultChg = 1)
           res.data.occupyInfo && (isUseDefault = 1)
@@ -393,9 +427,20 @@
           }
         }
         // console.log('999999999999999999999999999', res)
-        // todo 寮圭獥鏄剧ず鍒ゆ柇
-        // isOffNarcosis === '0'
-        // this.showOffNarcosisNotice()
+        var offNarcosisTimer = null
+        offNarcosisTimer = setTimeout(() => {
+          console.log('================================>', this.occupyInfoView, 'offNarcosisIds:', offNarcosisIds, 'isOffNarcosisShow:', isOffNarcosisShow)
+          if (this.occupyInfoView && this.occupyInfoView.hempStatus === 2 && this.occupyInfoView.userId) {
+            var flag
+            offNarcosisIds && offNarcosisIds.length && (flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId }))
+            // flag = isOffNarcosisShow
+            if (!flag) {
+              this.showOffNarcosisNotice()
+            }
+          }
+          clearTimeout(offNarcosisTimer)
+          offNarcosisTimer = null
+        }, 500)
       })
     },
     // 杩斿洖
@@ -403,8 +448,6 @@
       // 閲嶇疆榛樿宸蹭娇鐢ㄥ浜虹殑鍙傛暟
       isUseDefault = false
       isUseDefaultChg = 0
-      isOffNarcosis = '0'
-      localStorage.setItem('isOffNarcosis', '0')
       // 鍏抽棴璁℃椂
       this.stopCountGetTime('detail')
       // 鍏抽棴杞

--
Gitblit v1.8.0