bd 2 years ago
parent
commit
abfec93645
4 changed files with 41 additions and 39 deletions
  1. 16 16
      config/api.js
  2. 2 2
      config/config.js
  3. 4 2
      pageMy/search/search.vue
  4. 19 19
      reportPages/reportSearch/reportSearch.vue

+ 16 - 16
config/api.js

@@ -322,6 +322,22 @@ export const activity = {
   checkAskActivity: (params) => {
     return postHttp("/activity/checkAsk", params, 0);
   },
+  /*获取专项产业调研列表接口*/
+  getSpecialList: (params) => {
+    return getHttp("/activity/special/list", params);
+  },
+  /*获取专项产业调研列表接口*/
+  getSpecialDetailList: (params) => {
+    return getHttp("/activity/special/detail", params);
+  },
+  /*感兴趣、不感兴趣接口*/
+  postSpecialSignupAdd: (params) => {
+    return postHttp("/activity/special/signup/add", params);
+  },
+  /*获取专项产业调研列表接口*/
+  postSpecialFollow: (params) => {
+    return postHttp("/activity/special/follow", params);
+  },
 };
 export const Research = {
   /* 近期更新主题列表接口 */
@@ -352,22 +368,6 @@ export const Research = {
   researchHotKeyWord: (params) => {
     return getHttp("/research/hotKeyWord", params, 0);
   },
-  /*获取专项产业调研列表接口*/
-  getSpecialList: (params) => {
-    return getHttp("/activity/special/list", params);
-  },
-  /*获取专项产业调研列表接口*/
-  getSpecialDetailList: (params) => {
-    return getHttp("/activity/special/detail", params);
-  },
-  /*获取专项产业调研列表接口*/
-  postSpecialFollow: (params) => {
-    return postHttp("/activity/special/follow", params);
-  },
-  /*感兴趣、不感兴趣接口*/
-  postSpecialSignupAdd: (params) => {
-    return postHttp("/activity/special/signup/add", params);
-  },
 };
 export const FreeButton = {
   /*获取是否展示免费试用按钮接口*/

+ 2 - 2
config/config.js

@@ -1,5 +1,5 @@
-//export const baseUrl = 'http://8.136.199.33:8500/api';//小程序开发接口地址
-export const baseUrl = 'https://cygx.hzinsights.com/api';//小程序线上接口地址
+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 

+ 4 - 2
pageMy/search/search.vue

@@ -168,8 +168,10 @@ export default {
     onChangeRadio(value) {
       this.radioSelect = value.detail;
       this.orderColumn = "Matching";
+      let srt = this.searchTxt.replace(/^\s+|\s+$/g, "");
+      if (!srt) return this.$util.toast("请输入关键字");
       this.dataInit();
-      this.clearIpt();
+      this.getDataList();
     },
     /* 获取关键词 */
     getKeyWord() {
@@ -214,7 +216,7 @@ export default {
     async getDataList() {
       this.isResult = true;
       const res = await Search.getArtAndChartList({
-        KeyWord: this.searchTxt,
+        KeyWord: this.searchTxt.replace(/^\s+|\s+$/g, ""),
         OrderColumn: this.radioSelect == 2 ? this.orderColumn : "",
         ListType: this.radioSelect,
       });

+ 19 - 19
reportPages/reportSearch/reportSearch.vue

@@ -72,7 +72,6 @@
               </view>
             </block>
             <block v-if="ListYx.length">
-              <text style="height: 10rpx; background: #ececec"></text>
               <view class="resource">
                 <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/zybico.jpg"></image>
                 <text>研选主题</text>
@@ -211,19 +210,7 @@ export default {
       // 搜索结果列表
       resultList: [],
       indList: [],
-      page_no: 1,
-      pageSize: 10,
-      totalPage: 0,
       hotKeyWord: [],
-      loadText: {
-        loadmore: "上拉加载更多",
-        loading: "加载中",
-        nomore: "",
-      },
-      status: "loadmore",
-      shadowStyle: {
-        backgroundImage: "none",
-      },
       radioSelect: "",
       ListHz: [],
       ListYx: [],
@@ -252,7 +239,10 @@ export default {
     },
     onChangeRadio(value) {
       this.radioSelect = value.detail;
-      this.clearIpt();
+      let srt = this.searchTxt.replace(/^\s+|\s+$/g, "");
+      if (!srt) return this.$util.toast("请输入关键字");
+      this.dataInit();
+      this.getDataList();
     },
     /* 获取关键词 */
     getKeyWord() {
@@ -314,10 +304,10 @@ export default {
       const res =
         this.radioSelect == 2
           ? await Reports.getIndustryAndArticle({
-              KeyWord: this.searchTxt,
+              KeyWord: this.searchTxt.replace(/^\s+|\s+$/g, ""),
             })
           : await Reports.getReportSearchReport({
-              KeyWord: this.searchTxt,
+              KeyWord: this.searchTxt.replace(/^\s+|\s+$/g, ""),
             });
       if (res.Ret === 200) {
         this.ListHz = res.Data.ListHz || [];
@@ -358,7 +348,7 @@ export default {
     },
     //去往主题详情
     themeDetails(item) {
-      this.$store.dispatch("checkHandle", "/reportPages/researchTheme/researchTheme?id=" + item.IndustrialManagementId);
+      this.$store.dispatch("checkHandle", "/reportPages/IndustryReport/IndustryReport?id=" + item.IndustrialManagementId);
     },
     //收藏
     async collectClick(item) {
@@ -381,6 +371,15 @@ export default {
           });
       }
     },
+    //获取数据的初始值
+    dataInit() {
+      this.ListHz = [];
+      this.ListYx = [];
+      uni.pageScrollTo({
+        scrollTop: 0,
+        duration: 0,
+      });
+    },
     //点击了去关注
     goFollowShowBtn() {
       if (this.confirmText == "去关注") {
@@ -413,7 +412,7 @@ export default {
    */
   onShareAppMessage: function (res) {
     return {
-      title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" :  "报告",
+      title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "报告",
       path: "/reportPages/reportSearch/reportSearch?text=" + this.searchTxt,
       success: (res) => {},
       fail: (err) => {},
@@ -424,7 +423,7 @@ export default {
 
 <style lang="scss">
 .searchTarget-container {
-  background-color: #fff;
+  background-color: #f7f7f7;
   padding-bottom: 30rpx;
   .searchTarget-header {
     padding: 0 34rpx;
@@ -507,6 +506,7 @@ export default {
     .list-ui {
       background-color: #fff;
       margin-top: 2rpx;
+      margin-bottom: 10rpx;
     }
     .item-title {
       display: flex;