long
2024-06-20 3fd2da453d30179571958c36153c6c0efe62ab9a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!--room-list.vue-->
<template>
  <div class="page flex flex-col">
    <div class="page_header flex flex-ver">
      <div class="left flex flex-ver" @click="resetPage">
        <!-- 全局标题图标配置!!! -->
        <div v-if="settingConfig.isLogo" class="page_logo_1">
          <!-- 全局标题图标配置!!! -->
          <img class="img" src="static/settingConfig/logo_1.png">
        </div>
        <!-- 全局标题图标配置!!! -->
        <div v-if="settingConfig.isLongLogo" class="page_logo_2">
          <!-- 全局标题图标配置!!! -->
          <img class="img" src="static/settingConfig/logo_2.png">
        </div>
      </div>
      <div class="flex-1 flex flex-center">
        <div class="select_shop_block flex flex-ver" @click="showChooseShop">
          <div v-if="!shopId" class="tx">请选择门店</div>
          <div v-if="shopId" class="tx">{{ shopName }}</div>
          <div class="icon_block">
            <img class="icon" src="static/imgs/down.png">
          </div>
        </div>
      </div>
      <div class="right 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>
        </div>
        <div class="page_time">{{ timeObj.timeMin }}</div>
        <!-- <div class="page_time">{{ timeObj.time }}</div> -->
      </div>
    </div>
    <div class="page_container flex-1 h1 flex flex-col">
      <div class="list_container h1 flex-1 flex flex-col">
        <div class="list_container__title">请选择房间</div>
        <div class="list_block flex-1 h1">
          <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" @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>
    </div>
 
    <XioRoomListShopChg ref="XioRoomListShopChg" @confirm="confirmShop" />
  </div>
</template>
 
<script>
// import Login from '../utils/jun_login.js'
import Req from '../../utils/jun_httpInstall' // http 请求
// import xioFn from './utils/xio_fn.js'
// 通知卸麻
import XioRoomListShopChg from '@/components/xio_room_list_shop_chg'
export default {
  name: 'RoomList',
  components: {
    XioRoomListShopChg
  },
  inject: ['noop'],
  data() {
    return {
      shopList: [],
      shopId: '',
      shopName: '',
      list: [],
      timeObj: {}// week:星期,date:年月日,timeMin:时分,time:时分秒,timeStamp:时间戳
    }
  },
  computed: {
 
  },
  activated() {},
  mounted() {
    console.log('roomList mounted')
    this.init()
  },
  destroyed() {
 
  },
  methods: {
    async init() {
      // 计时
      this.countGetTime(this, 'timeObj', 'list')
      // await this.getShopList()
      // this.getRoomList()
      this.showChooseShop()
    },
    // 确定选择门店
    confirmShop(item) {
      this.shopId = item.id
      this.shopName = item.name
      this.getRoomList()
    },
    // 显示选择门店列表弹窗
    showChooseShop() {
      // 打开弹窗
      this.$refs['XioRoomListShopChg'].showShopDialog(this.shopId)
    },
    // 刷新浏览器页面
    resetPage() {
      window.location.reload()
      // this.getRoomList()
    },
    // 获取门店列表
    getShopList() {
      var params = {}
      return new Promise((resolve, reject) => {
        Req.http.post({
          url: 'guide/treat/screen/shop/list',
          data: params,
          header: { 'Content-Type': 'application/json' },
          mockData: {
            code: 100,
            msg: '',
            data: [{
              name: 'xx',
              id: 'xx'
            }]
          }
        }).then((res) => {
          this.shopList = res.data || []
          resolve(res)
        })
      })
    },
    // 获取列表
    getRoomList() {
      var params = {}
      if (this.shopId) {
        params.shopId = this.shopId
      }
      Req.http.post({
        url: 'guide/treat/screen/room/list',
        data: params,
        header: { 'Content-Type': 'application/json' },
        mockData: {
          code: 100,
          msg: '',
          data: [{
            id: 'xx', roomNo: 'xx'
          }]
        }
      }).then((res) => {
        this.list = res.data || []
      })
    },
    // 返回
    back() {
      this.stopCountGetTime('list')
      this.stopPollingAjaxFn('list')
      this.$router.go(-1)
    },
    // 跳转详情
    selectRoom(item = {}) {
      // console.log(this.$router.options.routes)
      // this.$router.options.routes
      localStorage.removeItem('curTreatIds')
      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 || ''}`
      })
    }
  }
}
</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: right;
  padding-right: 40px;
}
.page_choose_shop .el-select .el-input .el-select__caret {
  font-size: 30px;
  color: #fff;
}
</style>
<style scoped>
.page_header .left {
  min-width: 300px;
}
.page_date {
  margin-left: 0;
}
/* .page_container {
  overflow: hidden;
} */
.list_container {
  width: 100%;
  background-color: #fff;
  border-radius: 10px;
  /* overflow: hidden; */
}
.list_container__title {
  line-height: 56px;
  color: rgba(16,16,16,1);
  font-size: 40px;
  text-align: center;
  font-family: PingFangSC-medium;
  padding: 27px 0;
  /* font-weight: bold; */
}
.list_block {
  overflow: auto;
}
.list_block .list {
  margin-bottom: 20px;
}
.list_block .list .list__item {
  cursor: pointer;
  padding: 40px 30px;
  border-radius: 100px;
  background-color: rgba(229,238,253,1);
  color: rgba(0,0,0,1);
  font-size: 40px;
  text-align: center;
  font-family: Roboto;
  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;
}
.select_shop_block {
  cursor: pointer;
}
.select_shop_block .tx {
  line-height: 50px;
  color: rgba(255,255,255,1);
  font-size: 36px;
  text-align: center;
  font-family: PingFangSC-regular;
}
.select_shop_block .icon_block {
  width: 30px;
  height: 30px;
  display: block;
}
.select_shop_block .icon_block .icon {
  width: 100%;
  height: 100%;
}
</style>