jazz
2024-01-09 c1e10385c164520dceec34576ed506b28bad1e71
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
<template>
  <div v-if="isShow" class="mask" @click="hideDialog">
    <div class="xio_room_list_shop_chg_dialog" @click.stop="noop">
      <div class="title">请选择门店</div>
      <div class="list flex flex-ver flex-wrap">
        <div v-for="(item,index) in shopList" :key="index" class="list_item flex flex-center" :class="[item.act?'act':'']" @click="chooseHandle(item)">{{ item.name }}</div>
      </div>
    </div>
  </div>
</template>
 
<script>
import Req from '../../utils/jun_httpInstall' // http 请求
export default {
  name: 'XioRoomListShopChg',
  props: {
    isActive: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      shopList: [],
      shopId: '',
      isShow: false
    }
  },
  methods: {
    noop() {
      return
    },
    // 确认
    // confirm() {
    //   this.isShow = false
    //   this.$emit('confirm', { })
    // },
    // 选择门店
    chooseHandle(item) {
      this.shopId = item.id
      if (this.shopList && this.shopList.length) {
        this.shopList.forEach((o) => {
          o.act = false
          if (o.id === this.shopId) {
            o.act = true
          }
        })
      }
      this.isShow = false
      this.$emit('confirm', item)
    },
    async showShopDialog(shopId) {
      this.shopId = shopId || ''
      this.showDialog()
      await this.getShopList()
    },
    // 获取门店列表
    getShopList() {
      var params = {}
      return new Promise((resolve, reject) => {
        Req.http.post({
          url: 'guide/treat/screen/shop/list',
          data: params,
          udData: { noLoading: true },
          header: { 'Content-Type': 'application/json' },
          mockData: {
            code: 100,
            msg: '',
            data: [{
              name: 'xx',
              id: 'xx'
            }]
          }
        }).then((res) => {
          if (res.data && res.data.length) {
            res.data.forEach((o) => {
              o.act = false
              if (o.id === this.shopId) {
                o.act = true
              }
            })
          }
          this.shopList = res.data || []
          resolve(res)
        })
      })
    },
    // 显示弹窗
    showDialog() {
      this.isShow = true
    },
    // 关闭弹窗
    hideDialog() {
      if (!this.shopId) {
        return
      }
      this.isShow = false
      // this.$emit('confirm', { })
    }
  }
}
</script>
 
<style scoped>
.xio_room_list_shop_chg_dialog {
  width: 1141px;
  height: 689px;
  /* border-radius: 10px; */
  background-color: rgba(255,255,255,1);
  border: 1px solid rgba(187,187,187,1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  z-index: 1;
}
.xio_room_list_shop_chg_dialog .title {
  line-height: 63px;
  color: rgba(16,16,16,1);
  font-size: 45px;
  text-align: center;
  font-family: PingFangSC-medium;
  font-weight: bold;
  padding-top: 31px;
}
.xio_room_list_shop_chg_dialog .list {
  margin-top: 50px;
  height: 480px;
  overflow: auto;
}
.xio_room_list_shop_chg_dialog .list_item {
  cursor: pointer;
  min-width: 300px;
  height: 100px;
  box-sizing: border-box;
  padding: 0 20px;
  margin-left: 55px;
  margin-bottom: 50px;
  line-height: 73px;
  border-radius: 4px;
  background-color: rgba(229,238,253,1);
  color: rgba(0,10,123,1);
  font-size: 50px;
  text-align: center;
  font-family: Microsoft Yahei;
}
.xio_room_list_shop_chg_dialog .list_item.act {
  background-color: #5980FF;
  color: #fff;
}
</style>