From 6da3c1365a9f54c043a4ec2547163b1226e11412 Mon Sep 17 00:00:00 2001 From: jazz <jazzxhunter@163.com> Date: 星期三, 06 十二月 2023 20:01:51 +0800 Subject: [PATCH] update_202312052001_项目-治疗室屏幕web-切图接口对接v2 --- src/pages/room/list.vue | 89 +++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 83 insertions(+), 6 deletions(-) diff --git a/src/pages/room/list.vue b/src/pages/room/list.vue index 54e4c6b..f88839d 100644 --- a/src/pages/room/list.vue +++ b/src/pages/room/list.vue @@ -2,11 +2,16 @@ <template> <div class="page"> <div class="page_header flex flex-ver"> - <div class="left flex flex-ver"> + <div class="left flex flex-ver" @click="back"> <img class="page_logo_1" src="../../assets/img/logo_1.png"> <img class="page_logo_2" src="../../assets/img/logo_2.png"> </div> <div class="right flex-1 flex flex-jcfe flex-ver"> + <div class="page_choose_shop"> + <el-select v-model="shopId" placeholder="璇烽�夋嫨" style="width:400px;" clearable @change="getRoomList"> + <el-option v-for="item in shopList" :key="item.id" :label="item.name" :value="item.id" /> + </el-select> + </div> <div class="page_date"> <div class="page_week">{{ timeObj.week }}</div> <div class="page_day">{{ timeObj.date }}</div> @@ -19,9 +24,13 @@ <div class="list_container flex flex-col"> <div class="list_container__title">璇烽�夋嫨鎴块棿</div> <div class="list_block flex-1"> - <div class="list flex flex-ver flex-wrap"> + <div v-if="list && list.length" class="list flex flex-ver flex-wrap"> <!-- act --> - <div v-for="(item, index) in list" :key="index" class="list__item flex flex-center">VIP璇婄枟瀹�-1</div> + <div v-for="(item, index) in list" :key="index" class="list__item flex flex-center" @click="selectRoom(item)">{{ item.roomNo }}</div> + </div> + <div v-if="!list || !list.length" class="list flex flex-center"> + <!-- act --> + <div class="notip flex flex-center">鏆傛棤鏁版嵁</div> </div> </div> </div> @@ -31,14 +40,16 @@ <script> // import Login from '../utils/jun_login.js' - +import Req from '../../utils/jun_httpInstall' // http 璇锋眰 export default { name: 'RoomList', components: {}, inject: ['noop'], data() { return { - list: ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''], + shopList: [], + shopId: '', + list: [], timeObj: {}// week锛氭槦鏈燂紝date锛氬勾鏈堟棩锛宼imeMin锛氭椂鍒嗭紝time锛氭椂鍒嗙锛宼imeStamp锛氭椂闂存埑 } }, @@ -55,11 +66,68 @@ methods: { init() { this.countGetTime(this, 'timeObj', 'list') + this.getShopList() + this.getRoomList() + }, + // 鑾峰彇闂ㄥ簵鍒楄〃 + getShopList() { + var params = {} + Req.http.post({ + url: 'treat/screen/shop/list', + data: params, + header: { 'Content-Type': 'application/json' }, + mockData: { + code: 100, + msg: '', + data: {} + } + }).then((res) => { + this.shopList = res.data || [] + }) + }, + // 鑾峰彇鍒楄〃 + getRoomList() { + var params = {} + if (this.shopId) { + params.shopId = this.shopId + } + Req.http.post({ + url: 'treat/screen/room/list', + data: params, + header: { 'Content-Type': 'application/json' }, + mockData: { + code: 100, + msg: '', + data: {} + } + }).then((res) => { + this.list = res.data || [] + }) + }, + // 杩斿洖 + back() { + this.stopCountGetTime('list') + this.stopPollingAjaxFn('list') + this.$router.go(-1) + }, + selectRoom(item = {}) { + this.$router.push({ + path: `./room/detail?id=${item.id || ''}` + }) } } } </script> - +<style> +.page_choose_shop .el-input__inner { + background-color: transparent; + border: 0; + line-height: 50px; + color: rgba(255,255,255,1); + font-size: 36px; + text-align: center; +} +</style> <style scoped> .list_container { width: 100%; @@ -95,9 +163,18 @@ line-height: 1; margin-left: 48px; margin-bottom: 30px; + box-sizing: border-box; + min-width: 280px; + cursor: pointer; } .list_block .list .list__item.act { background-color: #5980FF; color: #fff; } +.list_block .list .notip { + color: rgba(0,0,0,.3); + font-size: 40px; + text-align: center; + font-family: Roboto; +} </style> -- Gitblit v1.8.0