文件
xionggeshop/xgsc.gynhc.com_wx/pages/app/store/index.vue
2026-09-14 17:24:53 +08:00

242 行
4.8 KiB
Vue

<template>
<view class="box">
<template v-if="pageLoading">
<page-loading></page-loading>
</template>
<template v-else>
<view class="content">
<view v-if="list.length" class="ol">
<view v-for="(item, index) of list" :key="index" @click="$Router.push('/pages/app/store/detail?id=' + item.id)" class="list">
<view class="img">
<image :src="item.image_first" mode="aspectFill"></image>
</view>
<view class="info">
<view class="title">
<view class="h1">{{item.name}}</view>
<image :src="$IMG_URL + '/assets/img/vipsss.png'" mode=""></image>
</view>
<view class="one">
<view class="star">
<image :src="$IMG_URL + '/assets/img/5555hg.png'" mode="widthFix"></image>
<text>5.0</text>
</view>
<view class="sales">
月售1710+
</view>
</view>
<view class="two">
<view class="name">
<image :src="$IMG_URL + '/assets/img/store-user.png'" mode=""></image>
<text>{{item.realname}}</text>
</view>
<view class="phone">
<image :src="$IMG_URL + '/assets/img/store-phone.png'" mode=""></image>
<text>{{item.phone}}</text>
</view>
</view>
<view class="three">
<image :src="$IMG_URL + '/assets/img/store-addr.png'" mode=""></image>
<view class="addr">{{item.city_name}}{{item.area_name}}{{item.address}}</view>
</view>
</view>
</view>
<u-loadmore :line="true" :status="loadmoreStatus" />
</view>
<view class="empty" v-else>
<!-- 缺省页 -->
<shopro-empty @click="$Router.pushTab('/pages/index/index')" :image="$IMG_URL + '/imgs/empty/template_empty.png'" tipText="暂无门店"
btnText="去首页逛逛"></shopro-empty>
</view>
</view>
</template>
</view>
</template>
<script>
import pageLoading from '@/components/page-loading/page-loading.vue';
export default {
components: {
pageLoading
},
data() {
return {
loadmoreStatus: 'loading',
pageLoading: true,
page: 1,
list: [],
totalSize: 1,
total: 0,
rows: 10
};
},
computed: {},
onLoad() {
this.getStoreList();
},
// 触底事件
onReachBottom() {
if (this.page < this.totalSize) {
this.page += 1;
this.getStoreList();
} else {
this.loadmoreStatus = 'nomore';
}
},
methods: {
getStoreList() {
this.$http('store.index', {
page: this.page
}).then(res => {
// 合并数据
this.list = [...this.list, ...res.data.list];
// 总页数
this.totalSize = res.data.totalSize;
// 总数据
this.total = res.data.total;
this.pageLoading = false;
if (this.page == this.totalSize) {
this.loadmoreStatus = 'nomore';
}
});
}
}
};
</script>
<style lang="scss">
page {
background: $brand-page-bg;
}
.content {
margin: 20rpx;
padding-bottom: 40rpx;
.list {
border-radius: 30rpx;
padding: 20rpx;
background-color: #fff;
display: flex;
margin-bottom: 20rpx;
.info {
flex: 1;
.three {
margin-top: 10rpx;
display: flex;
image {
width: 34rpx;
height: 30rpx;
margin-right: 8rpx;
}
.addr {
font-size: 24rpx;
color: #999;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
}
.two {
display: flex;
justify-content: space-between;
align-items: center;
color: #9a9a9a;
font-size: 24rpx;
.name {
display: flex;
align-items: center;
image {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
.phone {
display: flex;
align-items: center;
image {
width: 32rpx;
height: 32rpx;
margin-right: 8rpx;
}
}
}
.one {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12rpx;
.star {
display: flex;
align-items: center;
image {
width: 158rpx;
}
text {
font-size: 22rpx;
color: orange;
font-weight: bold;
margin-left: 6rpx;
}
}
.sales {
font-size: 24rpx;
color: #c3c2c2;
}
}
.title {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8rpx;
.h1 {
font-size: 28rpx;
font-weight: bold;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
margin-bottom: 10rpx;
width: 80%;
}
image {
width: 36rpx;
height: 32rpx;
}
}
}
.img {
margin-right: 20rpx;
image {
width: 210rpx;
height: 210rpx;
border-radius: 10rpx;
}
}
}
}
</style>