Commit 15cb459e by 林家欣

联调常见问题列表

parent be95e227
...@@ -2,4 +2,5 @@ VUE_APP_CURRENTMODE = "development" ...@@ -2,4 +2,5 @@ VUE_APP_CURRENTMODE = "development"
VUE_APP_HOST_URL = "http://81.68.189.225:9091" VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "/" VUE_APP_API_URL = "/"
VUE_APP_GDS_URL = "/gds" VUE_APP_GDS_URL = "/gds"
VUE_APP_FAQ_URL = "http://member.gds.org.cn:8080/chinatm"
VUE_APP_LOG = true VUE_APP_LOG = true
\ No newline at end of file
...@@ -61,7 +61,7 @@ function fetch(options) { ...@@ -61,7 +61,7 @@ function fetch(options) {
const resData = res.data; const resData = res.data;
const code = String(resData.code) const code = String(resData.code)
// console.log(resData, ResponseCode.success, 'ResponseCode.success'); // console.log(resData, ResponseCode.success, 'ResponseCode.success');
if (code === ResponseCode.success) { if (ResponseCode.success.indexOf(code) !== -1) {
// console.log(resData, '响应数据的拦截2'); // console.log(resData, '响应数据的拦截2');
resolve(resData) resolve(resData)
} else if (checkResponseCodeTokenError(code)) { } else if (checkResponseCodeTokenError(code)) {
......
import { import {
GET,
POST POST
} from "../fetch.js" } from "../fetch.js"
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : ''; const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
const Prefix2 = process.env.NODE_ENV === 'development' ? '/chinatm' : '';
// 右侧表格下载功能 // 右侧表格下载功能
const businessDownLoad = (params = {}) => { const businessDownLoad = (params = {}) => {
...@@ -25,9 +27,15 @@ const businessGetDetailById = (params = {}) => { ...@@ -25,9 +27,15 @@ const businessGetDetailById = (params = {}) => {
return POST(`${Prefix}/office/eanupc/api/getDetailById`, params) return POST(`${Prefix}/office/eanupc/api/getDetailById`, params)
} }
// 常见问题
const businessGetFaqListByTypeName = (params = {}) => {
return GET(`${Prefix2}/tm/faq/third/getFaqListByTypeName`, params)
}
export default { export default {
businessDownLoad, businessDownLoad,
businessGetTop4, businessGetTop4,
businessGetEanUpcByCondition, businessGetEanUpcByCondition,
businessGetDetailById, businessGetDetailById,
businessGetFaqListByTypeName,
} }
...@@ -38,7 +38,7 @@ export function cleanArray(actual) { ...@@ -38,7 +38,7 @@ export function cleanArray(actual) {
export const REQUEST_HEADER_TOKEN = "token" export const REQUEST_HEADER_TOKEN = "token"
export const ResponseCode = { export const ResponseCode = {
success: "0", success: ['0', '200'],
tokenError: "0202", tokenError: "0202",
tokenEmpty: "0203", tokenEmpty: "0203",
...@@ -68,8 +68,8 @@ export function handleResponseSuccess(res = {}) { ...@@ -68,8 +68,8 @@ export function handleResponseSuccess(res = {}) {
return { return {
success: true, success: true,
returnCode: res.code || ResponseCode.success, returnCode: res.code || ResponseCode.success,
returnMsg: res.msg, returnMsg: res.msg || "请求成功",
data: res.data || res.page || null data: res.data || res.page || res.member || null
} }
} }
...@@ -77,7 +77,7 @@ export function handleResponseError(res = {}) { ...@@ -77,7 +77,7 @@ export function handleResponseError(res = {}) {
return { return {
success: false, success: false,
returnCode: res.code || ResponseCode.failed, returnCode: res.code || ResponseCode.failed,
returnMsg: res.msg || "", returnMsg: res.msg || "请求失败",
data: res.data || null data: res.data || null
} }
} }
...@@ -95,7 +95,7 @@ export default { ...@@ -95,7 +95,7 @@ export default {
return ( return (
<div class={classNames.join(" ").trim()} style={items[0].style}> <div class={classNames.join(" ").trim()} style={items[0].style}>
{items.map((item) => { {items.map((item) => {
console.log(item.isHiddenMenu, 'item.isHiddenMenu'); // console.log(item.isHiddenMenu, 'item.isHiddenMenu');
if (item.isHiddenMenu) return if (item.isHiddenMenu) return
return ( return (
<div class="gs-dropdown-item"> <div class="gs-dropdown-item">
......
...@@ -39,7 +39,11 @@ ...@@ -39,7 +39,11 @@
:aria-labelledby="tmp.type + '-tab'" :aria-labelledby="tmp.type + '-tab'"
> >
<faqTable :list="tmp.data" /> <faqTable :list="tmp.data" />
<pages /> <pages
:currPage="pageParams.currPage"
:total="pageParams.total"
@getLimit="receivePagesChild"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -63,20 +67,22 @@ export default { ...@@ -63,20 +67,22 @@ export default {
ico: "", ico: "",
}, },
search: { search: {
typeName: "",
keywords: "", keywords: "",
}, },
pageParams: {
currPage: 1,
pageSize: 10,
pageCount: 5,
total: 0,
},
list: [ list: [
{ {
type: "qbwt", type: "qbwt",
name: "全部问题", name: "全部问题",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "qbwt", active: "qbwt",
data: [ data: [],
{
name: "企业申请注册厂商识别代码是否必须到中国物品编码中心总部办理?",
type: "业务办理",
},
],
}, },
{ {
type: "ywbl", type: "ywbl",
...@@ -95,72 +101,42 @@ export default { ...@@ -95,72 +101,42 @@ export default {
name: "产品信息通报", name: "产品信息通报",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "cpxxtb", active: "cpxxtb",
data: [ data: [],
{
name: "企业申请注册厂商识别代码后,中国物品编码中心会发放哪些材料?",
type: "业务办理",
},
],
}, },
{ {
type: "bmjs", type: "bmjs",
name: "编码技术", name: "编码技术",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "bmjs", active: "bmjs",
data: [ data: [],
{
name: "编码技术?",
type: "业务办理",
},
],
}, },
{ {
type: "fgybz", type: "fgybz",
name: "法规与标准", name: "法规与标准",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "fgybz", active: "fgybz",
data: [ data: [],
{
name: "法规与标准标题?",
type: "业务办理",
},
],
}, },
{ {
type: "tmzl", type: "tmzl",
name: "条码质量", name: "条码质量",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "tmzl", active: "tmzl",
data: [ data: [],
{
name: "条码质量标题?",
type: "业务办理",
},
],
}, },
{ {
type: "tmjsyy", type: "tmjsyy",
name: "条码技术应用", name: "条码技术应用",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "tmjsyy", active: "tmjsyy",
data: [ data: [],
{
name: "条码技术应用标题?",
type: "业务办理",
},
],
}, },
{ {
type: "other", type: "other",
name: "其他", name: "其他",
link: "/Business/Guide8", link: "/Business/Guide8",
active: "other", active: "other",
data: [ data: [],
{
name: "其他标题?",
type: "业务办理",
},
],
}, },
], ],
}; };
...@@ -177,7 +153,46 @@ export default { ...@@ -177,7 +153,46 @@ export default {
return id; return id;
}, },
}, },
watch: {
$route: {
handler(val) {
this.init(val.query.id);
},
deep: true,
immediate: true,
},
},
methods: { methods: {
init(id) {
const current = this.list.filter((item) => item.active === id)[0];
this.search.typeName = current.name;
this.getFaqListByTypeName();
},
// 接收分页子组件传过来的值
receivePagesChild(val) {
this.pageParams.currentPage = val;
this.getFaqListByTypeName();
},
// 常见问题
async getFaqListByTypeName() {
const params = {
typeName: this.search.typeName,
pageNo: this.pageParams.currPage,
pageSize: this.pageParams.pageSize,
};
const businessGetFaqListByTypeNameRes =
await this.$api.business.businessGetFaqListByTypeName(params);
const { returnCode, data } = businessGetFaqListByTypeNameRes;
if (returnCode === 200) {
console.log(businessGetFaqListByTypeNameRes, "常见问题");
this.pageParams.total = data.totalRows;
this.list.forEach((el) => {
if (el.active === this.$route.query.id) {
el.data = data.rows;
}
});
}
},
jump(i) { jump(i) {
// console.log(i); // console.log(i);
this.$router.push({ this.$router.push({
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
:aria-labelledby="tmp.type + '-tab'" :aria-labelledby="tmp.type + '-tab'"
> >
<list :list="tmp.data" @toListFather="receiveListChild" /> <list :list="tmp.data" @toListFather="receiveListChild" />
<pages :pages="pageParams" @toPagesFather="receivePagesChild" /> <pages :currPage="pageParams.currPage" :total="pageParams.total" @getLimit="receivePagesChild"/>
</div> </div>
</div> </div>
</div> </div>
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
}, },
], ],
pageParams: { pageParams: {
currentPage: 1, currPage: 1,
pageSize: 10, pageSize: 10,
pageCount: 5, pageCount: 5,
total: 100, total: 100,
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
// 条码注册/注销公告 // 条码注册/注销公告
async businessGetEanUpcByCondition() { async businessGetEanUpcByCondition() {
const params = { const params = {
page: this.pageParams.currentPage, page: this.pageParams.currPage,
limit: this.pageParams.pageSize, limit: this.pageParams.pageSize,
logoutFlag: this.logoutFlag, logoutFlag: this.logoutFlag,
}; };
...@@ -142,7 +142,7 @@ export default { ...@@ -142,7 +142,7 @@ export default {
}, },
// 接收分页子组件传过来的值 // 接收分页子组件传过来的值
receivePagesChild(val) { receivePagesChild(val) {
this.pageParams.currentPage = val; this.pageParams.currPage = val;
this.businessGetEanUpcByCondition(); this.businessGetEanUpcByCondition();
}, },
// 接收列表子组件传过来的值 // 接收列表子组件传过来的值
......
...@@ -5,18 +5,18 @@ ...@@ -5,18 +5,18 @@
<div class="col-lg-8">标题</div> <div class="col-lg-8">标题</div>
<div class="col-lg-2">类型</div> <div class="col-lg-2">类型</div>
</div> </div>
<div class="fqtbody "> <div class="fqtbody" v-if="list.length > 0">
<div class="row" v-for="(tmp, i) in list" :key="i"> <div class="row" v-for="(tmp, i) in list" :key="i">
<div class="col-lg-2">{{i+1}}</div> <div class="col-lg-2">{{i+1}}</div>
<div class="col-lg-8">{{tmp.name}}</div> <div class="col-lg-8">{{tmp.name}}</div>
<div class="col-lg-2">{{tmp.type}}</div> <div class="col-lg-2">{{ tmp.types && tmp.types.name}}</div>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: ['list'] props: ['list'],
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -70,6 +70,14 @@ module.exports = { ...@@ -70,6 +70,14 @@ module.exports = {
pathRewrite: { pathRewrite: {
"^/gds": "/" "^/gds": "/"
} }
},
"/chinatm": {
target: 'http://member.gds.org.cn:8080/chinatm', // 原地址
changeOrigin: true,
ws: true,
pathRewrite: {
"^/chinatm": "/"
}
} }
} }
} }
......
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