<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>
|