From bf4dca5344dee1a84b75d9993f4dfc59de3f3ee9 Mon Sep 17 00:00:00 2001 From: jazz <jazzxhunter@163.com> Date: 星期五, 08 十二月 2023 19:34:49 +0800 Subject: [PATCH] update_202312081934_项目-治疗室屏幕web-反馈调整 --- index.html | 2 src/pages/room/list.vue | 10 ++ src/App.vue | 45 ++++++----- src/router/index.js | 82 +++++++++++++++++--- src/pages/room/detail.vue | 64 +++++++++++---- 5 files changed, 151 insertions(+), 52 deletions(-) diff --git a/index.html b/index.html index 6ef8e6b..9fb1644 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ <head> <meta charset="utf-8"> <title>鑺欒壘鍖荤枟</title> - <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0, viewprot-fit:cover, minimal-ui"> + <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0, viewprot-fit=cover, minimal-ui"> <meta name="renderer" content="webkit"> <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" /> <!-- 搴旂敤浠ュ叏灞忔ā寮忚繍琛� --> diff --git a/src/App.vue b/src/App.vue index b371ff0..2aefc40 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,7 +2,12 @@ <div id="app"> <transition name="fade" mode="out-in"> <!-- 椤甸潰锛宨sRouterAlive 鍒锋柊鐢� --> - <router-view v-if="isRouterAlive"/> + <!-- <router-view v-if="isRouterAlive"/> --> + <div> + <keep-alive> + <router-view v-if="isRouterAlive" /> + </keep-alive> + </div> </transition> <!-- Toast 鎻愮ず --> @@ -27,7 +32,7 @@ import Login from '@/utils/jun_login.js' import wxsign from '@/utils/wxsign.js' import Config from './config' -import eruda from 'eruda' +// import eruda from 'eruda' export default { name: 'App', @@ -80,11 +85,11 @@ console.log('app amounted') // 閬垮厤鍒锋柊瀵艰嚧code閲嶅浣跨敤 - let code = this.getQueryString('code') // 寰俊鍥炶皟code - let cover = this.getQueryString('cover') // 鏄惁灏侀潰鍏ュ彛 - let local_code = this.getLocalStorage('code') // 鏈湴缂撳瓨code - let isRule = this.getQueryString('rule')==1 // 瑙勫垯 - let isCoupon = this.getQueryString('coupon')==1 // 浼樻儬鍒� + // let code = this.getQueryString('code') // 寰俊鍥炶皟code + // let cover = this.getQueryString('cover') // 鏄惁灏侀潰鍏ュ彛 + // let local_code = this.getLocalStorage('code') // 鏈湴缂撳瓨code + // let isRule = this.getQueryString('rule')==1 // 瑙勫垯 + // let isCoupon = this.getQueryString('coupon')==1 // 浼樻儬鍒� // 浠ヤ笅鎯呭喌闇�瑕侀噸瀹氬悜鍒伴暱閾� // 1. 閾炬帴甯︽湁code锛屼絾code宸茬粡鐢ㄨ繃 @@ -94,20 +99,20 @@ // 4. 闈炰紭鎯犲埜鍗曢〉 // console.dir(Config.createCodeUrl()) - if(Config.isWxLoginType){ - if (code && local_code == code || (!isCoupon && !isRule && !cover && !code && !Config.ismock && !Config.istest)) { - // 璇ュ井淇ode宸蹭娇鐢紝閲嶆柊璺宠浆闀块摼 - Login.toLongUrl() - return - } else { - this.removeLocalStorage('code') - } - } + // if(Config.isWxLoginType){ + // if (code && local_code == code || (!isCoupon && !isRule && !cover && !code && !Config.ismock && !Config.istest)) { + // // 璇ュ井淇ode宸蹭娇鐢紝閲嶆柊璺宠浆闀块摼 + // Login.toLongUrl() + // return + // } else { + // this.removeLocalStorage('code') + // } + // } // 鍒锋柊鍥哄畾棣栭〉 - if (location.hash && location.hash!='#/') { - this.$router.replace({name: 'root'}) - } + // if (location.hash && location.hash!='#/') { + // this.$router.replace({name: 'root'}) + // } // 鏆撮湶鍒板叏灞�锛宩un_httpEvent.js 璋冪敤 window.appLoading = this.loading.bind(this) @@ -115,7 +120,7 @@ window.appToast = this.toast.bind(this) // this.$refs.audio.play() - if(Config.isWxLoginType) this.wxinit() + // if(Config.isWxLoginType) this.wxinit() }, methods: { // 寰俊鍒濆鍖� diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue index 244a76c..cd28687 100644 --- a/src/pages/room/detail.vue +++ b/src/pages/room/detail.vue @@ -11,6 +11,7 @@ </div> </div> <div class="right flex-1 flex flex-jcfe flex-ver"> + <el-button type="primary" icon="el-icon-refresh" class="reset_btn flex flex-center" size="small" style="width: 100px;" @click="getData">鍒锋柊</el-button> <div class="reset_btn flex flex-center" @click="resetStatus">閲嶇疆鎴块棿鐘舵��</div> <div class="page_date"> <div class="page_week">{{ timeObj.week }}</div> @@ -69,17 +70,17 @@ <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div> <div v-if="roomInfo" class="room_main_tip">-{{ statusTx[roomInfo.status] }}-</div> <div v-if="roomInfo && roomInfo.status >= 1" class="room_left_btn_box flex flex-ver"> - <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow" @click="setStatus('瀹汉浼戞伅', 2)">瀹汉浼戞伅</div> - <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> - <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> - <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green" @click="setStatus('绌洪棽', 0)">缁撴潫鎵撴壂</div> + <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('瀹汉浼戞伅', 2)">瀹汉浼戞伅</div> + <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> + <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> + <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('绌洪棽', 0)">缁撴潫鎵撴壂</div> </div> </div> <div class="right"> <div class="right_block flex flex-col"> <div class="guest_title flex flex-center">绛夊緟璇婄枟</div> <div class="guest_block flex-1"> - <div class="guest_list"> + <div v-if="assignTreatList && assignTreatList.length" class="guest_list"> <div v-for="(item, index) in assignTreatList" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)"> <div class="guest_list__td"> <div class="tx flex flex-ver"> @@ -94,18 +95,22 @@ <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(鍖荤敓)銆�':'' }}{{ item.aNurseName?item.aNurseName+'(鎶ゅ+)':'' }}</span> </div> <div class="guest_list__td flex flex-center"> - <div class="icon"> + <div class="tx">鍒囨崲</div> + <!-- <div class="icon"> <img class="img" src="static/imgs/choose.png"> - </div> + </div> --> </div> </div> + </div> + <div v-if="!assignTreatList || !assignTreatList.length" class="guest_list"> + <div class="guest_list__row flex flex-center rowtip">鏆傛棤鏁版嵁</div> </div> </div> </div> </div> </div> <!-- 瀹汉鍜屾湁瀹夋帓 --> - <div v-if="occupyInfoView && (assignTreatList && assignTreatList.length)" class="page_container flex flex-1"> + <div v-if="occupyInfoView" class="page_container flex flex-1"> <div class="main flex-1"> <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div> <div class="room_content"> @@ -128,10 +133,10 @@ </div> <div v-if="roomInfo" class="room_left_btn_box flex flex-ver" style="margin-top: 105px;"> <div v-if="roomInfo.status == 0" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('浣跨敤涓�', 1)">寮�濮嬫不鐤�</div> - <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow" @click="setStatus('瀹汉浼戞伅', 2)">瀹汉浼戞伅</div> - <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> - <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> - <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green" @click="setStatus('绌洪棽', 0)">缁撴潫鎵撴壂</div> + <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('瀹汉浼戞伅', 2)">瀹汉浼戞伅</div> + <div v-if="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> + <div v-if="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> + <div v-if="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('绌洪棽', 0)">缁撴潫鎵撴壂</div> </div> </div> <div class="right flex flex-col"> @@ -165,7 +170,7 @@ <div class="guest_box flex flex-col"> <div class="guest_title flex flex-center">绛夊緟璇婄枟</div> <div class="guest_block flex-1"> - <div class="guest_list"> + <div v-if="assignTreatList && assignTreatList.length" class="guest_list"> <div v-for="(item, index) in assignTreatList" :key="index" class="guest_list__row flex flex-ver" @click="selectCustomer(item)"> <div class="guest_list__td"> <div class="tx flex flex-ver"> @@ -180,11 +185,15 @@ <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(鍖荤敓)銆�':'' }}{{ item.aNurseName?item.aNurseName+'(鎶ゅ+)':'' }}</span> </div> <div class="guest_list__td flex flex-center"> - <div class="icon"> + <div class="tx">鍒囨崲</div> + <!-- <div class="icon"> <img class="img" src="static/imgs/choose.png"> - </div> + </div> --> </div> </div> + </div> + <div v-if="!assignTreatList || !assignTreatList.length" class="guest_list"> + <div class="guest_list__row flex flex-center rowtip">鏆傛棤鏁版嵁</div> </div> </div> </div> @@ -229,6 +238,7 @@ }, computed: { occupyInfoView() { + // console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg) // 鏈夊崰鐢� if (this.occupyInfo) { return this.occupyInfo @@ -245,15 +255,20 @@ } } }, - mounted() { + activated() { console.log('roomDetail mounted') + this.id = this.$route.query.id || '' this.init() }, + mounted() {}, destroyed() { }, methods: { init() { + // 杩涘叆椤甸潰鍏堝垵濮嬪寲甯搁噺鏍囪瘑 + isUseDefault = false + isUseDefaultChg = 0 // 璁℃椂 this.countGetTime(this, 'timeObj', 'detail') // 杞getData锛�8绉掍竴娆� @@ -319,7 +334,14 @@ // 鍏抽棴杞 this.stopPollingAjaxFn('detail') // 杩斿洖 - this.$router.go(-1) + // console.log('111111111', this.$route.meta.isPush) + if (this.$route && this.$route.meta && this.$route.meta.isPush) { + this.$router.go(-1) + } else { + this.$router.push({ + path: `/` + }) + } }, // 鏈湁瀹夋帓鐩存帴鐘舵�佸彉鏇� statusChg(e) { @@ -440,6 +462,8 @@ text-align: center; font-family: Microsoft Yahei; cursor: pointer; + border: 0; + margin-left: 20px; } .page_container .main { /* height: 100%; */ @@ -629,6 +653,12 @@ .page_container .right .guest_list__row:nth-child(2n) { background-color: #fff; } +.page_container .right .guest_list__row.rowtip { + background-color: #fff; + line-height: 30px; + color: rgba(0,0,0,.5); + font-size: 22px; +} .page_container .right .guest_list__td {} .page_container .right .guest_list__td .tx { line-height: 30px; diff --git a/src/pages/room/list.vue b/src/pages/room/list.vue index ebc4287..b6ba9c1 100644 --- a/src/pages/room/list.vue +++ b/src/pages/room/list.vue @@ -60,6 +60,7 @@ computed: { }, + activated() {}, mounted() { console.log('roomList mounted') this.init() @@ -126,6 +127,15 @@ }, // 璺宠浆璇︽儏 selectRoom(item = {}) { + // console.log(this.$router.options.routes) + // this.$router.options.routes + if (this.$router && this.$router.options && this.$router.options.routes) { + this.$router.options.routes.forEach((o) => { + if (o.name === 'roomDetail') { + o.meta && (o.meta.isPush = true) + } + }) + } this.$router.push({ path: `./room/detail?id=${item.id || ''}` }) diff --git a/src/router/index.js b/src/router/index.js index 53ff605..2877b57 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -18,29 +18,83 @@ // component: () => import('@/pages/login/index') component: () => import('@/pages/room/list') }, - { - path: '/login', - name: 'login', - component: () => import('@/pages/login/index') - }, - { - path: '/index', - name: 'index', - component: () => import('@/pages/index') - }, + // { + // path: '/login', + // name: 'login', + // component: () => import('@/pages/login/index') + // }, + // { + // path: '/index', + // name: 'index', + // component: () => import('@/pages/index') + // }, { path: '/room/list', name: 'roomList', - component: () => import('@/pages/room/list') - // meta: { title: '娌荤枟瀹ゅ垪琛�', keepAlive: true } + component: () => import('@/pages/room/list'), + meta: { title: '娌荤枟瀹ゅ垪琛�', keepAlive: true } }, { path: '/room/detail', name: 'roomDetail', - component: () => import('@/pages/room/detail') - // meta: { title: '娌荤枟瀹よ鎯�', keepAlive: false } + component: () => import('@/pages/room/detail'), + meta: { title: '娌荤枟瀹よ鎯�', isPush: false } } ] }) +// 璺敱璺宠浆涔嬪墠 +// 鏄惁宸茬粡璺宠浆杩囨埧闂磋鎯� +var isJumpeRoomDetail = localStorage.getItem('isJumpeRoomDetail') +if (!isJumpeRoomDetail) { + localStorage.setItem('isJumpeRoomDetail', '0') // 鏄惁宸茬粡璺宠浆杩囨埧闂磋鎯� +} + +// 璺宠浆鎴块棿璇︽儏 +function jumpRoomDetail() { + var roomId = localStorage.getItem('roomId') + var isJumpeRoomDetail = localStorage.getItem('isJumpeRoomDetail') + // 杩樻病璺宠浆涓旀湁localroomId鐨� + // console.log('7777777777777777777777777777', isJumpeRoomDetail, roomId) + if (isJumpeRoomDetail === '0' && roomId) { + localStorage.setItem('isJumpeRoomDetail', '1') + return { path: `./room/detail?id=${roomId}` } + } else { + localStorage.setItem('isJumpeRoomDetail', '1') + return true + } +} + +// 璺敱璺宠浆涔嬪墠 +router.beforeEach(function(to, from, next) { + // var isJumpeRoomDetail = localStorage.getItem('isJumpeRoomDetail') + // console.log('999999999999999999999999999999999', to, from, isJumpeRoomDetail) + var nextPage = true // 榛樿true + // 鐩存帴杩涘叆棣栭〉锛堝垪琛ㄩ〉锛� + if ((to.name === 'root' || to.name === 'roomList') && !from.name) { + nextPage = jumpRoomDetail() + } + // 鐩存帴杩涘叆璇︽儏椤� + if (to.name === 'roomDetail' && !from.name) { + localStorage.setItem('isJumpeRoomDetail', '1') + if (to.query.id) { + localStorage.setItem('roomId', to.query.id) + } + } + + // 鍒楄〃椤佃繘鍏ヨ鎯呴〉 + if (to.name === 'roomDetail' && (from.name === 'root' || from.name === 'roomList')) { + localStorage.setItem('isJumpeRoomDetail', '0') + if (to.query.id) { + localStorage.setItem('roomId', to.query.id) + } + } + + // 璇︽儏椤佃繑鍥炲垪琛� + if ((to.name === 'root' || to.name === 'roomList') && from.name === 'roomDetail') { + localStorage.setItem('isJumpeRoomDetail', '1') + } + next(nextPage) +}) + export default router -- Gitblit v1.8.0