bd 2 роки тому
батько
коміт
82b495dda1

+ 76 - 6
activityPages/specialDetail/specialDetail.vue

@@ -1,6 +1,12 @@
 <template>
-  <view class="container activity-detail">
+  <view class="container special-detail">
     <view class="" v-if="haveAuth == 1">
+      <view class="top-notice-special">
+        <view class="notice">
+          <van-notice-bar color="#FFFFFF" background="#FE9000" text="专项调研行程持续更新中,满五家即开团,欢迎点击感兴趣预报名" />
+        </view>
+        <view class="inform-btn" @click="specialFollow">{{ isFollow ? "取消通知" : "新调研通知" }}</view>
+      </view>
       <view class="content">
         <view class="dialog-title" :class="1 == 1 ? 'brackets-title' : ''">{{ detailData.ResearchTheme }}</view>
         <view class="network">
@@ -47,7 +53,6 @@
       <view class="interest-btn">
         <text class="button" v-if="detailData.IsSignup !== 1" @click="interest">感兴趣</text>
         <text class="button" @click="beNotInterested" v-else>已预报名</text>
-        若对该活动感兴趣,欢迎点击感兴趣进行预报名
       </view>
     </view>
     <!-- 权限部分 -->
@@ -55,6 +60,20 @@
       <jurisdiction :idAct="id" :haveAuth="haveAuth" :industryMsg="industryMsg" :msgType="msgType" :sellerMobile="sellerMobile" :sellerName="sellerName"></jurisdiction>
     </view>
     <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
+    <u-modal
+      v-model="goFollowShow"
+      :content-style="{ fontSize: '32rpx' }"
+      :show-cancel-button="false"
+      confirm-text="知道了"
+      @cancel="isCancelBtn = false"
+      :show-title="false"
+      :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
+      :confirm-style="{ fontWeight: '700' }"
+    >
+      <view class="slot-content">
+        <rich-text :nodes="accounts"></rich-text>
+      </view>
+    </u-modal>
   </view>
 </template>
 
