123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- <template>
- <div id="index">
- <el-row>
- <el-col :span="24" class="main animate__animated animate__backInRight" v-loading="loading">
- <div class="w_1200">
- <el-col :span="24" class="one">
- <el-row :span="24" class="one_1">
- <el-col :span="20" class="title">{{ info.name || '暂无标题' }}</el-col>
- <el-col :span="4" class="file">
- <el-icon>
- <Download />
- </el-icon>
- 附件下载
- </el-col>
- </el-row>
- <el-row :span="24" class="one_2"> {{ getDict(info.sell, 'sell') }} </el-row>
- </el-col>
- <el-col :span="24" class="two">
- <a-descriptions bordered>
- <a-descriptions-item label="行业分类">
- {{ getDict(info.field, 'field') }}
- </a-descriptions-item>
- <a-descriptions-item label="成果属性">
- {{ getDict(info.attribute, 'attribute') }}
- </a-descriptions-item>
- <a-descriptions-item label="出让方式">
- {{ getDict(info.sell, 'sell') }}
- </a-descriptions-item>
- <a-descriptions-item label="成熟度">
- {{ getDict(info.mature, 'mature') }}
- </a-descriptions-item>
- <a-descriptions-item label="技术分类">
- {{ getDict(info.technology, 'technology') }}
- </a-descriptions-item>
- <a-descriptions-item label="成果地区">
- {{ getArea(info.area) }}
- </a-descriptions-item>
- <a-descriptions-item label="发布时间">
- {{ info.time }}
- </a-descriptions-item>
- </a-descriptions>
- </el-col>
- <el-col :span="24" class="pointer">
- <div class="money">
- 参考价格:<span> {{ info.money || '面议' }} </span>
- </div>
- <a-button type="primary"> 我要买 </a-button>
- </el-col>
- <el-col :span="24" class="pointer" v-if="!user && !user._id">
- 提醒:您还没有登录,登录成功后再对接
- </el-col>
- <el-col :span="24" class="thr">
- <el-col :span="24" class="thr_1">
- <p>单位信息</p>
- </el-col>
- <el-row :span="24" class="thr_2">
- <el-col :span="16" class="left">
- <el-col :span="24" class="name">
- {{ unit.name || '暂无' }}
- </el-col>
- <el-col :span="24" class="other">
- <span>联系人</span>
- {{ unit.contacts || '暂无' }}
- </el-col>
- </el-col>
- <el-col :span="8" class="right">
- <a-button type="primary">
- <template #icon>
- <MessageOutlined />
- </template>
- 点击在线洽谈
- </a-button>
- <a-button class="button"> 进入单位 </a-button>
- <a-button class="button"> 收藏单位 </a-button>
- </el-col>
- </el-row>
- </el-col>
- <a-divider />
- <el-col :span="24" class="four">
- <el-col :span="24" class="four_1">
- <p>成果详情</p>
- </el-col>
- <el-col :span="24" class="four_2">{{ info.brief || '暂无' }}</el-col>
- </el-col>
- </div>
- </el-col>
- </el-row>
- </div>
- </template>
- <script setup>
- // 基础
- import { MessageOutlined } from '@ant-design/icons-vue'
- import { get } from 'lodash-es'
- const $checkRes = inject('$checkRes')
- // 接口
- import { AchievementStore } from '@/store/api/platform/achievement'
- import { DictDataStore } from '@/store/api/system/dictData'
- const store = AchievementStore()
- const dictDataStore = DictDataStore()
- import { UserStore } from '@/store/user'
- const userStore = UserStore()
- const user = computed(() => userStore.user)
- // 路由
- const route = useRoute()
- // 加载中
- const loading = ref(false)
- const info = ref({})
- const unit = ref({ name: '吉林大学', contacts: '陈老师' })
- // 字典表
- const fieldList = ref([])
- const attributeList = ref([])
- const matureList = ref([])
- const sellList = ref([])
- const technologyList = ref([])
- // 请求
- onMounted(async () => {
- loading.value = true
- await searchOther()
- await search()
- loading.value = false
- })
- const search = async () => {
- let id = route.query.id
- if (id) {
- let res = await store.fetch(id)
- if (res.errcode == '0') info.value = res.data
- }
- }
- const searchOther = async () => {
- let result
- // 成熟度
- result = await dictDataStore.query({ code: 'mature', is_use: '0' })
- if ($checkRes(result)) matureList.value = result.data
- // 出让方式
- result = await dictDataStore.query({ code: 'sell', is_use: '0' })
- if ($checkRes(result)) sellList.value = result.data
- // 技术领域
- result = await dictDataStore.query({ code: 'field', is_use: '0' })
- if ($checkRes(result)) fieldList.value = result.data
- // 属性
- result = await dictDataStore.query({ code: 'attribute', is_use: '0' })
- if ($checkRes(result)) attributeList.value = result.data
- // 技术分类
- result = await dictDataStore.query({ code: 'technology', is_use: '0' })
- if ($checkRes(result)) technologyList.value = result.data
- }
- // 字典数据转换
- const getDict = (data, model) => {
- let res
- if (model == 'mature') res = matureList.value.find((f) => f.value == data)
- else if (model == 'sell') res = sellList.value.find((f) => f.value == data)
- else if (model == 'field') res = fieldList.value.find((f) => f.value == data)
- else if (model == 'attribute') res = attributeList.value.find((f) => f.value == data)
- else if (model == 'technology') res = technologyList.value.find((f) => f.value == data)
- return get(res, 'label')
- }
- // 地区
- const getArea = (data) => {
- if (data) return data.join(',')
- }
- </script>
- <style scoped lang="scss">
- .main {
- .one {
- margin: 10px 0 0 0;
- background: #f7f7f7;
- padding: 24px;
- border-top: 6px solid #2374ff;
- overflow: hidden;
- border-radius: 0 0 5px 5px;
- .one_1 {
- margin: 0 0 10px 0;
- .title {
- font-size: 18px;
- font-weight: 700;
- color: #383b40;
- }
- .file {
- display: flex;
- align-items: center;
- justify-content: end;
- font-family: PingFangSC-Regular;
- font-size: 14px;
- color: #2374ff;
- text-align: right;
- }
- }
- .one_2 {
- display: inline-block;
- font-size: 12px;
- background: rgba(18, 172, 117, 0.05);
- color: #12ac75;
- padding: 0 15px;
- height: 20px;
- line-height: 20px;
- border-radius: 10px;
- margin-bottom: 2px;
- }
- }
- .two {
- background: #f9fafb;
- border-radius: 2px;
- padding: 30px;
- margin: 34px 0 20px;
- font-family: PingFangSC-Medium;
- font-size: 14px;
- color: #383b40;
- line-height: 14px;
- }
- .thr {
- margin: 0 0 10px 0;
- .thr_1 {
- width: 100%;
- height: 40px;
- line-height: 40px;
- border-bottom: 2px solid #2374ff;
- margin: 20px 0;
- background: #f7f7f7;
- p {
- float: left;
- padding: 0 20px;
- height: 40px;
- border-bottom: 2px solid #2374ff;
- color: #fff;
- font-size: 18px;
- background: #2374ff;
- }
- }
- .thr_2 {
- display: flex;
- justify-content: space-between;
- align-items: center;
- background: #fff;
- border: 1px solid #edeff2;
- box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.03);
- border-radius: 2px;
- padding: 30px 20px;
- .left {
- .name {
- height: 20px;
- font-family: PingFangSC-Semibold;
- font-size: 18px;
- color: #383b40;
- line-height: 20px;
- font-weight: 700;
- margin-bottom: 8px;
- }
- .other {
- height: 14px;
- font-family: PingFangSC-Medium;
- font-size: 14px;
- color: #383b40;
- line-height: 14px;
- font-weight: 700;
- span {
- height: 14px;
- font-family: PingFangSC-Regular;
- font-size: 14px;
- color: #7e8288;
- line-height: 14px;
- font-weight: 400;
- margin-right: 16px;
- }
- }
- }
- .right {
- display: flex;
- justify-content: space-between;
- .button {
- border-color: #2374ff;
- color: #2374ff;
- }
- }
- }
- }
- .four {
- margin: 0 0 10px 0;
- .four_1 {
- width: 100%;
- height: 40px;
- line-height: 40px;
- border-bottom: 2px solid #2374ff;
- margin: 20px 0;
- background: #f7f7f7;
- p {
- float: left;
- padding: 0 20px;
- height: 40px;
- border-bottom: 2px solid #2374ff;
- color: #fff;
- font-size: 18px;
- background: #2374ff;
- }
- }
- }
- .pointer {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- font-family: PingFangSC-Regular;
- font-size: 14px;
- color: #7e8288;
- margin: 10px 0 0 0;
- .money {
- margin: 0 10px 0 0;
- span {
- font-family: PingFangSC-Semibold;
- font-size: 20px;
- color: #e94643;
- line-height: 20px;
- }
- }
- }
- }
- </style>
|