<template>
|
<view class="branch-container" :data-theme='theme()' :class="theme() || ''">
|
<!--内容-->
|
<view class="branch-box">
|
<scroll-view scroll-y="true" class="scroll-Y" :style="'height:' + scrollviewHigh + 'px;'" lower-threshold="50" @scrolltolower="scrolltolowerFunc">
|
<view :class="topRefresh ? 'top-refresh open' : 'top-refresh'">
|
<view class="circle" v-for="(circle, n) in 3" :key="n"></view>
|
</view>
|
<view class="branch-list">
|
<view class="card-list d-s-c" v-for="(item, index) in listData" :key="index">
|
<view class="card-left">
|
<image :src="item.image?item.logo.file_path:remoteImg('branch_logo')"></image>
|
</view>
|
<view class="card-right flex-1 pr">
|
<view class="title text-ellipsis-2">{{item.name}}</view>
|
<view class="bottom d-b-e">
|
<view class="d-b-c">
|
<view class="item-btn" @click="gotoPage('pages/branch/member/index/index?branch_id='+item.branch_id)">{{words.member_list.value}}</view>
|
<view class="item-btn" @click="gotoPage('pages/branch/activity/index/index?branch_id='+item.branch_id)">{{words.activity_list.value}}</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
<!--列表-->
|
<!-- 没有记录 -->
|
<view class="none-data-box" v-if="listData.length==0 && !loading">
|
<image :src="remoteImg('no_thing')" mode="widthFix"></image>
|
<text>暂无数据</text>
|
</view>
|
<uni-load-more v-else :loadingType="loadingType"></uni-load-more>
|
</scroll-view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import uniLoadMore from '@/components/uni-load-more.vue';
|
export default {
|
components: {
|
uniLoadMore
|
},
|
data() {
|
return {
|
/*手机高度*/
|
phoneHeight: 0,
|
/*可滚动视图区域高度*/
|
scrollviewHigh: 0,
|
/*商品列表*/
|
listData: [],
|
status: 0,
|
/*最后一页码数*/
|
last_page: 0,
|
/*当前页面*/
|
page: 1,
|
/*每页条数*/
|
list_rows: 10,
|
/*有没有更多*/
|
no_more: false,
|
/*是否正在加载*/
|
loading: true,
|
/*顶部刷新*/
|
topRefresh: false,
|
words: {},
|
};
|
},
|
computed: {
|
/*加载中状态*/
|
loadingType() {
|
if (this.loading) {
|
return 1;
|
} else {
|
if (this.listData.length != 0 && this.no_more) {
|
return 2;
|
} else {
|
return 0;
|
}
|
}
|
}
|
},
|
onLoad(e) {},
|
mounted() {
|
this.init();
|
this.getData();
|
},
|
onReachBottom() {},
|
methods: {
|
/*初始化*/
|
init() {
|
let _this = this;
|
uni.getSystemInfo({
|
success(res) {
|
_this.scrollviewHigh = res.windowHeight;
|
}
|
});
|
},
|
|
/*获取活动列表*/
|
getData() {
|
let self = this;
|
self.loading = true;
|
self._get(
|
'branch.branch/index', {
|
page: self.page || 1,
|
list_rows: self.list_rows,
|
}, function(res) {
|
self.words = res.data.words;
|
self.listData = self.listData.concat(res.data.list.data);
|
self.last_page = res.data.list.last_page;
|
if (res.data.list.last_page <= 1) {
|
self.no_more = true;
|
} else {
|
self.no_more = false;
|
}
|
/*设置标题*/
|
uni.setNavigationBarTitle({
|
title: self.words.branch_list.value
|
});
|
// uni.hideLoading();
|
self.loading = false;
|
}
|
);
|
},
|
|
/*可滚动视图区域到底触发*/
|
scrolltolowerFunc() {
|
let self = this;
|
if (self.no_more) {
|
return;
|
}
|
self.page++;
|
if (self.page <= self.last_page) {
|
self.getData();
|
} else {
|
self.no_more = true;
|
}
|
},
|
|
/*跳转详情*/
|
gotoDetail(e) {
|
let url = 'pages/branch/branch/detail/detail?branch_id=' + e.branch_id
|
this.gotoPage(url);
|
},
|
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
page {
|
background: #f5f5f5;
|
}
|
.branch-list {
|
padding: 0 30rpx;
|
.card-list {
|
width: 100%;
|
background-color: #ffffff;
|
margin-top: 20rpx;
|
padding: 30rpx;
|
border-radius: 24rpx;
|
box-sizing: border-box;
|
.card-left {
|
image {
|
width: 120rpx;
|
height: 120rpx;
|
border-radius: 50%;
|
}
|
}
|
.card-right {
|
padding-left: 30rpx;
|
.title{
|
font-size: 30rpx;
|
color: #333333;
|
font-weight: 700;
|
}
|
.bottom{
|
margin-top: 30rpx;
|
align-items: flex-end;
|
justify-content: space-between;
|
|
.item-btn {
|
font-size: 26rpx;
|
padding: 10rpx 20rpx;
|
border-radius: 60rpx;
|
border-width: 1rpx;
|
border-style: solid;
|
@include border_color('border_color');
|
+ .item-btn {
|
margin-left: 30rpx;
|
}
|
}
|
}
|
|
}
|
}
|
}
|
|
|
</style>
|