Commit 9e1e6ab8 by Jianli Ou

境外条码查询 链接至其他网站增加 企业首页

parent c84c8975
......@@ -105,8 +105,15 @@
<p style="font-size:13px;margin:15px 0 0 0 ;">该数据由Active Test Account企业提供,并于2023年5月2日最新更新</p>
<p style="font-size:13px;">该GTIN信息完整</p>
</div>
<div v-if="GtinResultData.linkset" class="hrefInfo ">
<div v-if="GtinResultData.linkset && (GtinResultData.links.homepage || GtinResultData.links.hasRetailers || GtinResultData.links.sustainabilityInfo || GtinResultData.links.productSustainabilityInfo || GtinResultData.links.recipeInfo)" class="hrefInfo ">
<p>链接至其他产品信息</p>
<div v-if="GtinResultData.links.homepage" class="hrefInfoList">
<p>企业网站</p>
<div v-for="(link, index) in GtinResultData.links.homepage" :key="index" class="hrefInfoList-list">
<p><span @click="openHref(link.href)">{{link.title}}</span><span>{{link.type}}</span></p>
<P>语言:{{link.hreflang}}</P>
</div>
</div>
<div v-if="GtinResultData.links.hasRetailers" class="hrefInfoList">
<p>有零售商</p>
<div v-for="(link, index) in GtinResultData.links.hasRetailers" :key="index" class="hrefInfoList-list">
......@@ -391,6 +398,11 @@
<p style="font-size:13px;color:#696D73;margin-top:15px">该数据由GS1 Demo Account企业提供,并于2023年5月2日最新更新</p>
</el-collapse-item>
<el-collapse-item title="链接至其他信息" name="4">
<p v-if="glnResultData.links.homepage">企业网站</p>
<div v-for="(link, index) in glnResultData.links.homepage" :key="index" class="hrefInfoList-list">
<p><span @click="openHref(link.href)">{{link.title}}</span><span>{{link.type}}</span></p>
<P>语言:{{link.hreflang}}</P>
</div>
<p style="font-size:16px;color:#002C6C;">有零售商</p>
<div v-for="(link, index) in glnResultData.links.hasRetailers" :key="index">
<p><span @click="openHref(link.href)" style="color:#00799E; cursor: pointer;">{{link.title}}</span><span style="color:#F26335;margin-left:8px">{{link.type}}</span></p>
......@@ -768,6 +780,7 @@ export default {
if (returnCode === "0") {
if (data) {
data[0].links = {
homepage: '', // 企业网站
hasRetailers: '', // 有零售商
sustainabilityInfo: '', // 产品信息页
productSustainabilityInfo: '', // 可持续性和回收(不建议使用)
......@@ -778,7 +791,11 @@ export default {
const linkDataStructure = (linkObj) => {
return { href: linkObj.href, hreflang: linkObj.hreflang[0], title: linkObj.title, type: linkObj.type }
}
if (item.indexOf('hasRetailers') >= 0) {
if (item.indexOf('homepage') >= 0) {
data[0].links.homepage = data[0].linkset[item].map(linkObj => {
return linkDataStructure(linkObj)
})
} else if (item.indexOf('hasRetailers') >= 0) {
data[0].links.hasRetailers = data[0].linkset[item].map(linkObj => {
return linkDataStructure(linkObj)
})
......@@ -842,6 +859,7 @@ export default {
})
}
data[0].links = {
homepage: '', // 企业网站
hasRetailers: '', // 有零售商
sustainabilityInfo: '', // 产品信息页
productSustainabilityInfo: '', // 可持续性和回收(不建议使用)
......@@ -852,7 +870,11 @@ export default {
const linkDataStructure = (linkObj) => {
return { href: linkObj.href, hreflang: linkObj.hreflang[0], title: linkObj.title, type: linkObj.type }
}
if (item.indexOf('hasRetailers') >= 0) {
if (item.indexOf('homepage') >= 0) {
data[0].links.homepage = data[0].linkset[item].map(linkObj => {
return linkDataStructure(linkObj)
})
} else if (item.indexOf('hasRetailers') >= 0) {
data[0].links.hasRetailers = data[0].linkset[0][item].map(linkObj => {
return linkDataStructure(linkObj)
})
......
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