@@ -73,6 +92,9 @@ export default {
       sellerMobile: "",
       sellerName: "", //销售名称
       msgType: "",
+      isFollow: false,
+      accounts: `您已开启【专项调研】新活动通知<br/><br/>请关注【查研观向小助手】公众号,及时获取微信消息提醒`,
+      goFollowShow: false,
     };
   },
   components: {
@@ -94,6 +116,7 @@ export default {
     async getActivityDetail() {
       const res = await activity.getSpecialDetailList({ ActivityId: this.id });
       if (res.Ret == 200) {
+        this.isFollow = res.Data.IsFollow;
         this.haveAuth = res.Data.HasPermission;
         this.industryMsg = res.Data.PopupMsg;
         this.sellerMobile = res.Data.SellerMobile;
@@ -154,10 +177,33 @@ export default {
         urls: [this.detailData.TripImgLink], //查看图片的数组
       });
     },
+    //新调研通知
+    async specialFollow() {
+      if (this.isFollow) {
+        uni.showModal({
+          content: "您要取消【专项调研】新活动通知吗?",
+          confirmColor: "#3385FF",
+          cancelColor: "#606266",
+          success: async (res) => {
+            if (res.confirm) {
+              const res = await activity.postSpecialFollow();
+              if (res.Ret === 200) {
+                this.isFollow = !this.isFollow;
+              }
+            }
+          },
+        });
+      } else {
+        const res = await activity.postSpecialFollow();
+        if (res.Ret === 200) {
+          this.isFollow = !this.isFollow;
+          this.goFollowShow = true;
+        }
+      }
+    },
   },
   onLoad(option) {
-    console.log(option);
-    this.id = option.id || "";
+    this.id = option.id || '';
   },
   async onShow() {
     await this.$store.dispatch("checkHandle");
@@ -180,9 +226,32 @@ export default {
 };
 </script>
 
-<style lang="scss">
-.activity-detail {
+<style lang="scss" scoped>
+.special-detail {
   padding-bottom: 100rpx;
+  .top-notice-special {
+    height: 96rpx;
+    padding-right: 20rpx;
+    background-color: #fe9000;
+    position: relative;
+    .notice {
+      width: 80%;
+    }
+    .inform-btn {
+      position: absolute;
+      right: 20rpx;
+      top: 50%;
+      transform: translateY(-50%);
+      width: 147rpx;
+      height: 40rpx;
+      background: #ffffff;
+      border-radius: 4rpx;
+      text-align: center;
+      line-height: 40rpx;
+      font-size: 24rpx;
+      color: #ff9e58;
+    }
+  }
   .notice {
     height: 60rpx;
     width: 100%;
@@ -315,6 +384,7 @@ export default {
       }
     }
   }
+
   .look-Trip {
     width: 100%;
     text-align: center;

+ 1 - 1
config/config.js

@@ -2,4 +2,4 @@ export const baseUrl = 'http://8.136.199.33:8500/api';//小程序开发接口地
 //export const baseUrl = 'https://cygx.hzinsights.com/api';//小程序线上接口地址
 // #ifdef H5
 export const H5baseUrl=process.env.NODE_ENV === 'development'?window.location.origin+'/':baseUrl
-// #endif
+// #endif 

+ 9 - 29
pageMy/chartPage/chartPage.vue

@@ -49,12 +49,18 @@ export default {
         ChartId: this.chartData.ChartId,
       });
       if (res.Ret === 200) {
-        this.isCollection = !this.isCollection;
+        this.isCollection = res.Data.Status == 1 ? true : false;
         this.$util.toast(res.Msg);
       }
     },
   },
-  async onShow() {},
+  async onShow() {
+    await this.$store.dispatch("checkHandle");
+    if (!this.$store.state.isAuth && !this.$store.state.isBind) {
+      //已授权已绑定
+      this.id && this.myChartDetail();
+    } 
+  },
   onLoad(option) {
     // /* 兼容iphonex底部 */
     uni.getSystemInfo({
@@ -66,7 +72,6 @@ export default {
       },
     });
     this.id = option.id || "";
-    this.id && this.myChartDetail();
   },
   /**
    * 用户点击分享
@@ -74,7 +79,7 @@ export default {
   onShareAppMessage: function (res) {
     return {
       title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.chartData.Title,
-      path: "/pageMy/chartPage/chartPage?id" + this.id,
+      path: "/pageMy/chartPage/chartPage?id=" + this.id,
     };
   },
 };
@@ -83,31 +88,6 @@ export default {
 <style lang="scss" scoped>
 .reportDetail-container {
   background-color: #fff;
-  .search-view {
-    position: fixed;
-    width: 100%;
-    height: 110rpx;
-    padding: 15rpx 34rpx;
-    z-index: 99999;
-    font-size: 24rpx;
-    box-sizing: border-box;
-    background: #fff;
-    .search-view-box {
-      display: flex;
-      align-items: center;
-      background: #f6f6f6;
-      border: 1px solid #e5e5e5;
-      border-radius: 35rpx;
-      height: 70rpx;
-      z-index: 99999;
-    }
-    .search-icon {
-      width: 26rpx;
-      height: 26rpx;
-      margin: 0 15rpx;
-      z-index: 99999;
-    }
-  }
   .footer-con {
     position: fixed;
     z-index: 99999;

+ 87 - 60
pageMy/search/search.vue

@@ -18,13 +18,10 @@
         </van-radio-group>
       </view>
       <view class="tab-cont" v-if="radioSelect == 2 && isResult">
-        <scroll-view scroll-x="true" scroll-with-animation class="scroll-tab" :scroll-into-view="'_' + tabIndex">
-          <block v-for="item in tabBars" :key="item.mode">
-            <view class="scroll-tab-item" :class="{ active: orderColumn === item.mode }" @click.stop="toggleTab(item)">
-              {{ item.PermissionName }}
-            </view>
-          </block>
-        </scroll-view>
+        <view :class="['item', item.mode == orderColumn && 'tabs-active text_twoLine']" v-for="item in tabBars" :key="item.mode" @click.stop="toggleTab(item)">
+          {{ item.PermissionName }}
+          <view class="active" v-if="orderColumn === item.mode"></view>
+        </view>
       </view>
     </view>
     <view class="search-cont" v-if="!isResult">
@@ -68,15 +65,11 @@
               </view>
               <view class="item-content" v-else><u-parse :html="report.Body[0] + '...'"></u-parse></view>
               <view class="line"></view>
-              <view :class="['item-title', report.Source != 1 && 'chart-title']"><u-parse :html="report.Title"></u-parse></view>
-              <view class="item-abstract" v-if="report.abstract">
-                <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/report_ico.png" class="report_ico"></image>
-                {{ report.abstract }}
-              </view>
+              <view :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']"><u-parse :html="report.Title"></u-parse></view>
               <text class="item-createtime" v-if="report.Source == 1">{{ report.PublishDate }}</text>
               <view class="item-createtime chart-tag" v-else>
-                <text class="tag-item">{{ report.PtagName }}</text>
-                <text class="tag-item">{{ report.CtagName }}</text>
+                <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
+                <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
               </view>
             </view>
           </view>
@@ -87,19 +80,16 @@
               </view>
               <view class="item-content" v-else><u-parse :html="report.Body[0] + '...'"></u-parse></view>
               <view class="line"></view>
-              <view :class="['item-title', report.Source != 1 && 'chart-title']"><u-parse :html="report.Title"></u-parse></view>
-              <view class="item-abstract" v-if="report.ExpertBackground">
-                <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/report_ico.png" class="report_ico"></image>
-                {{ report.ExpertBackground }}
-              </view>
+              <view :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']"><u-parse :html="report.Title"></u-parse></view>
               <text class="item-createtime" v-if="report.Source == 1">{{ report.PublishDate }}</text>
               <view class="item-createtime chart-tag" v-else>
-                <text class="tag-item">{{ report.PtagName }}</text>
-                <text class="tag-item">{{ report.CtagName }}</text>
+                <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
+                <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
               </view>
             </view>
           </view>
         </view>
+        <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="pageNum > 1" />
       </block>
       <view class="nodata" v-else>
         <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
@@ -126,8 +116,9 @@ export default {
       chartWordList: [],
       // 搜索结果列表
       resultList: [],
+      resultDataList: [],
       indList: [],
-      page_no: 1,
+      pageNum: 1,
       pageSize: 10,
       totalPage: 0,
       hotKeyWord: [],
@@ -147,6 +138,12 @@ export default {
         },
       ],
       orderColumn: "Matching",
+      status: "loadmore",
+      loadText: {
+        loadmore: "上拉加载更多",
+        loading: "加载中",
+        nomore: "已经到底了",
+      },
     };
   },
   watch: {
@@ -171,6 +168,7 @@ export default {
     onChangeRadio(value) {
       this.radioSelect = value.detail;
       this.orderColumn = "Matching";
+      this.dataInit();
       this.clearIpt();
     },
     /* 获取关键词 */
@@ -185,7 +183,7 @@ export default {
     chooseTarget(item) {
       this.searchTxt = item;
       this.SecName = item;
-      this.resultList = [];
+      this.dataInit();
       this.indList = [];
       if (!this.historySearchList.includes(this.searchTxt)) {
         this.historySearchList.unshift(this.searchTxt);
@@ -205,8 +203,8 @@ export default {
           this.historySearchList.unshift(this.searchTxt);
           this.$db.set("historySearchList", JSON.stringify(this.historySearchList));
         }
-        this.resultList = [];
         this.indList = [];
+        this.dataInit();
         this.getDataList();
       } else {
         this.$util.toast("请输入关键字");
@@ -221,14 +219,14 @@ export default {
         ListType: this.radioSelect,
       });
       if (res.Ret === 200) {
+        this.totalPage = res.Data.Paging.Totals;
         if (this.radioSelect == 1) {
-          this.haveData = res.Data.List ? true : res.Data.ChartList ? true : false;
-          if (!res.Data.List) {
-            this.resultList = res.Data.ChartList;
-          } else if (!res.Data.ChartList) {
-            this.resultList = res.Data.List;
+          if (!res.Data.List.length) {
+            this.resultDataList = res.Data.ChartList || [];
+          } else if (!res.Data.ChartList.length) {
+            this.resultDataList = res.Data.List || [];
           } else {
-            this.resultList.push(res.Data.List.shift());
+            this.resultDataList.push(res.Data.List.shift());
             let newArr = [];
             let newArrTwo = [];
             for (let i = 0; i < res.Data.List.length; i += 2) {
@@ -245,20 +243,23 @@ export default {
                 arr.push(item);
               }
             });
-            this.resultList = this.resultList.concat(arr.flat(Infinity));
+            this.resultDataList = this.resultDataList.concat(arr.flat(Infinity));
           }
+          this.haveResult = this.resultDataList.length ? true : false;
         } else if (this.radioSelect == 2) {
-          this.resultList = res.Data.List || [];
-          this.haveResult = this.resultList.length ? true : false;
+          this.resultDataList = res.Data.List || [];
+          this.haveResult = this.resultDataList.length ? true : false;
         } else {
-          this.resultList = res.Data.ChartList || [];
-          this.haveResult = this.resultList.length ? true : false;
+          this.resultDataList = res.Data.ChartList || [];
+          this.haveResult = this.resultDataList.length ? true : false;
         }
+        this.resultList = this.haveResult ? this.resultDataList.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize) : [];
       }
     },
     /* 表单清空 */
     clearIpt() {
       this.searchTxt = "";
+      this.dataInit();
       this.isTabAct = false;
     },
     /* 进入详情 校验是否有该品种权限 */
@@ -276,9 +277,26 @@ export default {
       this.historySearchList = [];
       this.$db.del("historySearchList");
     },
+    //获取数据的初始值
+    dataInit() {
+      this.pageNum = 1;
+      this.resultList = [];
+      this.resultDataList = [];
+      this.status = "loadmore";
+        uni.pageScrollTo({
+          scrollTop: 0,
+          duration: 0,
+        });
+    },
     //tabs切换事件
     toggleTab(item) {
       this.orderColumn = item.mode;
+      this.pageNum = 1;
+      uni.pageScrollTo({
+        scrollTop: 0,
+        duration: 0,
+      });
+      this.resultList = [];
       this.getDataList();
       uni.pageScrollTo({
         scrollTop: 0,
@@ -302,6 +320,16 @@ export default {
     this.getKeyWord();
     this.researchHotKeyWord();
   },
+  // 上拉加载this.resultList
+  onReachBottom: Throttle(function () {
+    if (!this.resultList.length) return;
+    if (this.status === "nomore") return;
+    this.status = "loading";
+    this.pageNum++;
+    this.resultList = this.resultList.concat(this.resultDataList.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize));
+    this.status = this.pageNum * 10 < this.totalPage ? "loadmore" : "nomore";
+    console.log(this.status);
+  }),
 };
 </script>
 
@@ -473,6 +501,7 @@ export default {
           }
           .chart-title {
             height: 72rpx;
+            padding-bottom: 10rpx;
           }
           .item-abstract {
             font-size: 26rpx;
@@ -496,6 +525,7 @@ export default {
         align-items: center;
         justify-content: space-between;
         padding-top: 1rpx;
+        height: 36rpx;
         .tag-item {
           width: 148rpx;
           border-radius: 28rpx;
@@ -510,7 +540,7 @@ export default {
         display: flex;
         align-items: center;
         width: 330rpx;
-        margin-left: -6rpx;
+        margin-left: -15rpx;
         margin-bottom: -20rpx;
         image {
           width: 100%;
@@ -522,38 +552,35 @@ export default {
   }
   .tab-cont {
     width: 100%;
+    display: flex;
+    align-items: center;
     padding: 20rpx 30rpx 0;
-    background-color: #fff;
     font-size: 32rpx;
-    .scroll-tab {
-      width: 100%;
-      white-space: nowrap;
+    &::-webkit-scrollbar {
+      width: 0;
+      height: 0;
+      display: none;
     }
-    .scroll-tab-item {
-      text-align: center;
-      display: inline-block;
-      padding-bottom: 20rpx;
-      margin-right: 40rpx;
-      border-bottom: 8rpx solid transparent;
+    .item {
       position: relative;
-      &:last-child {
-        margin-right: 0;
-      }
-      &.active {
-        border-bottom: none;
-        color: #2c83ff;
-        font-weight: 700;
-        border-bottom: 2px solid;
-        border-image: linear-gradient(to right, #2e85ff, #7eeaf6) 1;
-      }
-      .border_act {
-        width: 100%;
-        height: 8rpx;
+      padding-bottom: 16rpx;
+      margin-right: 50rpx;
+      flex-shrink: 0;
+      .active {
         position: absolute;
-        bottom: 0;
         left: 0;
+        bottom: 0;
+        height: 4rpx;
+        width: 100%;
+        border-radius: 2rpx;
+
+        font-weight: 500;
+        background: linear-gradient(90deg, #2e85ff 0%, #7eeaf6 100%);
       }
     }
+    .tabs-active {
+      color: #3385ff;
+    }
   }
 }
 </style>

+ 21 - 12
pages/index/index.vue

@@ -17,7 +17,12 @@
       </view>
       <view class="tabs-content">
         <view class="second-tabs" v-if="topTabsActive == '2' || topTabsActive == '3'">
-          <view :class="['item', item.ChartPermissionId == secondActive && 'tabs-active']" v-for="(item, index) in secondBars" :key="item.ChartPermissionId" @click="handleClickTopSub(item)">
+          <view
+            :class="['item', item.ChartPermissionId == secondActive && 'tabs-active text_twoLine']"
+            v-for="(item, index) in secondBars"
+            :key="item.ChartPermissionId"
+            @click="handleClickTopSub(item)"
+          >
             {{ item.PermissionName }}
             <block v-if="index === secondBars.length - 1 && topTabsActive == '2' && isShowResearch">
               <image class="limit-img tabs-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/limit_icon.png" mode=""></image>
@@ -43,7 +48,7 @@
             </view>
             <view class="item-content" v-else>{{ report.Body }}</view>
             <view class="line"></view>
-            <text :class="['item-title', report.Source != 1 && 'chart-title']">{{ report.Title }}</text>
+            <text :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']">{{ report.Title }}</text>
             <view class="item-abstract text_twoLine" v-if="report.ExpertBackground">
               <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/fenxi_ico.png" class="report_ico"></image>
               {{ report.ExpertBackground }}
@@ -59,8 +64,8 @@
             </block>
             <block v-else>
               <view class="item-createtime chart-tag">
-                <text class="tag-item">{{ report.PtagName }}</text>
-                <text class="tag-item">{{ report.CtagName }}</text>
+                <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
+                <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
               </view>
               <view class="chart-collect" v-if="topTabsActive == 3 && secondActive == 0">
                 <text class="cancel" @click.stop="myChartIsTop(report.ChartId)">{{ report.IsTop ? "取消置顶" : "置顶" }}</text>
@@ -77,7 +82,7 @@
             </view>
             <view class="item-content" v-else>{{ report.Body }}</view>
             <view class="line"></view>
-            <text :class="['item-title', report.Source != 1 && 'chart-title']">{{ report.Title }}</text>
+            <text :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']">{{ report.Title }}</text>
             <view class="item-abstract text_twoLine" v-if="report.ExpertBackground">
               <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/fenxi_ico.png" class="report_ico"></image>
               {{ report.ExpertBackground }}
@@ -93,8 +98,8 @@
             </block>
             <block v-else>
               <view class="item-createtime chart-tag">
-                <text class="tag-item">{{ report.PtagName }}</text>
-                <text class="tag-item">{{ report.CtagName }}</text>
+                <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
+                <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
               </view>
               <view class="chart-collect" v-if="topTabsActive == 3 && secondActive == 0">
                 <text class="cancel" @click.stop="myChartIsTop(report.ChartId)">{{ report.IsTop ? "取消置顶" : "置顶" }}</text>
@@ -105,7 +110,7 @@
           </view>
         </view>
       </view>
-      <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" />
+      <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="pageNum > 1" />
     </block>
     <view class="nodata" v-else-if="haveData === false" style="padding-top: 400rpx">
       <block class="nodata" v-if="!isBindingMobile && secondActive == 0">
@@ -317,7 +322,7 @@ export default {
           this.status = this.pageNum < res.Data.Paging.Pages ? "loadmore" : "nomore";
           this.isBindingMobile = res.Data.IsBindingMobile;
           if (this.pageNum === 1) {
-            this.dataList = res.Data.List;
+            this.dataList = res.Data.List || [];
             this.haveData = this.dataList.length > 0 ? true : false;
           } else {
             this.dataList = this.dataList.concat(res.Data.List);
@@ -360,7 +365,7 @@ export default {
           this.dataList = this.dataList.concat(res.Data.List);
         }
       } else {
-        if (this.pageNum === 1 && res.Data.List) {
+        if (this.pageNum === 1) {
           this.haveData = res.Data.List ? true : res.Data.ChartList ? true : false;
         }
         if (!res.Data.List) {
@@ -407,7 +412,7 @@ export default {
             });
             if (res.Ret === 200) {
               this.initData();
-              this.$util.toast("图表移除成功");
+              this.$util.toast("已取消收藏");
             }
           }
         },
@@ -462,6 +467,8 @@ export default {
   /* 下拉刷新 */
   onPullDownRefresh: Throttle(function () {
     this.status = "loadmore";
+    this.refresh = true;
+    this.dataList = [];
     this.pageNum = 1;
     this.getReportList();
   }),
@@ -477,7 +484,7 @@ export default {
     return {
       title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "您手边的弘则研究素材检索库",
       path: "/pages/index/index?topTabsActive=" + this.topTabsActive,
-      imageUrl: "https://hzstatic.hzinsights.com/cygx/czbk/home_share.png",
+      imageUrl: this.topTabsActive == 1 ? "https://hzstatic.hzinsights.com/cygx/czbk/home_share.png" : "",
       success: (res) => {},
       fail: (err) => {},
     };
@@ -681,6 +688,7 @@ export default {
         }
         .chart-title {
           height: 72rpx;
+          padding-bottom: 10rpx;
         }
         .item-abstract {
           font-size: 26rpx;
@@ -711,6 +719,7 @@ export default {
         }
         .chart-tag {
           padding-top: 1rpx;
+          height: 36rpx;
           .tag-item {
             width: 148rpx;
             border-radius: 28rpx;