Commit 63a69bf9 by 林家欣

修改服务中心服务商列表、案例介绍点击详情页数据获取接口

parent 9d540db0
import {
POST
POST,
} from "../fetch.js"
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
......@@ -21,8 +21,20 @@ const serviceCasesFrontList = (params = {}) => {
}
// 案例介绍根据id获取详情
const serviceGetCaseDetailInfo = (params = {}) => {
return POST(`${Prefix}/office/cases/api/getDetailInfo`, params)
}
// 案例介绍根据id获取详情
const serviceGetPartnersDetailInfo = (params = {}) => {
return POST(`${Prefix}/office/partners/api/getDetailInfo`, params)
}
export default {
getCodeBook,
servicePartnersFrontList,
serviceCasesFrontList,
serviceGetCaseDetailInfo,
serviceGetPartnersDetailInfo,
}
......@@ -46,7 +46,6 @@
</template>
<script>
import {mapMutations} from "vuex";
import pages from "../../comps/pages2.vue";
export default {
......@@ -84,17 +83,15 @@ export default {
this.casesFrontList();
},
methods: {
...mapMutations("service", {
setPartnersMsg: "setPartnersMsg",
}),
// 点击列表跳转详情
handelJumpMsg(msg) {
const prefix = 'http://www.gs1cn.org'
msg.brief = msg.brief.replace(new RegExp('src="/UserFiles/Image', 'g'), `src="${prefix}/UserFiles/Image`);
this.setPartnersMsg(msg);
this.$router.push({
let routeData = this.$router.resolve({
path: "/Service/Partners/caseMsg",
query: {
id: msg.id
}
});
window.open(routeData.href, "_blank");
},
// 接收分页子组件传过来的值
receivePagesChild(val) {
......@@ -112,9 +109,8 @@ export default {
const serviceCasesFrontListRes =
await this.$api.service.serviceCasesFrontList(params);
const {success, data} = serviceCasesFrontListRes;
console.log(serviceCasesFrontListRes, "serviceCasesFrontListRes");
console.log(serviceCasesFrontListRes, "案例介绍");
if (success) {
console.log(data, "案例介绍");
this.pageParams.total = data.totalCount;
this.list = data.list;
}
......
......@@ -17,16 +17,14 @@
</template>
<script>
import {mapState} from "vuex";
export default {
computed: {
...mapState("service", {
partnersMsg: "partnersMsg",
}),
data() {
return {
partnersMsg: {},
}
},
created() {
console.log("TODO QUERY", this.$route.query, this.partnersMsg);
this.serviceGetCaseDetailInfo();
},
mounted() {
// 面包屑单独处理
......@@ -36,7 +34,20 @@ export default {
{name: "GS1标准服务提供商案例"},
]);
},
methods: {},
methods: {
async serviceGetCaseDetailInfo() {
const query = {
id: this.$route.query.id,
}
const serviceGetCaseDetailInfoRes =
await this.$api.service.serviceGetCaseDetailInfo(query);
const { returnCode, data } = serviceGetCaseDetailInfoRes;
console.log(serviceGetCaseDetailInfoRes, "serviceGetCaseDetailInfoRes");
if (returnCode === "0") {
this.partnersMsg = data;
}
},
},
};
</script>
......
......@@ -2,7 +2,7 @@
<div class="msg-cont">
<div class="container">
<div class="msg-title">
{{ partnersMsg.title }}
{{ partnersMsg.firmname }}
</div>
<div class="msg-head">
<div class="msg-head-left">
......@@ -26,7 +26,7 @@
<div class="col-md-6">
<i class="iconfont icon-lianxiren"></i
><span style="font-size: 14px; color: #666; margin-left: 6px"
>联系人:<span id="Lab_name">{{ partnersMsg.firmname }}</span></span
>联系人:<span id="Lab_name">{{ partnersMsg.name }}</span></span
>
</div>
<div class="col-md-6">
......@@ -48,16 +48,14 @@
</template>
<script>
import { mapState } from "vuex";
export default {
computed: {
...mapState("service", {
partnersMsg: "partnersMsg",
}),
data() {
return {
partnersMsg: {},
}
},
created() {
console.log("TODO QUERY", this.$route.query, this.partnersMsg);
this.serviceGetPartnersDetailInfo();
},
mounted() {
// 面包屑单独处理
......@@ -67,7 +65,20 @@ export default {
{ name: "服务提供商介绍" },
]);
},
methods: {},
methods: {
async serviceGetPartnersDetailInfo() {
const query = {
id: this.$route.query.id,
}
const serviceGetPartnersDetailInfoRes =
await this.$api.service.serviceGetPartnersDetailInfo(query);
const { returnCode, data } = serviceGetPartnersDetailInfoRes;
console.log(serviceGetPartnersDetailInfoRes, "serviceGetPartnersDetailInfoRes");
if (returnCode === "0") {
this.partnersMsg = data;
}
},
},
};
</script>
......@@ -140,7 +151,7 @@ export default {
padding-top: 6px;
padding-bottom: 6px;
}
i{
i {
color: #aaa;
}
}
......
......@@ -64,7 +64,6 @@
</template>
<script>
import { mapMutations } from "vuex";
import pages from "../../comps/pages2.vue";
export default {
......@@ -111,15 +110,15 @@ export default {
this.partnersFrontList();
},
methods: {
...mapMutations("service", {
setPartnersMsg: "setPartnersMsg",
}),
// 点击列表跳转详情
handelJumpMsg(msg) {
this.setPartnersMsg(msg);
this.$router.push({
let routeData = this.$router.resolve({
path: "/Service/Partners/content",
query: {
id: msg.id
}
});
window.open(routeData.href, "_blank");
},
// 接收分页子组件传过来的值
receivePagesChild(val) {
......@@ -137,9 +136,8 @@ export default {
const businessGetPlanBranchListRes =
await this.$api.service.servicePartnersFrontList(params);
const { success, data } = businessGetPlanBranchListRes;
console.log(businessGetPlanBranchListRes, "businessGetPlanBranchListRes");
console.log(businessGetPlanBranchListRes, "服务商列表");
if (success) {
console.log(data, "服务商列表");
this.pageParams.total = data.totalCount;
this.list = data.list;
this.list.forEach(el => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment