Skip to content

Commit

Permalink
修改mip-tnm-shell组件栏目分类跳转链接 (#503)
Browse files Browse the repository at this point in the history
* .

* .

* .

* .

* .less

* 修改mip-tnm-shell/mip-tnm-shell.less文件

* 修改mip-tnm-shell/mip-tnm-shell.less文件缩进

* 修改mip-tnm-newscaro轮播图接口

* 新增组件mip-tnm-provdtab

* 1.新增组件mip-tnm-provdtab2.新增组件mip-tnm-accordion3.新增组件mip-tnm-prosortlist4.mip-tnm-newssortlist5.新增组件mip-tnm-videosortlist6.新增组件mip-tnm-downsortlist7.修改mip-tnm-shell8.修改mip-tnm-newscaro

* 1.修改接口为可变的,不放在配置文件里,方便修改

* 修改mip-tnm-shell README.md

* 新增组件mip-tnm-banner

* 1.mip-tnm-indexmenu菜单列表组件新增

* 修改mip-tnm-shell分类链接的栏目从本来固定为product.html页面为相应的栏目类型
  • Loading branch information
FeliciaLFF authored and chenqiushi committed Jan 17, 2019
1 parent 8f75277 commit f893ff0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Expand Up @@ -15,8 +15,6 @@ export default class Header {
}
// 首页链接 栏目链接
setCustomHeader (homeUrl, nmsorttitleUrl) {
console.log(nmsorttitleUrl)
// const nmsorttitleUrl="https://testnewmoudle7.no2.35nic.com/open_webapi/MofineApi.asmx/GetSysNMSortList?menuIndexVar=" + getUrlParams().menuIndexVar + "&editionId=" + getUrlParams().editionId + "&parentId=" + getUrlParams().parentId
fetch(nmsorttitleUrl + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&parentId=' + getUrlParams().parentId).then(response => {
if (response.ok) {
return response.json()
Expand Down Expand Up @@ -55,7 +53,20 @@ export default class Header {
const sortBoxItemEle = document.createElement('a')
sortBoxItemEle.className = 'sort-box-item'
sortBoxItemEle.setAttribute('data-title', array[index].sortName)
sortBoxItemEle.setAttribute('href', '/mip/templates/default/products.html?menuIndexVar=' + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&sortId=' + array[index].mnSortId + '&intSta=0&intNum=' + getUrlParams().intNum)
let url = window.location.href.toString()
let x = url.split('/')
let y = x[x.length - 1].split('.')[0]
if (y.indexOf('mip-tnm-shell') > -1) {
sortBoxItemEle.setAttribute('href', '/mip/templates/default/downs.html?menuIndexVar=' + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&sortId=0_' + array[index].mnSortId + '&intSta=0&intNum=' + getUrlParams().intNum)
} else if (y.indexOf('products') > -1) {
sortBoxItemEle.setAttribute('href', '/mip/templates/default/products.html?menuIndexVar=' + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&sortId=0_' + array[index].mnSortId + '&intSta=0&intNum=' + getUrlParams().intNum)
} else if (y.indexOf('news') > -1) {
sortBoxItemEle.setAttribute('href', '/mip/templates/default/news.html?menuIndexVar=' + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&sortId=0_' + array[index].mnSortId + '&intSta=0&intNum=' + getUrlParams().intNum)
} else if (y.indexOf('jobs') > -1) {
sortBoxItemEle.setAttribute('href', '/mip/templates/default/jobs.html?menuIndexVar=' + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&sortId=0_' + array[index].mnSortId + '&intSta=0&intNum=' + getUrlParams().intNum)
} else if (y.indexOf('videos') > -1) {
sortBoxItemEle.setAttribute('href', '/mip/templates/default/videos.html?menuIndexVar=' + getUrlParams().menuIndexVar + '&editionId=' + getUrlParams().editionId + '&sortId=0_' + array[index].mnSortId + '&intSta=0&intNum=' + getUrlParams().intNum)
}
sortBoxItemEle.innerHTML = array[index].sortName
toggleSortEle.appendChild(sortBoxItemEle)
})
Expand Down
Expand Up @@ -36,7 +36,6 @@ export default class MIPTestnewmoudleShell extends window.MIP.builtinComponents.
}
_initAllObjects () {
let configMeta = this.currentPageMeta
console.log(configMeta.header.nmsorttitleUrl)
const isIndex = this.currentPageMeta.view.isIndex
this.header = new Header(this.$el);
(!isIndex) && this.header.setCustomHeader(configMeta.header.homeUrl, configMeta.header.nmsorttitleUrl)
Expand Down

0 comments on commit f893ff0

Please sign in to comment.