Commit c1f36c5f by 赵雅纹

Merge branch 'dev_7.1.0' into feature-zyw-sc

parents c18a7dae 5fae665e
...@@ -69,9 +69,78 @@ Component({ ...@@ -69,9 +69,78 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
handelToPage(e){ handelToPage(event){
const {route} = e.currentTarget.dataset const ev = event.currentTarget.dataset;
wxService.router(route) let curItemType = ev.item
const userInfo = wx.getStorageSync('_baseUserInfo')
console.log('curItemType', curItemType, curItemType.link.type)
// link row
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
if (curItemType.link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
} else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
}
if (curItemType.link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if (curItemType.link.type == 3) {
// 预览
wx.previewImage({
current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (curItemType.link.type == 4) {
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 5) {
if (currentClickType == 1) {
wxService.openCard()
} else if (currentClickType == 2) {
wxService.openCard()
}
} else if (curItemType.link.type == 6) {
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 7) {
// 集点详情
console.log('pointPath', currentClickType)
wxService.router(`${currentClickType}`)
}
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
console.log('bacccccccccc', currentClickRow)
if (rowObj.type == 1) { }
else if (rowObj.type == 2) { }
else if (rowObj.type == 3) { }
else if (rowObj.type == 4) { }
else if (rowObj.type == 5) { }
else if (rowObj.type == 6) { }
else if (rowObj.type == 7) { }
else if (rowObj.type == 8) {
// 商品
wxService.router(`/pages/productDetail/productDetail?productId=${currentClickRow}`)
}
else if (rowObj.type == 9) {
// 分类
wxService.router(`/subPackage/page/pages/categoryPro/categoryPro?${currentClickRow}`)
}
}
} }
} }
}) })
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab"> <block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab">
<view <view
class="tab" class="tab"
data-route="{{tab.route}}" data-item="{{tab}}"
bindtap="handelToPage" bindtap="handelToPage"
> >
<image class='tab-img' wx:if="{{currentRoute == tab.route}}" src='{{tab.activeImageUrl}}' /> <image class='tab-img' wx:if="{{currentRoute == tab.route}}" src='{{tab.activeImageUrl}}' />
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</view> </view>
<view class="bottom-tab fixed-bottom0" style="height: 108rpx;" wx:if="{{tabBar.num == 5}}"> <view class="bottom-tab fixed-bottom0" style="height: 108rpx;" wx:if="{{tabBar.num == 5}}">
<block wx:for="{{tabs}}" wx:key="{{index}}" wx:for-item="tab"> <block wx:for="{{tabs}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab" data-route="{{tab.route}}" bindtap="handelToPage"> <view class="tab" data-item="{{tab}}" bindtap="handelToPage">
<image class='tab-img' wx:if="{{currentRoute == tab.route}}" src='{{tab.activeImageUrl}}' /> <image class='tab-img' wx:if="{{currentRoute == tab.route}}" src='{{tab.activeImageUrl}}' />
<image class='tab-img' wx:else src='{{tab.imageUrl}}' /> <image class='tab-img' wx:else src='{{tab.imageUrl}}' />
</view> </view>
......
...@@ -43,68 +43,135 @@ Component({ ...@@ -43,68 +43,135 @@ Component({
}) })
}, },
preview(e) { preview(e) {
const { appid, path, link, item } = e.currentTarget.dataset const ev = e.currentTarget.dataset
let curItemType = ev.item
console.log('ev', curItemType)
const { memberActivateStatus } = wx.getStorageSync('_baseUserInfo') const { memberActivateStatus } = wx.getStorageSync('_baseUserInfo')
// 获取当前帐号信息 // 获取当前帐号信息
const accountInfo = utils.getAccountInfo() const accountInfo = utils.getAccountInfo()
const userInfo = wx.getStorageSync('_baseUserInfo') const userInfo = wx.getStorageSync('_baseUserInfo')
// 2019.06.14 // link row
let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item) if (curItemType.link) {
if (link.type == 1) { let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
// 触发父组件更新页面 外部小程序 if (curItemType.link.type == 1) {
this.setData({ // 触发父组件更新页面 外部小程序
isAuthorization: false this.setData({
}) isAuthorization: false
return false })
} else if (!userInfo) { return false
// userInfo 不存在 授权弹框 } else if (!userInfo) {
this.setData({ this.setData({
isAuthorization: true isAuthorization: true
}) })
return false return false
} } else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
}
if (link.type == 2) { if (curItemType.link.type == 2) {
// 触发父组件更新页面 // 触发父组件更新页面
wxService.nextTick(() => { wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url }) this.triggerEvent('updatePage', { pageId: currentClickType.url })
}) })
} else if (link.type == 3) { } else if (curItemType.link.type == 3) {
// 预览 // 预览
wx.previewImage({ wx.previewImage({
current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接 current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表 urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
}) })
} else if (link.type == 4) { } else if (curItemType.link.type == 4) {
wxService.router(`${currentClickType}`) wxService.router(`/${currentClickType}`)
} else if (link.type == 5) { } else if (curItemType.link.type == 5) {
if (currentClickType == 1) { if (currentClickType == 1) {
wxService.openCard() wxService.openCard()
} else if (currentClickType == 2) { } else if (currentClickType == 2) {
// wxService.openCard() wxService.openCard()
if (userInfo && userInfo.member && userInfo.member.mobile && !userInfo.memberActivateStatus) { }
// 手机号存在 但未激活 跳转激活领卡页面 老用户 } else if (curItemType.link.type == 6) {
this.setData({ wxService.router(`/${currentClickType}`)
isAuthorizationActiveText: '新激活领卡', } else if (curItemType.link.type == 7) {
isAuthorization: true, // 集点详情
isAuthorizationType: 3 console.log('pointPath', currentClickType)
}, () => { wxService.router(`${currentClickType}`)
return false }
}) } else if (curItemType.row) {
} else { let rowObj = JSON.parse(curItemType.row)
wxService.openCard() let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
}
} if (rowObj.type == 1) { }
} else if(link.type == 6){ else if (rowObj.type == 2) { }
wxService.router(`${currentClickType}`) else if (rowObj.type == 3) { }
} else if(link.type == 7){ else if (rowObj.type == 4) { }
// 集点详情 else if (rowObj.type == 5) { }
let pointPath = currentClickType && currentClickType.split('?')[0] else if (rowObj.type == 6) { }
let pointIdParams = currentClickType && currentClickType.split('?')[1] else if (rowObj.type == 7) { }
let pointId = pointIdParams.split('=')[1] else if (rowObj.type == 8) {
wxService.router(`${pointPath}`).search({ id: pointId }) // 商品
wxService.router(`/pages/productDetail/productDetail?productId=${currentClickRow}`)
}
else if (rowObj.type == 9) {
// 分类
wxService.router(`/subPackage/page/pages/categoryPro/categoryPro?${currentClickRow}`)
}
} }
// 2019.06.14
// let currentClickType = app.globalData.commonFunc.getLink(item.link.type, item)
// if (link.type == 1) {
// // 触发父组件更新页面 外部小程序
// this.setData({
// isAuthorization: false
// })
// return false
// } else if (!userInfo) {
// // userInfo 不存在 授权弹框
// this.setData({
// isAuthorization: true
// })
// return false
// }
// if (link.type == 2) {
// // 触发父组件更新页面
// wxService.nextTick(() => {
// this.triggerEvent('updatePage', { pageId: currentClickType.url })
// })
// } else if (link.type == 3) {
// // 预览
// wx.previewImage({
// current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
// urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
// })
// } else if (link.type == 4) {
// wxService.router(`${currentClickType}`)
// } else if (link.type == 5) {
// if (currentClickType == 1) {
// wxService.openCard()
// } else if (currentClickType == 2) {
// // wxService.openCard()
// if (userInfo && userInfo.member && userInfo.member.mobile && !userInfo.memberActivateStatus) {
// // 手机号存在 但未激活 跳转激活领卡页面 老用户
// this.setData({
// isAuthorizationActiveText: '新激活领卡',
// isAuthorization: true,
// isAuthorizationType: 3
// }, () => {
// return false
// })
// } else {
// wxService.openCard()
// }
// }
// } else if(link.type == 6){
// wxService.router(`${currentClickType}`)
// } else if(link.type == 7){
// // 集点详情
// let pointPath = currentClickType && currentClickType.split('?')[0]
// let pointIdParams = currentClickType && currentClickType.split('?')[1]
// let pointId = pointIdParams.split('=')[1]
// wxService.router(`${pointPath}`).search({ id: pointId })
// }
}, },
activeTocard(e) { activeTocard(e) {
if (e.detail) { if (e.detail) {
......
...@@ -9,13 +9,13 @@ Component({ ...@@ -9,13 +9,13 @@ Component({
* 组件的属性列表 * 组件的属性列表
*/ */
properties: { properties: {
categoryType:{ categoryType: {
type: Object, type: Object,
value: null value: null
} }
}, },
attached() { attached() {
}, },
/** /**
* 组件的初始数据 * 组件的初始数据
...@@ -23,13 +23,14 @@ Component({ ...@@ -23,13 +23,14 @@ Component({
data: { data: {
// currentTab: 0, // currentTab: 0,
currentTab: 99, currentTab: 99,
isAuthorization: false, // false 不显示 true 显示
}, },
/** /**
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { methods: {
handelToVipCode() { handelToVipCode() {
wxService.router(`/pages/memberOfOwn/memberOfOwn`) wxService.router(`/pages/memberOfOwn/memberOfOwn`)
}, },
handelToCart() { handelToCart() {
wxService.router(`/pages/cart/cart`) wxService.router(`/pages/cart/cart`)
...@@ -37,9 +38,12 @@ Component({ ...@@ -37,9 +38,12 @@ Component({
// 设置tab active // 设置tab active
switchNav(event) { switchNav(event) {
const ev = event.currentTarget.dataset; const ev = event.currentTarget.dataset;
console.log('ev', ev)
let cur = ev.current let cur = ev.current
let redirectid = ev.redirectid let curItemType = ev.item
console.log('redirectid', redirectid) const userInfo = wx.getStorageSync('_baseUserInfo')
// 切换 active
if (this.data.currentTab == cur) { if (this.data.currentTab == cur) {
return false return false
} else { } else {
...@@ -47,11 +51,80 @@ Component({ ...@@ -47,11 +51,80 @@ Component({
currentTab: cur, currentTab: cur,
}) })
} }
// link row
if (curItemType.link) {
let currentClickType = app.globalData.commonFunc.getLink(curItemType.link.type, curItemType)
if (curItemType.link.type == 1) {
// 触发父组件更新页面 外部小程序
this.setData({
isAuthorization: false
})
return false
} else if (!userInfo) {
this.setData({
isAuthorization: true
})
return false
} else if (userInfo && userInfo.member && !userInfo.member.mobile) {
wxService.openCard()
return false
}
if (curItemType.link.type == 2) {
// 触发父组件更新页面
wxService.nextTick(() => {
this.triggerEvent('updatePage', { pageId: currentClickType.url })
})
} else if (curItemType.link.type == 3) {
// 预览
wx.previewImage({
current: `${app.globalData.imageUrl}/${currentClickType.imageUrl}`, // 当前显示图片的http链接
urls: [`${app.globalData.imageUrl}/${currentClickType.link.url}`] // 需要预览的图片http链接列表
})
} else if (curItemType.link.type == 4) {
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 5) {
if (currentClickType == 1) {
wxService.openCard()
} else if (currentClickType == 2) {
wxService.openCard()
}
} else if (curItemType.link.type == 6) {
wxService.router(`/${currentClickType}`)
} else if (curItemType.link.type == 7) {
// 集点详情
console.log('pointPath', currentClickType)
wxService.router(`${currentClickType}`)
}
} else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row)
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
console.log('bacccccccccc', currentClickRow)
if (rowObj.type == 1) { }
else if (rowObj.type == 2) { }
else if (rowObj.type == 3) { }
else if (rowObj.type == 4) { }
else if (rowObj.type == 5) { }
else if (rowObj.type == 6) { }
else if (rowObj.type == 7) { }
else if (rowObj.type == 8) {
// 商品
wxService.router(`/pages/productDetail/productDetail?productId=${currentClickRow}`)
}
else if (rowObj.type == 9) {
// 分类
wxService.router(`/subPackage/page/pages/categoryPro/categoryPro?${currentClickRow}`)
}
}
}, },
switchTab(event) { switchTab(event) {
var cur = event.detail.current var cur = event.detail.current
this.setData({ this.setData({
currentTab: cur currentTab: cur
}) })
} }
} }
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
style="width:{{navItemWidth}}%" style="width:{{navItemWidth}}%"
data-current="{{idx}}" data-current="{{idx}}"
data-redirectId="{{navItem.redirectId}}" data-redirectId="{{navItem.redirectId}}"
data-item ="{{navItem}}"
bindtap="switchNav" bindtap="switchNav"
> >
<view>{{navItem.title}}</view> <view>{{navItem.title}}</view>
......
...@@ -156,7 +156,19 @@ wxService.page({ ...@@ -156,7 +156,19 @@ wxService.page({
}) })
// tabBar // tabBar
const currentTabBar = data.paragraphs.filter(item=> item.type == 5) const currentTabBar = data.paragraphs.filter(item=> item.type == 5)
console.log('---', currentTabBar)
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)=>{
......
...@@ -13,6 +13,6 @@ ...@@ -13,6 +13,6 @@
"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"
} }
} }
\ No newline at end of file
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view>--> </view>-->
<view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}"> <view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else --> <!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<bottom-tabs tab-bar="{{pItem.tabBar}}" /> <bottom-tabs 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}}" />
...@@ -34,54 +34,7 @@ ...@@ -34,54 +34,7 @@
<attention/> <attention/>
</view>--> </view>-->
</block> </block>
<!--
<tab-sort/>
<view class="page-bgc">
<image-swiper/>
<announcement/>
<icon-swiper/>
<pic-nav/>
</view>
<view class="person-hot border_box">
<text class="person-text">- 人气热卖</text>
<span class="hot border_box">HOT -</span>
</view>
<hot-item/>
<attention/>
<bannerAd/>-->
<!-- <block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view class="pd1530" wx:if="{{pItem.type == 1}}">
<image-swiper bind:updatePage="updatePage" image-data="{{pItem.rotationchart.images}}" />
</view>
<view class="pd1530" wx:if="{{pItem.type == 2}}">
<person-center
base-user-info="{{baseUserInfo}}"
person-data="{{pItem.customer}}"
integral-num="{{integralNum}}"
coupon-num="{{couponNum}}"
token="{{token}}"
/>
</view>
<view class="pd1520" wx:if="{{pItem.type == 3}}">
<pic-nav bind:updatePage="updatePage" pic-nav="{{pItem.navigation.images}}" />
</view>
<view class="" wx:if="{{pItem.type == 4}}">
<bottom bind:updatePage="updatePage" bottom="{{pItem.bottom}}" />
</view>
</block>-->
</view> </view>
<!--<authorization-modal isAuthorization='{{isAuthorization}}' />--> <authorization-modal isAuthorization='{{isAuthorization}}' />
<guide-page-modal show="{{guidePageModalShow}}" /> <guide-page-modal show="{{guidePageModalShow}}" />
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": 25, "current": 13,
"list": [ "list": [
{ {
"id": -1, "id": -1,
...@@ -123,7 +123,8 @@ ...@@ -123,7 +123,8 @@
"id": 13, "id": 13,
"name": "subPage", "name": "subPage",
"pathName": "subPackage/page/pages/subPage/subPage", "pathName": "subPackage/page/pages/subPage/subPage",
"query": "pageId=4" "query": "pageId=14",
"scene": null
}, },
{ {
"id": 14, "id": 14,
......
...@@ -74,9 +74,9 @@ wxService.page({ ...@@ -74,9 +74,9 @@ wxService.page({
}) })
if (wx.getStorageSync('_baseUserInfo')){ if (wx.getStorageSync('_baseUserInfo')){
// 积分数量 // 积分数量
this.getMemberPointInfo() // this.getMemberPointInfo()
// 优惠券数量 // 优惠券数量
this.getMemberCouponInfo() // this.getMemberCouponInfo()
} }
}, },
// 查询积分信息 // 查询积分信息
...@@ -134,6 +134,22 @@ wxService.page({ ...@@ -134,6 +134,22 @@ wxService.page({
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: data.page.title title: data.page.title
}) })
// 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)=>{
......
...@@ -5,6 +5,14 @@ ...@@ -5,6 +5,14 @@
"person-center": "/component/personCenter/personCenter", "person-center": "/component/personCenter/personCenter",
"pic-nav": "/component/picNav/picNav", "pic-nav": "/component/picNav/picNav",
"bottom": "/component/bottom/bottom", "bottom": "/component/bottom/bottom",
"authorization-modal": "/component/authorization-modal/authorization-modal" "authorization-modal": "/component/authorization-modal/authorization-modal",
"tab-sort": "/component/tabSort/tabSort",
"announcement": "/component/announcement/announcement",
"icon-swiper": "/component/iconSwiper/iconSwiper",
"hot-item": "/component/hotItem/hotItem",
"bannerAd": "/component/bannerAd/bannerAd",
"attention": "/component/attention/attention",
"guide-page-modal": "/component/guidePageModal/guidePageModal",
"bottom-tabs": "/component/bottomTabs/bottomTabs"
} }
} }
\ No newline at end of file
<!--subPackage/page/pages/subPage/subPage.wxml--> <!--subPackage/page/pages/subPage/subPage.wxml-->
<view class='user-center'> <view class='user-center' style="background: {{pageBackgroundColor == 1? '#eee': '#fff'}};min-height: {{outoHeigth}}px">
<!-- 1 轮播 2 个人中心 3 图片导航 4 底部--> <!-- 1 轮播 2 个人中心 3 图片导航 4 底部左划 5 底部 Tab 6 公告 7 分类 8 关注公众号 9 plus(9/5-权重高)-->
<block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem"> <block wx:for="{{pages}}" wx:key="{{index}}" wx:for-item="pItem">
<view wx:if="{{pItem.type == 1}}">
<!--{{pItem.type}}--> <image-swiper image-data="{{pItem.rotationchart.images}}" />
<!-- 轮播 --> </view>
<view class="pd1530" wx:if="{{pItem.type == 1}}"> <view class="" wx:if="{{pItem.type == 2}}">
<image-swiper bind:updatePage="updatePage" image-data="{{pItem.rotationchart.images}}" /> <person-center person-data="{{pItem.customer}}" />
</view> </view>
<view class="" wx:if="{{pItem.type == 3}}">
<!-- 个人中心 {{pItem.customer}}--> <pic-nav pic-nav="{{pItem.navigation.images}}" />
<view class="pd1530" wx:if="{{pItem.type == 2}}"> </view>
<person-center person-data="{{pItem.customer}}" integral-num="{{integralNum}}" coupon-num="{{couponNum}}" token="{{token}}"/> <view class="" wx:if="{{pItem.type == 4}}">
</view> <bottom bottom="{{pItem.bottom}}" />
</view>
<!-- 图片导航 {{pItem.navigation.images}} pd1530--> <!--<view class="" wx:if="{{pItem.type == 5}}">
<view class="pd1520" wx:if="{{pItem.type == 3}}"> <bottom-tabs tab-bar="{{pItem.tabBar}}" />
<pic-nav bind:updatePage="updatePage" pic-nav="{{pItem.navigation.images}}" /> </view>-->
</view> <view class="" wx:if="{{ pItem.type == 9 ? pItem.type == 9 : pItem.type == 5}}">
<!-- 底部 --> <!-- <attention wx:if="{{pItem.type == 9}}" /> wx:else -->
<view class="" wx:if="{{pItem.type == 4}}"> <bottom-tabs bind:updatePage="updatePage" tab-bar="{{pItem.tabBar}}" />
<bottom bind:updatePage="updatePage" bottom="{{pItem.bottom}}"/> </view>
</view> <view class="" wx:if="{{pItem.type == 6}}">
</block> <announcement notice="{{pItem.notice}}" />
</view>
<view class="" wx:if="{{pItem.type == 7}}">
<tab-sort category-type="{{pItem.categoryType}}" />
</view>
<view class="" wx:if="{{pItem.type == 8}}">
<attention focus-wx="{{pItem.focusWx}}" />
</view>
<!-- <view class="" wx:if="{{pItem.type == 9}}">
<attention/>
</view>-->
</block>
</view> </view>
<authorization-modal isAuthorization='{{isAuthorization}}'/> <authorization-modal isAuthorization='{{isAuthorization}}' />
<guide-page-modal show="{{guidePageModalShow}}" />
...@@ -28,7 +28,7 @@ HandlerLink.prototype = { ...@@ -28,7 +28,7 @@ HandlerLink.prototype = {
let res = this.currentLinkType(type, item) let res = this.currentLinkType(type, item)
return res return res
}, },
currentLinkType(type, item={}) { currentLinkType(type, item = {}) {
// 1. 外部小程序_url 2. 内部动态页面_pageId 3.预览 4. 内部页面 5. 卡券__1_卡包 2_激活领卡 // 1. 外部小程序_url 2. 内部动态页面_pageId 3.预览 4. 内部页面 5. 卡券__1_卡包 2_激活领卡
if (type == 1) { if (type == 1) {
wx.navigateToMiniProgram({ wx.navigateToMiniProgram({
...@@ -36,10 +36,10 @@ HandlerLink.prototype = { ...@@ -36,10 +36,10 @@ HandlerLink.prototype = {
appId: item.link.appid, appId: item.link.appid,
path: `${item.link.url}`, path: `${item.link.url}`,
success: e => { success: e => {
console.log('type=1',e) console.log('type=1', e)
}, },
fail: e => { fail: e => {
console.log('type=1',e) console.log('type=1', e)
}, },
complete: e => { complete: e => {
console.log(e) console.log(e)
...@@ -54,24 +54,26 @@ HandlerLink.prototype = { ...@@ -54,24 +54,26 @@ HandlerLink.prototype = {
return `${item.link.url}` return `${item.link.url}`
} else if (type == 5) { } else if (type == 5) {
let currentOpen = '' let currentOpen = ''
if(item.link.url == 1){ if (item.link.url == 1) {
// 卡包 // 卡包
currentOpen = 1 currentOpen = 1
return currentOpen return currentOpen
// wxService.openCardList() // wxService.openCardList()
} else if(item.link.url == 2){ } else if (item.link.url == 2) {
// 激活领卡--开卡 // 激活领卡--开卡
currentOpen= 2 currentOpen = 2
return currentOpen return currentOpen
// wxService.openCard() // wxService.openCard()
} }
} else if(type == 6){ } else if (type == 6) {
// 跳转路径中包括http的跳转到h5页面中,用web-view去加载h5页面 // 跳转路径中包括http的跳转到h5页面中,用web-view去加载h5页面
if (/http/gi.test(item.link.url)) { if (/http/gi.test(item.link.url)) {
const enCodeUrl = encodeURIComponent(item.link.url) const enCodeUrl = encodeURIComponent(item.link.url)
return `/subPackage/page/pages/h5/h5page?url=${enCodeUrl}` return `/subPackage/page/pages/h5/h5page?url=${enCodeUrl}`
} }
return `/${item.link.url}` return `/${item.link.url}`
} else if (type == 7) {
return `${item.link.url}`
} }
} }
} }
...@@ -81,6 +83,79 @@ const getLink = function (type, id, name) { ...@@ -81,6 +83,79 @@ const getLink = function (type, id, name) {
return handlerLink.init.apply(handlerLink, arguments) return handlerLink.init.apply(handlerLink, arguments)
} }
const getLinkRow = function (type, item) {
const handlerLinkRow = new HandlerLinkRow()
return handlerLinkRow.init.apply(handlerLinkRow, arguments)
}
const HandlerLinkRow = function () { }
HandlerLinkRow.prototype = {
init(type, item = {}) {
let res = this.currentLinkRowType(type, item)
return res
},
currentLinkRowType(type, item = {}) {
// 1 外部小程序链接 2 配置页面 3 弹出图片 4 小程序内部功能列表 5 微信卡券 6 H5链接 7 小程序内部页面 8 商品 9 分类
console.log('commonType', type)
if (type == 1) {
wx.navigateToMiniProgram({
// 跳转外部小程序
appId: item.link.appid,
path: `${item.link.url}`,
success: e => {
console.log('type=1', e)
},
fail: e => {
console.log('type=1', e)
},
complete: e => {
console.log(e)
},
})
return ''
} else if (type == 2) {
return item.link
} else if (type == 3) {
return item
} else if (type == 4) {
return `${item.link.url}`
} else if (type == 5) {
let currentOpen = ''
if (item.link.url == 1) {
// 卡包
currentOpen = 1
return currentOpen
// wxService.openCardList()
} else if (item.link.url == 2) {
// 激活领卡--开卡
currentOpen = 2
return currentOpen
// wxService.openCard()
}
} else if (type == 6) {
// 跳转路径中包括http的跳转到h5页面中,用web-view去加载h5页面
if (/http/gi.test(item.link.url)) {
const enCodeUrl = encodeURIComponent(item.link.url)
return `/subPackage/page/pages/h5/h5page?url=${enCodeUrl}`
}
return `/${item.link.url}`
} else if (type == 7) {
return `${item.link.url}`
} else if (type == 8) {
console.log('----', item)
return `${item.url}`
} else if (type == 9) {
console.log('----', item.name)
return `id=${item.url}&name=${item.name}`
}
}
}
const getUrlParam = function (name, url) { const getUrlParam = function (name, url) {
if (!url) { if (!url) {
return null return null
...@@ -124,6 +199,7 @@ class Parmas { ...@@ -124,6 +199,7 @@ class Parmas {
module.exports = { module.exports = {
getLink: getLink, getLink: getLink,
getLinkRow: getLinkRow,
parmas: new Parmas(), parmas: new Parmas(),
getUrlParam: getUrlParam, getUrlParam: getUrlParam,
handlerLink: new HandlerLink(), handlerLink: new HandlerLink(),
......
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