فهرست منبع

fix: 修复一些缺陷

cuiyalong 4 سال پیش
والد
کامیت
eaa44fd6ab

+ 1 - 1
src/App.vue

@@ -41,7 +41,7 @@ export default {
 </script>
 <style lang="scss">
 @import "~@/assets/style/reset-ele.scss";
-.w1200 {
+.v-w1200 {
   width: 1200px;
   margin: 0 auto;
 }

+ 2 - 2
src/api/modules/user.js

@@ -12,8 +12,8 @@ export function getUserPower () {
 export function getAdList (data) {
   data = qs.stringify(data)
   return request({
-    baseURL: '',
-    url: '/jydocs/getAdvertisement',
+    baseURL: '/jypay',
+    url: '/getAdvertisement',
     method: 'post',
     data
   })

+ 6 - 2
src/components/article-item/ArticleItem.vue

@@ -6,7 +6,7 @@
         <span class="tag" v-if="article.area">{{ article.area }}</span>
         <span class="tag orange" v-if="article.type">{{ article.type }}</span>
         <span class="tag green" v-if="article.buyerclass">{{ article.buyerclass }}</span>
-        <span class="tag dpink" v-if="article.calcBudget">{{ article.calcBudget }}</span>
+        <span class="tag dpink" v-if="calcBudget">{{ calcBudget }}</span>
       </div>
       <div class="time-container">
         <span class="el-icon-jy-time"></span>
@@ -48,7 +48,11 @@ export default {
   },
   computed: {
     calcBudget () {
-      return moneyUnit(this.article.budget)
+      if (this.article.budget) {
+        return moneyUnit(this.article.budget)
+      } else {
+        return this.article.budget
+      }
     },
     calcTitle () {
       const hightLightedTitle = replaceKeyword(this.article.title, this.article.matchkeys, ['<span class="highlight-text">', '</span>'])

+ 24 - 14
src/components/common/ContentLayout.vue

@@ -1,9 +1,9 @@
 <template>
-  <div class="content-container w1200">
+  <div class="content-container v-w1200" :class="{ calc: conentCenter }">
     <div class="content-main">
       <slot name="default"></slot>
     </div>
-    <div class="content-right ad-container" :class="{ nothing: adList.length === 0 && autoExpand }">
+    <div class="content-right ad-container" :class="{ nothing: adShow }">
       <slot name="right">
         <slot name="right-top"></slot>
         <div class="ad-list">
@@ -11,7 +11,7 @@
             class="ad-item-container"
             v-for="(item, index) in adList"
             :key="index">
-            <a :href="item.s_link">
+            <a :href="item.s_link" target="_blank">
               <img :src="item.s_pic" />
             </a>
           </div>
@@ -36,14 +36,18 @@ export default {
       type: String,
       default: ''
     },
-    adNum: {
-      type: Number,
-      default: 2
+    // 如果没有广告位,内容宽度状态(居中/自适应铺满)
+    contentWithState: {
+      type: String,
+      default: 'center' // center/full
+    }
+  },
+  computed: {
+    conentCenter () {
+      return this.adList.length === 0 && this.contentWithState === 'center'
     },
-    // 如果没有广告位,是否宽度自适应铺满
-    autoExpand: {
-      type: Boolean,
-      default: true
+    adShow () {
+      return this.adList.length === 0 && this.contentWithState
     }
   },
   data () {
@@ -71,8 +75,7 @@ export default {
   methods: {
     async getAdvertisementList () {
       const params = {
-        code: this.adCode,
-        num: this.adNum
+        code: this.adCode
       }
 
       if (!params.code) {
@@ -85,7 +88,7 @@ export default {
       const { data } = await getAdList(params)
 
       if (Array.isArray(data)) {
-        this.adList = []
+        this.adList = data
       }
     }
   }
@@ -97,6 +100,14 @@ export default {
   display: flex;
   margin: 32px auto;
   padding-bottom: 60px;
+  &.calc {
+    display: block;
+    .content-main {
+      display: block;
+      width: calc(100% - 264px);
+      margin: 0 auto;
+    }
+  }
   .content-main {
     flex: 1;
     transition: .1s;
@@ -114,7 +125,6 @@ export default {
       overflow: hidden;
       border-radius: 4px;
       // background-color: #C4C4C4;
-      background-color: #D2F6FC;
       &:not(:last-of-type) {
         margin-bottom: 16px;
       }

+ 2 - 2
src/components/push-list/ProjectList.vue

@@ -141,7 +141,7 @@ export default {
         })
       }
 
-      this.listState.loading = true
+      // this.listState.loading = true
       this.listState.loaded = false
       // 判断是否无筛选条件
       this.isAllFirst = false
@@ -149,7 +149,7 @@ export default {
         this.isAllFirst = true
       }
       const res = await getFollowProjectList(query)
-      this.listState.loading = false
+      // this.listState.loading = false
       this.listState.loaded = true
 
       if (res.error_code === 0) {

+ 1 - 1
src/components/push-list/PushList.vue

@@ -15,7 +15,7 @@
       <empty v-show="showEmpty">
         <div v-if="isAllFirst">
           <span>订阅关键词,接收最新招投标信息</span>
-          <div class="add-key-button">
+          <div class="add-key-button" @click="$router.push('/subscribe/config')">
             <span class="icon-chahao"></span>
             <span class="button-text">订阅关键词</span>
           </div>

+ 1 - 1
src/components/selector/IndustrySelectorContent.vue

@@ -55,7 +55,7 @@
           @click="changeIndustryState(item)"
         >{{ item.name }}</button>
       </div>
-      <div class="select-group-main">
+      <div class="select-group-main" v-show="showMore">
         <button
           v-for="(iitem, iindex) in item.children" :key="999-iindex"
           class="j-button-item bgc-opacity"

+ 23 - 8
src/views/project/ProjectInfo.vue

@@ -4,9 +4,9 @@
       <div class="project-header">
         <div class="p-h-top">
           <div class="p-h-title">{{ projectInfo.projectname }}</div>
-          <div class="p-h-actions" v-if="!isOver">
-            <el-button class="action-button" type="primary" icon="el-icon-jy-ai" @click="$router.push('/bidforecast')">中标企业预测</el-button>
-            <el-button class="action-button" type="primary" icon="el-icon-jy-analysis" @click="$router.push('/bidpolicy')">投标决策分析</el-button>
+          <div class="p-h-actions" v-if="showAction">
+            <el-button class="action-button" type="primary" icon="el-icon-jy-ai" @click="toForecast">中标企业预测</el-button>
+            <el-button class="action-button" type="primary" icon="el-icon-jy-analysis" @click="toPolicy">投标决策分析</el-button>
           </div>
         </div>
         <div class="p-h-bottom">
@@ -73,6 +73,7 @@ export default {
   },
   data () {
     return {
+      showAction: false,
       sid: '', // 信息id
       fid: '', // 关注id
       projectContent: {
@@ -106,9 +107,6 @@ export default {
     }
   },
   computed: {
-    isOver () {
-      return this.projectContent.bidopentime * 1000 < +new Date()
-    },
     timeLineList () {
       return this.projectInfo.list.map(item => {
         const s = {
@@ -124,7 +122,7 @@ export default {
         if (item.s_subtype) {
           s.tags.push(item.s_subtype)
         }
-        if (item.s_toptype) {
+        if (!item.s_subtype && item.s_toptype) {
           s.tags.push(item.s_toptype)
         }
         s.tags = Array.from(new Set(s.tags)) // 去重
@@ -146,6 +144,7 @@ export default {
         Object.assign(this.projectContent, data)
         Object.assign(this.projectInfo, data.projectInfo)
         this.filterData()
+        this.isShowAction()
       }
     },
     async clickFollowButton () {
@@ -172,7 +171,23 @@ export default {
       } else {
         this.projectInfo.area = `${this.projectInfo.area}省`
       }
-      console.log(this.timeLineList)
+
+      if (Array.isArray(this.projectInfo.list)) {
+        this.projectInfo.list = this.projectInfo.list.reverse()
+      }
+    },
+    isShowAction () {
+      const r = ['成交', '中标'].includes(this.projectInfo.bidstatus)
+      this.showAction = !r
+    },
+    toForecast () {
+      const { sid, fid } = this
+      this.$router.push(`/bidforlimit/${fid}/${sid}`)
+      
+    },
+    toPolicy () {
+      const { sid, fid } = this
+      this.$router.push(`/analysis/result/${fid}/${sid}`)
     }
   }
 }

+ 1 - 1
vue.config.js

@@ -42,7 +42,7 @@ module.exports = {
           '^/bigmember': '/bigmember'
         }
       },
-      '^/jydoc': {
+      '^/jypay': {
         target: 'http://web-jytest.jydev.jianyu360.com',
         changeOrigin: true,
         logLevel: 'debug'