Browse Source

feat:拟在建等项目详情页banner图片调整为广告位

yangfeng 1 year ago
parent
commit
31c17e2a57
3 changed files with 38 additions and 632 deletions
  1. 8 0
      apps/jy-pc/src/api/modules/ad.js
  2. 25 5
      apps/jy-pc/src/views/proposed-detail/Detail.vue
  3. 5 627
      pnpm-lock.yaml

+ 8 - 0
apps/jy-pc/src/api/modules/ad.js

@@ -18,3 +18,11 @@ export function getWhatIsWorkspace() {
     method: 'get'
   })
 }
+
+export function getCommonAdList(data) {
+  return request({
+    url: '/publicapply/free/getJyAdList',
+    method: 'POST',
+    data
+  })
+}

+ 25 - 5
apps/jy-pc/src/views/proposed-detail/Detail.vue

@@ -39,8 +39,8 @@
           <span class="desc">{{ allData.generalSituation }}</span>
         </div>
       </div>
-      <div class="img-box" v-if="!loginIn" @click="openLogin">
-        <img src="@/assets/image/proposed/login.png" alt="" />
+      <div class="img-box" v-if="!loginIn" @click="onAdOpen(adBanner.s_link)">
+        <img :src="adBanner.s_pic" :alt="adBanner.s_remark" />
       </div>
       <div class="content">
         <div class="content-tabs">
@@ -79,14 +79,14 @@
         </div>
       </div>
     </div>
-    <div
+    <!-- <div
       v-if="!loginIn"
       slot="right-bottom"
       class="reg-position-bottom"
       @click="openLogin"
     >
       <img src="@/assets/image/proposed/bottom-login.png" alt="" />
-    </div>
+    </div> -->
     <el-dialog
       custom-class="customclass"
       :visible.sync="isVisible"
@@ -109,6 +109,7 @@ import ProjectPerson from './components/ProjectPerson.vue'
 import Credentials from './components/Credentials.vue'
 import WorkspaceButtonGroup from '@/components/dialog/WorkspaceButtonGroup.vue'
 import { getLoginStatus } from '@/api/modules/front'
+import { getCommonAdList } from '@/api/modules/ad'
 import { dateFromNow, dateFormatter } from '@/utils/utils'
 import { mapGetters, mapActions } from 'vuex'
 export default {
@@ -136,7 +137,8 @@ export default {
       pid: '',
       allData: {},
       follRecord: [],
-      contact: []
+      contact: [],
+      adBanner: {}
     }
   },
   created() {
@@ -196,7 +198,9 @@ export default {
       const { result } = await getLoginStatus()
       if (result === 'ok') {
         this.loginIn = true
+        return
       }
+      this.getAdList()
     },
     descClick() {
       if (this.loginIn && !this.bigmember) {
@@ -219,6 +223,20 @@ export default {
     },
     nopower() {
       this.isVisible = true
+    },
+    async getAdList() {
+      const { data } = await getCommonAdList({
+        codes: ['pc-nologin-project-detail-middle']
+      })
+
+      if (data && Object.keys(data).length > 0) {
+        const { 'pc-nologin-project-detail-middle': adDetail } = data
+        this.adBanner = adDetail[0]
+      }
+    },
+    onAdOpen(url) {
+      if (!url) return
+      window.location.href = url
     }
   }
 }
@@ -311,6 +329,8 @@ export default {
     width: 980px;
     margin-top: 16px;
     cursor: pointer;
+    border-radius: 4px;
+    overflow: hidden;
   }
 
   .content {

File diff suppressed because it is too large
+ 5 - 627
pnpm-lock.yaml


Some files were not shown because too many files changed in this diff