Commit 2470cdaa by 高淑倩

plus(9/5-权重高)

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