Commit 2470cdaa by 高淑倩

plus(9/5-权重高)

parent 5208abdd
......@@ -15,14 +15,14 @@ wxService.page({
* 页面的初始数据
*/
data: {
pages:[],
pages: [],
render: null, // 渲染页面数据对象(安全渲染)
renderPageOver: false, // 渲染页面结束
integralNum: 0,
couponNum: 0,
// isAllScreen: fullSucreen.isAllScreen
isAllScreen: config.isAllScreen,
token:'',
token: '',
isAuthorization: false,
pageId: 3,
baseUserInfo: null,
......@@ -34,7 +34,7 @@ wxService.page({
/**
* 生命周期函数--监听页面加载
*/
onLoad () {
onLoad() {
// 设置 导航栏背景颜色
// wxService.getNavBarBackGroundColor('#000000', '#ff0000')
this.setData(
......@@ -59,50 +59,50 @@ wxService.page({
},
/**
* 监听子组件事件
* */
* */
updatePage(ev) {
const {pageId} = ev.detail
const { pageId } = ev.detail
// this.setData({
// pages: [],
// pageId
// },()=>{
// this.initPage(pageId)
// })
wxService.router(`/subPackage/page/pages/subPage/subPage`).search({pageId})
wxService.router(`/subPackage/page/pages/subPage/subPage`).search({ pageId })
},
/**
* 生命周期函数--监听页面显示
*/
onShow () {
onShow() {
// 取会员卡号
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
const cardMember = wx.getStorageSync('_cardMember')
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
if (baseUserInfo && !reLoginErrFlag){
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
token: wx.getStorageSync('token'),
baseUserInfo,
cardMember,
isAuthorization: false
},()=>{
}, () => {
// 积分数量
// this.getMemberPointInfo()
// 优惠券数量
// this.getMemberCouponInfo()
})
}
else if(!baseUserInfo && reLoginErrFlag){
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
}
})
}
else {
this.setData({
isAuthorization: true
})
}
// if (baseUserInfo){
// this.setData({
// token: wx.getStorageSync('token'),
......@@ -121,7 +121,7 @@ wxService.page({
// })
// }
// 获取手机信息
wxService.getSystemInfo().then(res=> {
wxService.getSystemInfo().then(res => {
this.setData({
outoHeigth: res.windowHeight
})
......@@ -136,7 +136,7 @@ wxService.page({
},
// page 信息
initPage(pageId){
initPage(pageId) {
this.setData({
products: []
})
......@@ -145,9 +145,9 @@ wxService.page({
})
// wxService.post(`/merchant/modelPage/getDetailById?pageId=${pageId}&brandId=${app.globalData.brandId}`).then(res => {
wxService.post(`/merchant/modelPage/mainSetting?brandId=${app.globalData.brandId}`).then(res => {
if(!res) return false
const {result,data} = res.data
if(result == 0){
if (!res) return false
const { result, data } = res.data
if (result == 0) {
this.setData({
pageBackgroundColor: data.page.backgroundColor || 0
})
......@@ -160,31 +160,14 @@ wxService.page({
this.setData({
currHomePageId: data.page.pageId
})
// tabBar
// const currentTabBar = data.paragraphs.filter(item=> item.type == 5)
// let currentTabBarRedirectIdArr = []
// currentTabBar.forEach(tab=> {
// tab.tabBar.images.forEach(item=> {
// if(item.link){
// currentTabBarRedirectIdArr.push(item.redirectId-0)
// console.log('-link--',item.link.type, item.redirectId)
// } else if(item.row){
// console.log('-row--')
// }
// })
// })
// const {currHomePageId} = this.data
// let isCurrentBar = currentTabBarRedirectIdArr.includes(currHomePageId)
// console.log('-roaaaaaw--',currentTabBarRedirectIdArr, isCurrentBar)
// 段落
const products = data.paragraphs
const filterResult = products.map((res,index)=>{
const filterResult = products.map((res, index) => {
return {
...res,index
...res, index
}
}).filter(item=> {
}).filter(item => {
// wx.hideLoading()
})
......@@ -205,16 +188,26 @@ wxService.page({
* @param isLastPage
* @param now
*/
renderPageFunc ({ products }) {
let productData = handlerDataOnPage.handlerArray(products)
logger.log('productData.keysNum', productData.keysNum(), productData)
this.setData({
...productData
},()=>{
wx.hideLoading()
renderPageFunc({ products }) {
// 9 plus(9/5-权重高)
let newProducts = [...products]
let typeArr = []
newProducts.map(item => typeArr.push(item.type))
if (typeArr.includes(9) && typeArr.includes(5)) {
newProducts.forEach((item, index) => {
if (item.type == 5) { newProducts.splice(index, 1) }
})
}
// let productData = handlerDataOnPage.handlerArray(products)
let productData = handlerDataOnPage.handlerArray(newProducts)
logger.log('productData.keysNum', productData.keysNum(), productData)
this.setData({
...productData
}, () => {
wx.hideLoading()
})
},
/**
......
......@@ -13,6 +13,7 @@
"bannerAd": "/component/bannerAd/bannerAd",
"attention": "/component/attention/attention",
"guide-page-modal": "/component/guidePageModal/guidePageModal",
"bottom-tabs": "/component/bottomTabs/bottomTabs"
"bottom-tabs": "/component/bottomTabs/bottomTabs",
"plus": "/component/plus/plus"
}
}
\ No newline at end of file
......@@ -14,12 +14,8 @@
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<!--<view class="" wx:if="{{pItem.type == 5}}">
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs tab-bar="{{pItem.tabBar}}" />
</view>-->
<view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<bottom-tabs currHome-pageId="{{currHomePageId}}" bind:updatePage="updatePage" tab-bar="{{pItem.tabBar}}" />
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
......@@ -30,9 +26,9 @@
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<!-- <view class="" wx:if="{{pItem.type == 9}}">
<attention/>
</view>-->
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{pItem.plus}}" />
</view>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}' />
......
......@@ -140,22 +140,6 @@ wxService.page({
this.setData({
currHomePageId: data.page.pageId
})
// tabBar
// const currentTabBar = data.paragraphs.filter(item=> item.type == 5)
// let currentTabBarArr =[]
// currentTabBar.forEach(tab=> {
// currentTabBarArr = tab.tabBar.images
// console.log('---', currentTabBarArr)
// currentTabBarArr.forEach(item=> {
// if(item.link){
// console.log('-link--',item.link.type, item.link.url)
// } else if(item.row){
// console.log('-row--')
// }
// })
// })
// 段落
const products = data.paragraphs
const filterResult = products.map((res,index)=>{
......@@ -183,15 +167,25 @@ wxService.page({
* @param isLastPage
* @param now
*/
renderPageFunc ({ products }) {
let productData = handlerDataOnPage.handlerArray(products)
logger.log('productData.keysNum', productData.keysNum(), productData)
this.setData({
...productData
},()=>{
wx.hideLoading()
renderPageFunc({ products }) {
// 9 plus(9/5-权重高)
let newProducts = [...products]
let typeArr = []
newProducts.map(item => typeArr.push(item.type))
if (typeArr.includes(9) && typeArr.includes(5)) {
newProducts.forEach((item, index) => {
if (item.type == 5) { newProducts.splice(index, 1) }
})
}
// let productData = handlerDataOnPage.handlerArray(products)
let productData = handlerDataOnPage.handlerArray(newProducts)
logger.log('productData.keysNum', productData.keysNum(), productData)
this.setData({
...productData
}, () => {
wx.hideLoading()
})
}
})
\ No newline at end of file
......@@ -14,12 +14,8 @@
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bottom="{{pItem.bottom}}" />
</view>
<!--<view class="" wx:if="{{pItem.type == 5}}">
<view class="" wx:if="{{pItem.type == 5}}">
<bottom-tabs tab-bar="{{pItem.tabBar}}" />
</view>-->
<view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<bottom-tabs currHome-pageId="{{currHomePageId}}" bind:updatePage="updatePage" tab-bar="{{pItem.tabBar}}" />
</view>
<view class="" wx:if="{{pItem.type == 6}}">
<announcement notice="{{pItem.notice}}" />
......@@ -30,9 +26,9 @@
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<!-- <view class="" wx:if="{{pItem.type == 9}}">
<attention/>
</view>-->
<view class="" wx:if="{{pItem.type == 9}}">
<plus sku-list="{{pItem.plus}}" />
</view>
</block>
</view>
<authorization-modal isAuthorization='{{isAuthorization}}' />
......
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