H5端齐采药项目,uniapp框架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

233 lines
4.4 KiB

<template>
<u-overlay :show="cutShow">
<div class="view">
<div class="box">
<ns-empty
text="暂无通过的店铺~"
:isIndex="false"
v-if="!storeList.length && !loading"
></ns-empty>
<div
:class="active == item.id ? 'row_active' : 'row'"
v-for="(item, index) in storeList"
:key="index"
@click="changeActive(item)"
>
<!-- <image class="avatar" :src="$util.img('/upload/weapp/user/wx.png')"></image> -->
<div class="name">{{ item.title }}</div>
<div class="label" v-if="item.label">{{ item.label }}</div>
<image
class="gou"
:src="$util.img('/upload/weapp/user/gou2.png')"
mode=""
></image>
</div>
<div class="btn_box">
<div class="cancel" @click="cutShow = false">取消</div>
<div class="look_all" @click="look_all">查看全部</div>
</div>
</div>
</div>
</u-overlay>
</template>
<script>
export default {
data() {
return {
cutShow: false,
data: [],
active: '',
storeList: [],
loading: false
};
},
methods: {
start() {
this.cutShow = true;
this.getStoreList();
},
//已经通过审核的店铺
getStoreList() {
this.loading = true;
this.$api.sendRequest({
url: '/api/member/getStoreList',
data: {
status: 1
},
success: ({ data }) => {
this.storeList = data;
if (data.length) {
let myStore = uni.getStorageSync('myStore');
if (myStore) {
this.active = myStore.id;
} else {
this.active = data[0].id;
uni.setStorageSync('myStore', data[0]);
console.log(this.active, 111111);
}
}
else {
let storeObj = {
id: 0,
}
uni.setStorageSync('myStore', storeObj);
}
},
complete: res => {
this.loading = false;
}
});
},
//切换店铺
changeActive(item) {
uni.setStorageSync('myStore', item);
this.active = item.id;
this.cutShow = false;
// this.$parent.$parent.init();
uni.$emit('changeStore', true);
},
close() {
this.$emit('close');
},
look_all() {
this.cutShow = false;
uni.navigateTo({
url: '/pages_tool/member/store/all_store'
});
}
}
};
</script>
<style lang="scss" scoped>
.view {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
line-height: 1;
.box {
width: 540rpx;
background-color: #fff;
border-radius: 24rpx;
padding: 24rpx;
max-height: 700rpx;
overflow: auto;
.row_active {
margin-top: 24rpx;
height: 92rpx;
background: rgba(33, 187, 243, 0.08);
border-radius: 16rpx;
border: 2rpx solid $base-color;
display: flex;
align-items: center;
position: relative;
.avatar {
width: 48rpx;
height: 48rpx;
margin-left: 24rpx;
}
.name {
margin-left: 16rpx;
}
.label {
margin-left: 20rpx;
border-radius: 8rpx;
border: 1rpx solid rgba(33, 187, 243, 0.2);
height: 32rpx;
font-size: 22rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: $base-color;
line-height: 32rpx;
}
.gou {
width: 32rpx;
height: 32rpx;
position: absolute;
right: 0rpx;
bottom: -3rpx;
}
}
.row {
margin-top: 24rpx;
border: 2rpx solid #fff;
height: 92rpx;
background: #f7f7f7;
border-radius: 16rpx;
display: flex;
align-items: center;
.avatar {
width: 48rpx;
height: 48rpx;
margin-left: 24rpx;
}
.name {
margin-left: 16rpx;
}
.label {
margin-left: 20rpx;
border-radius: 8rpx;
border: 1rpx solid rgba(33, 187, 243, 0.2);
height: 32rpx;
font-size: 22rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: $base-color;
line-height: 32rpx;
}
.gou {
width: 32rpx;
height: 32rpx;
display: none;
}
}
.btn_box {
margin-top: 56rpx;
display: flex;
justify-content: space-evenly;
.cancel {
width: 206rpx;
height: 72rpx;
border-radius: 40rpx;
border: 2rpx solid #e8e8e8;
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #222222;
}
.look_all {
width: 206rpx;
height: 72rpx;
background: $base-color;
border-radius: 40rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #ffffff;
}
}
}
}
</style>