Browse Source

购物车接口

master
lucky 5 years ago
parent
commit
b46329f26b
  1. 11
      src/components/Banner/Banner.vue
  2. 4
      src/config/api.js
  3. 6
      src/router/index.js
  4. 23
      src/store/modules/home/actions.js
  5. 9
      src/store/modules/home/mutations.js
  6. 1
      src/store/modules/home/state.js
  7. 21
      src/views/Cart/Cart.vue
  8. 16
      src/views/IncubationPlatform/Children/MakerSpace.vue
  9. 208
      src/views/IncubationPlatform/Children/ShareChild/Institute.vue
  10. 235
      src/views/IncubationPlatform/Children/place/EntitySpace.vue
  11. 2
      src/views/IncubationPlatform/components/HNav.vue

11
src/components/Banner/Banner.vue

@ -5,7 +5,7 @@
-->
<template>
<div>
<div class="head">
<a-carousel :autoplay="false">
<div :key="item.id" v-for="item in bannerLists">
<img :src="item.url" alt />
@ -42,4 +42,11 @@ export default {
};
</script>
<style lang="stylus" scoped></style>
<style lang="stylus" scoped>
.head {
background: white;
max-height: 400px;
overflow: hidden;
position: relative;
}
</style>

4
src/config/api.js

@ -15,6 +15,7 @@ const carousel = `${greenvalley}/carousel`; // 轮播图相关接口
const page = `${greenvalley}/page`; // 页面详情相关接口
const achInstr = `${greenvalley}/achInstr`; // 轮播图相关接口
const service = `${greenvalley}/service`; // 服务相关接口
const user = `${greenvalley}/user`; // 用户相关接口
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -80,3 +81,6 @@ export const selService = params => axios.post(`${greenvalley}/serviceProject/se
// 查询用户购物车
export const SearchCar = params => axios.post(`${service}/SearchCar`, params);
// 登录人信息
export const getUserSer = params => axios.post(`${user}/userSer`, params);

6
src/router/index.js

@ -223,6 +223,12 @@ const routes = [
name: 'Products',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/IncubationPlatform/Children/Products.vue'),
},
// 实体众创空间
{
path: '/IncubationPlatform/MakerSpace/EntitySpace',
name: 'EntitySpace',
component: () => import(/* webpackChunkName: "cooperative-enterprise" */ 'views/IncubationPlatform/Children/place/EntitySpace.vue'),
},
],
},
// 购物车

23
src/store/modules/home/actions.js

@ -1,6 +1,6 @@
import axios from 'axios';
import { message } from 'ant-design-vue';
import { industryInfo, front, getPageDetail, queryRotation, frontSearchCompany } from '@/config/api';
import { industryInfo, front, getPageDetail, queryRotation, frontSearchCompany, getUserSer } from '@/config/api';
const actions = {
/**
@ -118,6 +118,27 @@ const actions = {
throw error || '查询失败';
}
},
/**
* 获取登录人信息
* @param {any} commit
*/
async getUserSer({ commit }) {
try {
const params = { param: {} };
const res = await getUserSer(params);
const { code, msg, data } = res.data;
if (code === 200) {
console.log('setUserSer: ', data);
commit('setUserSer', data);
} else {
message.error(msg || '查询失败');
throw msg;
}
} catch (error) {
throw error || '查询失败';
}
},
};
export default actions;

9
src/store/modules/home/mutations.js

@ -1,5 +1,14 @@
import { List } from 'ant-design-vue';
const mutations = {
/**
* 设置登录人信息
* @param {object} state
* @param {object} userSer
*/
setUserSer(state, userSer) {
state.userSer = { ...userSer };
},
/**
* 获取显示政策的ID
* @param {object} state

1
src/store/modules/home/state.js

@ -1,4 +1,5 @@
const state = {
userSer: null, // 登录人信息
policyId: 0,
current: 1, // 政策当前处于第几页,默认1
comCurrent: 1, // 帖子列表当前处于第几页,默认1

21
src/views/Cart/Cart.vue

@ -45,7 +45,7 @@
</template>
<script>
import { mapState, mapMutations } from 'vuex';
import { mapState, mapMutations, mapActions } from 'vuex';
import BreadCrumb from 'components/BreadCrumb/BreadCrumb.vue';
import { SearchCar } from 'config/api';
@ -94,12 +94,25 @@ export default {
],
};
},
computed: mapState('home', []),
created() {
this.getData();
computed: mapState('home', ['userSer']),
async created() {
await this.getData();
await this.getUserSer();
if (this.userSer) {
if (this.userSer.name) {
this.name = this.userSer.name;
}
if (this.userSer.phone) {
this.company = this.userSer.phone;
}
if (this.userSer.companyName) {
this.company = this.userSer.companyName;
}
}
},
methods: {
...mapMutations('home', []),
...mapActions('home', ['getUserSer']),
//
async getData() {

16
src/views/IncubationPlatform/Children/MakerSpace.vue

@ -7,7 +7,7 @@
<div>
<div
:key="index"
@click="jump(item.url)"
@click="jump(item.url,item.type)"
style="margin-top: 50px; cursor: pointer"
v-for="(item, index) in list"
>
@ -53,7 +53,8 @@ export default {
'山西绿谷生物科技股份有限公司立足功能食品、生物医药和大健康产业,聚焦“创新”、聚力“孵化”、聚合“产业”,' +
'致力建设集创新链、孵化链和产业链为一体,产学研协同、多学科交叉、大中小企业...',
imgUrl: 'https://www.sxwikionline.com/gateway/greenvalley/uploads/upload/20210106/9059bddfe0254a269bf8f575c917b199.png',
url: '/NewPlatform/Share',
url: '/IncubationPlatform/MakerSpace/EntitySpace',
type: 1,
},
{
title: '虚拟空间',
@ -61,7 +62,8 @@ export default {
'山西绿谷生物科技股份有限公司立足功能食品、生物医药和大健康产业,聚焦“创新”、聚力“孵化”、聚合“产业”,' +
'致力建设集创新链、孵化链和产业链为一体,产学研协同、多学科交叉、大中小企业...',
imgUrl: 'https://www.sxwikionline.com/gateway/greenvalley/uploads/upload/20210106/73cba2c598e24bc99d4b988185138f44.png',
url: '/NewPlatform/Transfer',
url: '/IncubationPlatform/MakerSpace/EntitySpace',
type: 2,
},
{
title: '加入我们',
@ -69,14 +71,16 @@ export default {
'山西绿谷生物科技股份有限公司立足功能食品、生物医药和大健康产业,聚焦“创新”、聚力“孵化”、聚合“产业”,' +
'致力建设集创新链、孵化链和产业链为一体,产学研协同、多学科交叉、大中小企业...',
imgUrl: 'https://www.sxwikionline.com/gateway/greenvalley/uploads/upload/20210106/88a52985a48c4780a76507b06798b00f.png',
url: '/NewPlatform/Develop',
url: '',
type: 1,
},
],
};
},
methods: {
jump(url) {
this.$router.push(url);
jump(url, type) {
const { query } = this.$route;
this.$router.replace({ path: url, query: { type } });
},
},
};

208
src/views/IncubationPlatform/Children/ShareChild/Institute.vue

@ -1,208 +0,0 @@
<template>
<div>
<rotation />
<h-nav />
<div class="inner ins-box">
<p class="font-bold-24 item-title">设备列表</p>
<div class="d-flex flex-wrap">
<div v-for="(item, index) in list" :key="index" class="item-box" :class="(index + 1) % 4 === 0 ? 'margin-0' : ''">
<img :src="item.imgUrl" style="height: 220px; width: 100%; border: 1px solid #ccc" />
<p class="font-24 my-4">{{ item.name }}</p>
<p class="font-16 baseColor item-more" @click="jump(item.id)">了解更多</p>
</div>
</div>
<p class="font-bold-24 item-title">人才团队带头人情况</p>
<div class="d-flex">
<div class="header-box" style="flex: 1">
<p style="background: #11b7ce; color: #fff">姓名</p>
<p>性别</p>
<p>民族</p>
<p>出生年月</p>
<p>学历</p>
<p>职称</p>
<p>所学专业</p>
<p>从事专业</p>
<p>团队名称</p>
<p>工作单位</p>
<p>研究方向</p>
</div>
<div class="header-box" style="flex: 5; background: #fff">
<p style="border-bottom: 1px solid #eee">{{ obj.name }}</p>
<p><span v-if="obj.gender - 0 === 1">男</span> <span v-else-if="obj.gender - 0 === 2"></span></p>
<p>{{ obj.famousFamily }}</p>
<p>{{ obj.birthday }}</p>
<p>{{ obj.education }}</p>
<p>{{ obj.position }}</p>
<p>{{ obj.major }}</p>
<p>{{ obj.professional }}</p>
<p>{{ obj.teamName }}</p>
<p>{{ obj.workUnit }}</p>
<p>{{ obj.direction }}</p>
</div>
</div>
<p class="font-bold-24 item-title">团队成员信息</p>
<div style="background: #fff">
<div class="d-flex">
<div class="h-box" style="flex: 1">姓名</div>
<div class="h-box" style="flex: 1">性别</div>
<div class="h-box" style="flex: 1">所在单位</div>
<div class="h-box" style="flex: 1">出生年月</div>
<div class="h-box" style="flex: 1">学历学位</div>
<div class="h-box" style="flex: 1">职称职务</div>
<div class="h-box" style="flex: 1">研究方向</div>
</div>
<div class="d-flex" v-for="(item, index) in obj.teamMemberList" :key="index">
<div class="con-box" style="flex: 1">{{ item.name }}</div>
<div class="con-box" style="flex: 1">
<span v-if="item.gender - 0 === 1"></span>
<span v-else-if="item.gender - 0 === 2"></span>
</div>
<div class="con-box" style="flex: 1">???????????????</div>
<div class="con-box" style="flex: 1">{{ item.birthday }}</div>
<div class="con-box" style="flex: 1">{{ item.education }}</div>
<div class="con-box" style="flex: 1">{{ item.position }}</div>
<div class="con-box" style="flex: 1">{{ item.direction }}</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapMutations, mapState } from 'vuex';
import { selInstrumentByRes, teamSearch } from 'config/api';
import Rotation from 'components/Rotation/Rotation.vue';
import HNav from './../../components/HNav.vue';
export default {
name: 'Institute',
components: { Rotation, HNav },
data() {
return {
id: 0,
obj: {},
list: [],
};
},
computed: mapState('home', ['LabId']),
created() {
if (this.$route.params.id) {
this.setLabId(this.$route.params.id);
this.id = this.$route.params.id;
} else {
this.id = this.LabId;
}
this.getData();
this.getTeam();
},
methods: {
...mapMutations('home', ['setLabId']),
//
async getData() {
try {
const params = {
param: {
id: this.id,
pageNum: 1,
pageSize: 6,
},
};
const res = await selInstrumentByRes(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.list = data.list;
this.total = parseInt(data.total);
}
} catch (error) {
console.log(error);
}
},
//
async getTeam() {
try {
const params = { param: { instituteId: this.id } };
const res = await teamSearch(params);
const { code, msg, data } = res.data;
if (code === 200) {
this.obj = data[0];
}
} catch (error) {
console.log(error);
}
},
// /
jump(id) {
this.$router.push({
path: '/NewPlatform/Share/InsDet',
name: 'InsDet',
params: { id },
});
},
},
};
</script>
<style lang="stylus" scoped>
.ins-box {
min-height: 500px;
height: auto;
margin: 40px auto;
}
.pagination {
margin: 40px 0;
text-align: right;
}
.item-more {
right: 10px;
bottom: 0px;
cursor: pointer;
position: absolute;
}
.item-box {
position: relative;
width: 20.5%;
margin-right: 6%;
border-radius: 4px;
padding-bottom: 40px;
}
.margin-0 {
margin-right: 0 !important;
}
.item-title {
color: rgba(0, 0, 0, 0.85);
margin-top: 60px;
}
.header-box {
text-align: center;
p {
font-size: 24px;
color: rgba(0, 0, 0, 0.66);
height: 56px;
line-height: 56px;
margin-bottom: 0 !important;
}
}
.h-box {
text-align: center;
font-size: 22px;
color: #096DD9;
height: 56px;
line-height: 56px;
}
.con-box {
text-align: center;
font-size: 18px;
height: 46px;
line-height: 46px;
color: rgba(112, 112, 112, 0.66);
}
</style>

235
src/views/IncubationPlatform/Children/place/EntitySpace.vue

@ -0,0 +1,235 @@
<template>
<div>
<h-nav />
<div class="inner">
<bread-crumb :arr="arr" v-if="type === '1'" />
<bread-crumb :arr="arr1" v-else />
</div>
<div class="top-box" v-if="type === '1'">
<div class="top-title">实体众创空间</div>
<div class="top-content">
山西绿谷生物科技股份有限公司立足功能食品生物医药和大健康产业聚焦创新聚力孵化聚合产业
致力建设集创新链孵化链和产业链为一体产学研协同多学科交叉大中小企业融通
线上线下相结合的融合发展机制和开放式创新创业平台培育打造全链条一体化新型社会研发机构和创新创业生态系统
构筑专业化集群化园区化产业发展新模式和新业态公司秉持创新开放协同融合发展理
赋能健康中国筑梦绿色未来为愿景构建创新创业生态发展特色产业集群打造全链条一体化开放
式创新创业高地为使命大力推动建设共融共生共建 共创价值共同体
</div>
</div>
<div class="top-box" v-else>
<div class="top-title">虚拟众创空间</div>
<div class="top-content">
山西绿谷生物科技股份有限公司立足功能食品生物医药和大健康产业聚焦创新聚力孵化聚合产业
致力建设集创新链孵化链和产业链为一体产学研协同多学科交叉大中小企业融通
线上线下相结合的融合发展机制和开放式创新创业平台培育打造全链条一体化新型社会研发机构和创新创业生态系统
构筑专业化集群化园区化产业发展新模式和新业态公司秉持创新开放协同融合发展理
赋能健康中国筑梦绿色未来为愿景构建创新创业生态发展特色产业集群打造全链条一体化开放
式创新创业高地为使命大力推动建设共融共生共建 共创价值共同体
</div>
</div>
<div class="center-box" v-if="type === '1'">
<div class="center-title">
<div class="circular"></div>
<div style="margin-left: 40px">加入流程</div>
</div>
<div class="center-content">
山西绿谷生物科技股份有限公司立足功能食品生物医药和大健康产业聚焦创新聚力孵化聚合产业
致力建设集创新链孵化链和产业链为一体产学研协同多学科交叉大中小企业融通
线上线下相结合的融合发展机制和开放式创新创业平台培育打造全链条一体化新型社会研发机构和创新创业生态系统
构筑专业化集群化园区化产业发展新模式和新业态公司秉持创新开放协同融合发展理
赋能健康中国筑梦绿色未来为愿景构建创新创业生态发展特色产业集群打造全链条一体化开放
式创新创业高地为使命大力推动建设共融共生共建 共创价值共同体
</div>
<a-button class="center-btn" type="primary">申请加入</a-button>
</div>
<div class="center-box" v-else>
<div class="center-title">
<div class="circular"></div>
<div style="margin-left: 40px">加入流程</div>
</div>
<div class="center-content">
山西绿谷生物科技股份有限公司立足功能食品生物医药和大健康产业聚焦创新聚力孵化聚合产业
致力建设集创新链孵化链和产业链为一体产学研协同多学科交叉大中小企业融通
线上线下相结合的融合发展机制和开放式创新创业平台培育打造全链条一体化新型社会研发机构和创新创业生态系统
构筑专业化集群化园区化产业发展新模式和新业态公司秉持创新开放协同融合发展理
赋能健康中国筑梦绿色未来为愿景构建创新创业生态发展特色产业集群打造全链条一体化开放
式创新创业高地为使命大力推动建设共融共生共建 共创价值共同体
</div>
<a-button class="center-btn" type="primary">申请加入</a-button>
</div>
<div class="center-box c-box" style="margin-bottom: 160px">
<div class="center-title">
<div class="circular"></div>
<div style="margin-left: 40px">入驻企业名录</div>
</div>
<div class="center-content" v-if="type === '1'">
<div class="d-flex flex-wrap">
<div
:class="(index + 1) % 3 === 0 ? 'margin-0' : ''"
:key="index"
class="ent-box"
v-for="(item, index) in lists"
>
<p class="ent-index">{{ index + 1 }}</p>
<span class="ent-name" style="margin-left: 50px">{{ item }}</span>
</div>
</div>
</div>
<div class="center-content" v-else>
<div class="d-flex flex-wrap">
<div
:class="(index + 1) % 3 === 0 ? 'margin-0' : ''"
:key="index"
class="ent-box"
v-for="(item, index) in lists1"
>
<p class="ent-index">{{ index + 1 }}</p>
<span class="ent-name" style="margin-left: 50px">{{ item }}</span>
</div>
</div>
</div>
<div class="reg-box">
<a-button class style="float: left" type="primary">入驻企业注册</a-button>
<a-pagination
:current="current"
:page-size="pageSize"
:total="total"
@change="onShowSizeChange"
class="pagination"
show-less-items
show-quick-jumper
/>
</div>
</div>
</div>
</template>
<script>
import HNav from '../../components/HNav.vue';
import BreadCrumb from 'components/BreadCrumb/BreadCrumb.vue';
export default {
name: 'EntitySpace',
components: { HNav, BreadCrumb },
data() {
return {
title: '实体众创空间',
arr: [
{ name: '孵化平台', url: '/IncubationPlatform/MakerSpace' },
{ name: '众创空间', url: '/IncubationPlatform/MakerSpace' },
{ name: '实体众创空间', url: '' },
],
arr1: [
{ name: '孵化平台', url: '/IncubationPlatform/MakerSpace' },
{ name: '众创空间', url: '/IncubationPlatform/MakerSpace' },
{ name: '虚拟众创空间', url: '' },
],
type: '1',
list: [],
pageSize: 20,
total: 20,
current: 1,
lists: ['XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业'],
lists1: ['XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业', 'XX企业'],
};
},
created() {
const { query } = this.$route;
this.type = query.type;
},
methods: {
//
onShowSizeChange(current, size) {
this.current = current;
},
},
};
</script>
<style lang="stylus" scoped>
.inner {
margin: 10px auto 15px;
}
.center-btn {
position: absolute;
left: 26.2%;
bottom: 100px;
}
.pagination {
float: right;
}
.c-box {
background: none !important;
}
.big-btn {
width: 213px;
height: 166px;
background: #13ACC4;
opacity: 1;
}
.big-con {
width: 96px;
height: 31px;
font-size: 24px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 31px;
color: #FFFFFF;
opacity: 1;
}
.margin-0 {
margin-right: 0 !important;
}
.ent-box {
width: 26%;
margin-right: 11%;
position: relative;
height: 56px;
line-height: 56px;
padding: 0 14px;
background: #FFFFFF;
box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16);
opacity: 1;
margin-bottom: 20px;
}
.ent-index {
width: 28px;
position: absolute;
top: 14px;
line-height: 28px;
text-align: center;
font-size: 20px;
font-family: Segoe UI;
color: #FFFFFF;
height: 28px;
border-radius: 50%;
background: #13ACC4;
margin-bottom: 0;
}
.ent-name {
font-size: 20px;
font-family: Microsoft YaHei;
font-weight: bold;
line-height: 24px;
color: rgba(0, 0, 0, 0.65);
opacity: 1;
}
.reg-box {
position: absolute;
left: 26.2%;
bottom: 100px;
width: 64.8%;
overflow: hidden;
}
</style>

2
src/views/IncubationPlatform/components/HNav.vue

@ -18,7 +18,7 @@ export default {
list: [
{
title: '众创空间',
url: '/IncubationPlatform/IncubationPlatform',
url: '/IncubationPlatform/MakerSpace',
},
{
title: '公共实验室',

Loading…
Cancel
Save