Browse Source

购物车接口

master
lucky 5 years ago
parent
commit
f067c2dc72
  1. 10
      src/config/api.js
  2. 23
      src/views/Cart/Cart.vue

10
src/config/api.js

@ -14,6 +14,7 @@ const Business = `${greenvalley}/Business`; // 衍生企业和合作伙伴查询
const carousel = `${greenvalley}/carousel`; // 轮播图相关接口
const page = `${greenvalley}/page`; // 页面详情相关接口
const achInstr = `${greenvalley}/achInstr`; // 轮播图相关接口
const service = `${greenvalley}/service`; // 服务相关接口
// websocket基础地址
export const WS_BASE_URL = msgUrl;
@ -53,14 +54,21 @@ export const frontSearchCompany = params => axios.post(`${Business}/FrontSearchC
// 介绍页面详情查询
export const getPageDetail = params => axios.post(`${page}/detail`, params);
export const FrontSearchCompany = params => axios.post(`${Business}/FrontSearchCompany`, params);
// 分类查询
export const selModel = params => axios.post(`${achInstr}/selModel`, params);
// 仪器列表查询
export const selInstrument = params => axios.post(`${achInstr}/selInstrument`, params);
// 研究院(实验室)列表查询
export const searchFront = params => axios.post(`${greenvalley}/institute/searchFront`, params);
// 成果列表查询
export const selRes = params => axios.post(`${achInstr}/selRes`, params);
// 成果详情查询
export const selResMes = params => axios.post(`${achInstr}/selResMes`, params);
// 查询用户购物车
export const SearchCar = params => axios.post(`${service}/SearchCar`, params);

23
src/views/Cart/Cart.vue

@ -47,7 +47,7 @@
<script>
import { mapState, mapMutations } from 'vuex';
import BreadCrumb from 'components/BreadCrumb/BreadCrumb.vue';
import { front } from 'config/api';
import { SearchCar } from 'config/api';
export default {
name: 'Cart',
@ -95,20 +95,22 @@ export default {
};
},
computed: mapState('home', []),
created() {},
created() {
this.getData();
},
methods: {
...mapMutations('home', []),
//
async getData() {
try {
this.setActIpCon(this.iptCon);
const params = { param: {} };
// const res = await front(params);
// const { data, msg, code } = res.data;
// if (code === 200) {
// this.lists = data.list;
// this.total = parseInt(data.total);
// }
const params = { param: { pageNum: 1, pageSize: 10 } };
const res = await SearchCar(params);
const { data, msg, code } = res.data;
if (code === 200) {
console.log('data: ', data);
// this.lists = data.list;
}
} catch (error) {
console.log(error);
}
@ -117,7 +119,6 @@ export default {
//
jumpDetails(item) {
console.log('item: ', item);
// this.$router.push('/ActDetails');
},
},
};

Loading…
Cancel
Save