Files
xdd-uniapp-new/pagesInn/components/jin-edit/homeList.vue
T

92 lines
1.8 KiB
Vue

<template>
<u-popup
:show="show"
@close="close"
@open="open"
mode="center"
closeable
round="10"
>
<view class="v12-pa-3 pop-content">
<view class="v12-dark-text v12-font-bold pop-title">请选择登录的店铺</view>
<view v-for="(item, index) in list" :key="index" class="home-wrap">
<view>
<u-avatar :src="item.logo"></u-avatar>
</view>
<view class="name-wrap one-t">{{ item.name }}</view>
<view class="enter-btn" @click="queryHome(index)">
点击进入
</view>
</view>
</view>
</u-popup>
</template>
<script>
export default {
data() {
return {
list: [],
show: false,
}
},
methods: {
queryHome(e) {
this.$nextTick(() => {
this.$emit('enter', this.list[e])
uni.setStorageSync('homeId', this.list[e].id)
this.show = false
})
},
open(records) {
if(!records) return;
this.show = true;
this.list = records && [...records] || []
},
close() {
this.show = false;
}
}
}
</script>
<style lang="less" scoped>
.home-wrap{
display: flex;
align-items: center;
justify-content: space-between;
background: #F6F6F6;
padding: 10rpx 20rpx;
border-radius: 20rpx;
margin-bottom: 10rpx;
}
.name-wrap{
width: 280rpx;
font-size: 30rpx;
font-weight: bold;
}
.enter-btn{
width: 118rpx;
height: 42rpx;
background: #BD3124;
border-radius: 22rpx;
padding: 2rpx 10rpx;
text-align: center;
line-height: 42rpx;
color: #fff;
font-size: 24rpx;
}
.pop-content{
width: 568rpx;
max-height: 860rpx;
background: rgba(255,255,255,0.39);
border-radius: 12rpx;
}
.pop-title{
position: relative;
width: fit-content;
margin-bottom: 20rpx;
}
</style>