zengh
2022-09-14 8ea19a6bb34daab1410f6186992a4c1e90299c92
pages/article/article.vue
@@ -6,14 +6,13 @@
            :style="titleNum==index? 'color:#000000':'color:#808080'">{{item}}</view>
      </view> -->
      <view>
         <u-dropdown style="height:0rpx">
         <u-dropdown style="height:0rpx" @open="open">
            <u-dropdown-item v-model="value1" title="看新闻" @change="change" :options="options1"></u-dropdown-item>
            <u-dropdown-item v-model="value1" title="看视频" @change="change" :options="options2"></u-dropdown-item>
            <u-dropdown-item v-model="value1" title="行业圈" @change="change" :options="options3"></u-dropdown-item>
            <u-dropdown-item v-model="value1" title="看现场" @change="change" :options="options4"></u-dropdown-item>
         </u-dropdown>
      </view>
      <view>
         <view class="search-block" style="height: 35px">
            <view class="search-ico-wapper">
@@ -26,13 +25,12 @@
            </view> -->
         </view>
      </view>
      <scroll-view id="articleBox" :style="{ height: swiperHeight + 'px' }" class="article-content" scroll-y
         style="width: 100%; margin-top: 100rpx;" :refresher-enabled="refresherFlag" :refresher-threshold="threshold"
         :refresher-triggered="triggered" @refresherrefresh="refreshing" @refresherrestore="refresherrestore">
         <view style="text-align: center;">
            <u-loading size="90" mode="flower" :show="loading"></u-loading>
         </view>
         <view v-for="i in data" class="advisory-model" @click="goDetail(i)">
            <view class="advisory-left">
               <view class="advisory-title-top">
@@ -51,9 +49,9 @@
      </scroll-view>
      <!-- <view class="article-content">
      </view> -->
      <u-toast ref="uToast" />
      <!-- 底部导航条 -->
      <u-tabbar :list="tabbar" :mid-button="false"></u-tabbar>
   </view>
@@ -69,8 +67,9 @@
         return {
            // pathUrl:"http://localhost:89/",
            pathUrl: this.$store.state.piAPI + "",
            loading:true,//加载动画
            page: 1,
            pagesize: 10,
            pagesize: 999999,
            status: 'loadmore',
            // loadStatus:'loading',  //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
            isLoadMore: false, //是否加载中
@@ -139,6 +138,9 @@
               {
                  label: '知识讨论',
                  value: 'hyq003',
               }, {
                  label: '个人',
                  value: 'hyq004',
               }
            ],
            options4: [{
@@ -173,8 +175,7 @@
               query
                  .select('#articleBox')
                  .boundingClientRect(data => {
                     that.swiperHeight = (safeArea.bottom - data.top - 50);
                     that.swiperHeight = (safeArea.bottom - data.top - 70);
                  })
                  .exec();
@@ -188,7 +189,7 @@
         this.page = ++this.page;
         setTimeout(() => {
            this.getArtcilePageList(this.tabInfo);
         }, 1000);
         }, 100);
      },
      methods: {
         goTabDetail(index) {
@@ -199,18 +200,17 @@
            let detail = {
               id: e.id
            };
            if(e.articleType.indexOf("ksp") != -1){
            if (e.articleType.indexOf("ksp") != -1) {
               //去跳转
               uni.navigateTo({
                  url: './article_video?detailData=' + (JSON.stringify(e))
               });
            }else{
            } else {
               //去跳转
               uni.navigateTo({
                  url: './article_detail?detailData=' + JSON.stringify(detail)
               });
            }
         },
         //on input 通过 keyword 关键字查询
         getKeyword() {
@@ -237,24 +237,24 @@
               }
            }
            uni.request({
               url: this.$store.state.piAPI + '/article/article/pageDate',
               url: that.$store.state.piAPI + '/article/article/pageDate',
               method: 'GET',
               data: paramData,
               success: (res) => {
                  if (res.data.code == 200) {
                     that.loading = false;
                     if (res.data.data.records) {
                        //如果总数小于pageSize,不做其他操作
                        if (res.data.data.total < this.pagesize) {
                        if (res.data.data.total < that.pagesize) {
                           that.data = res.data.data.records;
                           that.status = 'nomore';
                        } else {
                           if (res.data.data.records.length < this.pagesize) {
                           if (res.data.data.records.length < that.pagesize) {
                              //如果数量小于分页数量,则为最后一页
                              this.status = 'nomore'
                              that.status = 'nomore'
                           } else {
                              //否则继续加载更多数据
                              this.status = 'loading';
                              that.status = 'loading';
                           }
                           res.data.data.records.forEach((item) => {
                              that.data.push(item);
@@ -273,8 +273,15 @@
            this.page = 1;
            this.getArtcilePageList(e);
         },
         open(e) {
            if (e >= 2) {
               this.$refs.uToast.show({
                  title: '功能研发中',
                  type: 'warning',
               })
            }
         },
         refreshing() {
            if (this.isRefreshing) {
               return;
            }
@@ -283,10 +290,6 @@
            if (!this.triggered) {
               this.triggered = true;
            }
            this.dataListP = [];
            this.dataListQZ = [];
            this.dataListTXL = [];
            this.getArtcilePageList();
         },
@@ -299,11 +302,7 @@
</script>
<style>
   page {
      width: 100%;
      height: 100%;
      background-color: #f7f7f7;
   }
</style>
<style lang="scss" scoped>