quanwei
2026-01-17 e1e2fe5710a5b5cd9c19bd3aa99c998a1a613ca8
mobile/pages/branch/activity/index/index.vue
@@ -1,7 +1,7 @@
<template>
   <view class="activity-container" :data-theme='theme()' :class="theme() || ''">
      <!--内容-->
      <view class="activity-box" v-if="!loading">
      <view class="activity-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>
@@ -77,6 +77,9 @@
            loading: true,
            /*顶部刷新*/
            topRefresh: false,
            branch_id: 0, // 分会ID
            is_first_show: true, // 处理授权返回加载数据空白的问题
            words: {},
         };
      },
      computed: {
@@ -93,14 +96,19 @@
            }
         }
      },
      onLoad(e) {},
      onLoad(e) {
         if (e.branch_id != undefined) {
            this.branch_id = e.branch_id;
         }
      },
      onShow() {
         /*获取列表*/
         this.getlist();
         if (this.is_first_show) {
            this.getData();
         }
      },
      mounted() {
         this.init();
      },
      onReachBottom() {},
      methods: {
@@ -115,27 +123,35 @@
         },
         /*获取活动列表*/
         getlist() {
         getData() {
            let self = this;
            uni.showLoading({
               title: '加载中'
            });
            // uni.showLoading({
            //    title: '加载中'
            // });
            let status = self.status;
            self.loading = true;
            self._get(
               'branch.activity/index', {
                  status: status
                  branch_id: self.branch_id,
                  status: status,
                  page: self.page || 1,
                  list_rows: self.list_rows,
               },
               function(res) {
                  self.listData = res.data.list.data;
                  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.hideLoading();
                  /*设置标题*/
                  uni.setNavigationBarTitle({
                      title: self.words.activity_list.value
                  });
                  self.loading = false;
                  self.is_first_show = false;
               }
            );
         },
@@ -160,6 +176,18 @@
            this.gotoPage(url);
         },
      },
      onShareAppMessage() {
         return {
            title: `活动列表`,
            path: `pages/branch/activity/index/index`
         };
      },
      onShareTimeline() {
         return {
            title: '活动列表',
            path: `pages/branch/activity/index/index`
         };
      }
   };
</script>