index.vue 7.65 KB
<template>
  <div class="home_container">
    <div class="bg_wrap">
      <el-image class="top_bg" :src="getImage('sec1-bg.png', '/home')"></el-image>

      <div class="content_wrap">
        <div class="sec1_wrap">
          <div class="sec1_title">联合供应链金融平台</div>
          <div class="title_dsc">联合征信旗下专业供应链金融服务平台</div>
          <div class="title_message">
            <el-badge :value="state.noticeNum" class="item" @click="linkTo('/notice')">
              <el-image :src="getImage('message-icon.png', '/home')"></el-image>
            </el-badge>
          </div>
        </div>

        <div class="notice_wrap">
          <div class="notice_title">
            <el-image class="notice_img" :src="getImage('notic.png', '/home')" fit="cover"></el-image>
            <span>公告通知:</span>
          </div>
          <div class="notice_con">
            <el-carousel direction="vertical" :autoplay="true" :height="'30px'" :indicator-position="'none'">
              <el-carousel-item v-for="item in 4" :key="item">
                <span>富民银行资方已接入</span>
              </el-carousel-item>
            </el-carousel>
          </div>
        </div>

        <div class="recommend_wrap">
          <el-row>
            <el-col :span="6" class="recommend-col" v-for="item in recommendList">
              <el-image class="recommend_img" :src="getImage(item.icon, '/home')" fit="contain"></el-image>
              <div>{{ item.name }}</div>
            </el-col>
          </el-row>
        </div>

        <div class="sec2_wrap">
          <el-row :gutter="8">
            <el-col :span="11" class="bg1_wrap">
              <el-image class="sec2_bg1" :src="getImage('sec2-bg1.png', '/home')"></el-image>
              <div class="bg1_con">
                <div class="con_title">经销商融资贷款</div>
                <div>先采购<span></span>再付款</div>
                <div class="title_dsc">高额度<span></span>放款快</div>
                <el-button round class="con_btn" @click="linkTo('/product')">去借款</el-button>
              </div>
            </el-col>
            <el-col :span="13">
              <el-row>
                <el-col :span="24" class="bg2_wrap">
                  <el-image class="sec2_bg2" :src="getImage('sec2-bg2.png', '/home')"></el-image>
                  <div class="bg2_con">
                    <div class="con_title">核心企业入驻</div>
                    <div class="title_dsc">企业线上接洽入驻</div>
                    <el-button round class="con_btn" @click="linkTo('/mine')">去申请</el-button>
                  </div>
                </el-col>
                <el-col :span="24" class="bg3_wrap">
                  <el-image class="sec2_bg3" :src="getImage('sec2-bg3.png', '/home')"></el-image>
                  <div class="bg3_con">
                    <div class="con_title">资金方合作</div>
                    <div class="title_dsc">多资金方合作服务</div>
                    <el-button round class="con_btn" @click="linkTo('/mine')">去查看</el-button>
                  </div>
                </el-col>
              </el-row>
            </el-col>
          </el-row>

          <el-carousel class="gg_wrap" :interval="5000" :autoplay="true" :height="'7rem'" :indicator-position="'none'">
            <el-carousel-item v-for="item in 3" :key="item">
              <div class="gg_bg_wrap">
                <el-image class="gg_img" :src="getImage('gg1.png', '/home')"></el-image>
                <div class="gg_con">
                  <div class="con_title">北京艾上智能科技有限公司</div>
                  <div class="con_money">提款98万元</div>
                  <div class="con_time">2023年3月8日 12:34:50</div>
                </div>
              </div>
            </el-carousel-item>
          </el-carousel>
        </div>

        <div class="sec3_wrap">
          <div class="sec_title">
            <el-image class="title_img" :src="getImage('circle-coin.png', '/home')" fit="cover"></el-image>
            <span>平台优势</span>
          </div>
          <el-row>
            <el-col :span="6" v-for="item in goodList">
              <el-image class="good_img" :src="getImage(item.icon, '/home')" fit="contain"></el-image>
              <div>{{ item.name }}</div>
            </el-col>
          </el-row>
        </div>

        <div class="sec4_wrap">
          <div class="sec_title">
            <el-image class="title_img" :src="getImage('circle-coin.png', '/home')" fit="cover"></el-image>
            <span>合作机构</span>
          </div>
          <el-row>
            <el-col :span="6" v-for="item in bankList" class="sec4_col">
              <el-image :class="item.isSmall ? 'good_img small' : 'good_img' " :src="getImage(item.icon, '/home')"
                        fit="contain"></el-image>
              <div>{{ item.name }}</div>
            </el-col>

            <el-divider border-style="dashed"/>

            <el-col :span="6" v-for="item in cooperationList">
              <el-image :class="item.isSmall ? 'good_img small' : 'good_img' " :src="getImage(item.icon, '/home')"
                        fit="contain"></el-image>
              <div>{{ item.name }}</div>
            </el-col>
          </el-row>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang='ts'>
