123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <view class="page MingXingYeZhu">
- <ScrollY :IsRefreshing="IsRefreshing" @Refresh="Refresh" @ScrollBottom="ScrollBottom">
- <view class="Container">
-
- <!-- 标题 -->
- <view class="Title">
- <image mode="heightFix" src="https://cjgw.oss-cn-hangzhou.aliyuncs.com/ygcxxfb/image/mingxingyezhu.png"></image>
- </view>
-
- <!-- 列表 -->
- <view class="List" v-if="PageList.length">
- <navigator v-for="(item, index) in PageList" :key="index" :url="`../../HuiShengHuo/ActivityList/ActivityDetail/index?id=${item.activityId}`" hover-class="other-navigator-hover" class="Item">
- <view class="Img">
- <image mode="aspectFill" class="centerLabel" :src="item.thumb"></image>
- </view>
- <text class="Info">{{item.name}}</text>
- </navigator>
- </view>
-
- </view>
- </ScrollY>
- </view>
- </template>
-
- <script>
- import ScrollY from '../../../components/ScrollY/index'
- import { createNamespacedHelpers } from 'vuex'
- const { mapState: mapIndexState, mapActions: mapIndexActions, mapMutations: mapIndexMutations } = createNamespacedHelpers('index')
- const { mapActions: mapUserActions, mapMutations: mapUserMutations } = createNamespacedHelpers('user')
- export default {
- name: 'MingXingYeZhu',
- data () {
- return {
- PageList: [],
- PageData: {
- pageNum: 1,
- pageSize: 15
- },
- HasNextPage: true,
- IsRefreshing: false,
- DataLock: false
- }
- },
- computed: {
- ...mapIndexState({
- MingXingYeZhuList: x => x.MingXingYeZhuList // 明星业主列表
- })
- },
- components: {
- ScrollY
- },
- created () {
- this.$authed(() => {
- this.Init()
- })
- },
- methods: {
- ...mapUserActions([
- 'MainSignIn' // 获取用户信息
- ]),
- ...mapUserMutations([
- 'EditUserInfo' // 编辑用户信息
- ]),
- ...mapIndexActions([
- 'GetMingXingYeZhuList' // 获取明星业主列表
- ]),
- ...mapIndexMutations([
- 'EmptyMingXingYeZhuList' // 清空明星业主列表
- ]),
- Init () { // 初始化
- this.PageData.pageNum = 1
- this.HasNextPage = true
- this.EmptyMingXingYeZhuList() // 清空明星业主列表
- this.PageList = []
- this.ToGetPageList() // 获取列表
- },
- ToGetPageList () { // 获取列表
- this.GetMingXingYeZhuList({ queryData: { ...this.PageData, typeId: 1 } }).then((res) => { // 获取明星业主列表
- this.PageList = [...this.MingXingYeZhuList]
- this.HasNextPage = res.data.data.current < res.data.data.pages
- this.DataLock = false
- this.IsRefreshing = false
- }).catch(() => {
- this.DataLock = false
- this.IsRefreshing = false
- })
- },
- ScrollBottom () { // 上拉加载
- if (this.DataLock || !this.HasNextPage) return
- this.DataLock = true
- this.PageData.pageNum += 1
- this.ToGetPageList() // 获取列表
- },
- Refresh (e) { // 页面下拉刷新
- if (this.DataLock) return
- this.DataLock = true
- this.IsRefreshing = true
- setTimeout(() => {
- this.Init() // 获取列表
- }, 1000)
- }
- }
- }
- </script>
-
- <style lang="scss">
- @import "page.scss";
- </style>
|