Commit 63a69bf9 by 林家欣

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

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