hailu
2024-12-02 0bbcee731e5259feadd261e8a84c3e27b8387e01
pages/index/index.vue
@@ -5,10 +5,12 @@
            <u-icon name="arrow-down" color="#fff"></u-icon>
            <text class="location">{{ address }}</text>
         </view>
         <u-input class="search" placeholder="搜索" type="text" v-model="search" /> <u-button type="primary" style="width: 100upx;margin-top: 20upx;" size="normal" text="搜索" @click="getArticleDataList()"></u-button>
         <u-input class="search" placeholder="请输入感兴趣的政策内容" type="text" v-model="search" /> <u-button type="primary" shape="circle"
            style="width: 100upx;margin-top: 20upx;" size="normal" text="搜索"
            @click="getArticleDataList()"></u-button>
      </header>
      <view class="cate-section">
         <view class="cate-item" >
         <view class="cate-item" @click="gooriginalText()">
            <image src="/static/temp/c3.png"></image>
            <text>政策原文</text>
         </view>
@@ -37,23 +39,31 @@
               transform: 'scale(1)'
            }" itemStyle="padding-left: 15px; padding-right: 15px; height: 34px;">
         </u-tabs>
         <view style="line-height: 70upx;color: #969799;font-size: 32upx;font-weight: 600;" @click="gooriginalText">更多</view>
         <view style="line-height: 70upx;color: #969799;font-size: 32upx;font-weight: 600;" @click="gooriginalText">
            更多</view>
      </view>
      <view
      <view v-if="!loading &&  goodsList.length > 0"
         style="padding: 40upx;background-color: #fff;margin-top: 20upx;display: flex;justify-content: space-between;color: #969799;font-size: 28upx;">
         <view>
            <view class="goods-item" v-for="(item, index) in goodsList" :key="index" style="height: 60upx;line-height: 60upx;" @click="godetail(item)">
            <view class="goods-item" v-for="(item, index) in goodsList" :key="index"
               style="height: 80upx;line-height: 80upx;" @click="godetail(item)">
               <view>{{ item.ArticleTitle.length > 15 ? item.ArticleTitle.slice(0, 15) + '...' : item.ArticleTitle
                  }}</view>
            </view>
         </view>
         <view>
            <view class="goods-item" v-for="(item, index) in goodsList" :key="index" style="height: 60upx;line-height: 60upx;" @click="godetail(item)">
            <view class="goods-item" v-for="(item, index) in goodsList" :key="index"
               style="height: 80upx;line-height: 80upx;" @click="godetail(item)">
               <view>{{ item.PubTime ? item.PubTime.split(' ')[0] : item.PubTime }}</view>
            </view>
         </view>
      </view>
      <u-popup :show="showLocation" :round="10" mode="bottom" @close="close" @open="open" :closeable="true">
      <view v-if="loading" style="margin-top: 100upx;">
         <u-loading-icon></u-loading-icon>
      </view>
      <u-empty v-if="!loading && goodsList.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/car.png">
      </u-empty>
      <u-popup :show="showLocation" :round="10" mode="bottom" @close="closeLocation" :closeable="true">
         <view style="padding: 40upx;display: flex;flex-wrap: wrap;">
            <view class="u-page__tag-item" v-for="(item, index) in locationList" :key="index">
               <u-tag :text="item" :plain="item != address" type="warning" :name="index"
@@ -96,10 +106,12 @@
            },
         ],
         ArticleType: '',
         loading: false,
      };
   },
   onLoad() {
      if(uni.getStorageSync('location')){
      if (uni.getStorageSync('location')) {
         this.address = uni.getStorageSync('location')
      }
      this.getArticleDataList()
@@ -122,45 +134,54 @@
      },
      // 
      getArticleDataList() {
         this.loading = true
         let data = {
            Platform: this.address,
            ArticleType: this.ArticleType,
            Scope: '',
            Keyword: this.search,
            PageNumber: 1,
            PageSize: 5,
            PageSize: 10,
            UserId: uni.getStorageSync('userId')
         }
         this.$http.post('/ArticleData/GetArticleDataList', data).then(res => {
            if (res.Check) {
               this.goodsList = res.Data.Data
               this.loading = false
            } else {
               this.$msg(res.Msg)
               this.goodsList = []
               this.loading = false
            }
         })
      },
      gooriginalText(){
      gooriginalText() {
         uni.navigateTo({
            url: '/pages/public/originalText'
            url: '/pages/checkPolicies/originalText'
         })
      },
      godetail(item){
      godetail(item) {
         // 手机浏览器跳转
         window.open(item.ArticleUrl, "_blank");
      },
      goproject(){
      goproject() {
         uni.navigateTo({
            url: '/pages/checkPolicies/project'
         })
      },
      gofastMatch(){
      gofastMatch() {
         uni.navigateTo({
            url: '/pages/policyMatching/fastMatch'
         })
      },
      goprecise(){
      goprecise() {
         uni.navigateTo({
            url: '/pages/policyMatching/precise'
         })
      },
      closeLocation() {
         this.showLocation = false;
      }
   }
}
</script>
@@ -191,40 +212,40 @@
}
header {
    padding: 0 30upx;
    height: 120upx;
    background-color: #236AF0;
    display: flex;
    color: #fff;
    font-size: 14px;
   padding: 0 30upx;
   height: 120upx;
   background-color: #236AF0;
   display: flex;
   color: #fff;
   font-size: 14px;
    .left {
        width: 150upx;
        height: 120upx;
        line-height: 120upx;
        text-align: left;
        display: flex;
   .left {
      width: 150upx;
      height: 120upx;
      line-height: 120upx;
      text-align: left;
      display: flex;
        i {
            font-size: 36upx;
        }
    }
      i {
         font-size: 36upx;
      }
   }
    .search {
        flex: 1;
        height: 80upx;
        line-height: 80upx;
        border-radius: 40upx;
        background-color: #fff;
        padding: 0 20upx;
        margin: 20upx 0;
        color: #236AF0;
   .search {
      flex: 1;
      height: 80upx;
      line-height: 80upx;
      border-radius: 40upx;
      background-color: #fff;
      padding: 0 20upx;
      margin: 20upx 0;
      color: #236AF0;
        i {
            font-size: 26upx;
            color: #ccc;
        }
    }
      i {
         font-size: 26upx;
         color: #ccc;
      }
   }
}