import './../assets/css/home.scss'
import getImage from './../assets/getImage'
import router from "../router/index";
import {loginMain} from './../store/index'
import {storeToRefs} from 'pinia';

let loginAct = loginMain()
let {getStoreToken, getUserInfo} = storeToRefs(loginAct)
import * as api from "./../interface/api"

let state = reactive({
  isLogin: false,
  userInfo: null,
  noticeNum: undefined,
})

watchEffect(() => {
  state.isLogin = getStoreToken.value ? true : false
  state.userInfo = getUserInfo.value
})

let recommendList = reactive([
  {
    name: '采购融资',
    icon: 'sec1-icon1.png',
  },
  {
    name: '信用报告',
    icon: 'sec1-icon2.png',
  },
  {
    name: '评级服务',
    icon: 'sec1-icon3.png',
  },
  {
    name: '信用评价',
    icon: 'sec1-icon4.png',
  },
  {
    name: '核心企业',
    icon: 'sec1-icon5.png',
  },
  {
    name: '经销商',
    icon: 'sec1-icon6.png',
  },
  {
    name: '资金方',
    icon: 'sec1-icon7.png',
  },
  {
    name: '企业中心',
    icon: 'sec1-icon8.png',
  }
])

let goodList = reactive([
  {
    name: '纯信用',
    icon: 'ys1.png',
  }, {
    name: '利率低',
    icon: 'ys2.png',
  }, {
    name: '产品全',
    icon: 'ys3.png',
  }, {
    name: '服务好',
    icon: 'ys4.png',
  }
])

let bankList = reactive([
  {
    name: '中国银联',
    icon: 'yh1.png',
    isSmall: true,
  }, {
    name: '中国银行',
    icon: 'yh2.png',
    isSmall: true,
  }, {
    name: '平安银行',
    icon: 'yh3.png',
  }, {
    name: '中国农业',
    icon: 'yh4.png',
    isSmall: true,
  }
])

let cooperationList = reactive([
  {
    name: '清华同方',
    icon: 'hz1.png',
  }, {
    name: '五征集团',
    icon: 'hz2.png',
  }, {
    name: '龙大食品',
    icon: 'hz3.png',
    isSmall: true,
  }, {
    name: '伟仕佳节',
    icon: 'he4.png',
  }
])

let linkTo = (url: string) => {
  if (url == '/mine' || url == '/notice') {
    if (state.isLogin) {
      router.push(url)
    } else {
      router.push('/login')
    }
  } else {
    router.push(url)
  }
}

if (state.isLogin) {
  let num = 0
  api.getNotice().then(res => {
    res.rows.forEach(item => {
      if (item.isRead == 1) {
        num++
      }
    })
    state.noticeNum = num == 0 ? undefined : state.noticeNum
  })
}

const arrowPath = ref("/")
defineExpose({arrowPath})
</script>

<style scoped lang="scss">
</style>