[新增]新增自定义tabbar组件
This commit is contained in:
@@ -66,6 +66,9 @@ Page({
|
||||
|
||||
// 存储浏览记录
|
||||
wx.setStorageSync('companyRecord', record)
|
||||
|
||||
// 存储点击的企业id
|
||||
wx.setStorageSync('compayId', company.company_id)
|
||||
|
||||
// 存储店铺ID
|
||||
wx.setStorage({
|
||||
@@ -73,8 +76,8 @@ Page({
|
||||
key : "storeId",
|
||||
success : res=>{
|
||||
if(res.errMsg == "setStorage:ok"){
|
||||
wx.navigateTo({
|
||||
url: "/pages/shortVideo/index",
|
||||
wx.reLaunch({
|
||||
url: "/pages/config/config",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,30 +18,44 @@ Page({
|
||||
})
|
||||
return
|
||||
}
|
||||
wx.getStorage({
|
||||
key : 'compayId',
|
||||
success : res=>{
|
||||
|
||||
wx.$api.publics.storeConfig({
|
||||
company_id: res.data
|
||||
}).then(res => {
|
||||
let tabBarVal = res.concat({})
|
||||
tabBarVal.forEach(res => {
|
||||
switch (res.slug) {
|
||||
case "video":
|
||||
tabBar.push(video)
|
||||
break;
|
||||
case "mall":
|
||||
tabBar.push(mall)
|
||||
break;
|
||||
case "ticket":
|
||||
tabBar.push(ticket)
|
||||
break;
|
||||
default :
|
||||
tabBar.push(user)
|
||||
break;
|
||||
}
|
||||
})
|
||||
|
||||
wx.$api.publics.storeConfig({
|
||||
company_id: e.companyoid
|
||||
}).then(res => {
|
||||
let tabBarVal = res.concat({})
|
||||
tabBarVal.forEach(res => {
|
||||
switch (res.slug) {
|
||||
case "video":
|
||||
tabBar.push(video)
|
||||
break;
|
||||
case "mall":
|
||||
tabBar.push(mall)
|
||||
break;
|
||||
case "ticket":
|
||||
tabBar.push(ticket)
|
||||
break;
|
||||
default :
|
||||
tabBar.push(user)
|
||||
break;
|
||||
}
|
||||
})
|
||||
wx.switchTab({
|
||||
url: tabBar[0].pagePath
|
||||
})
|
||||
if(tabBarVal.length == tabBar.length){
|
||||
wx.reLaunch({
|
||||
url: tabBar[0].pagePath,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数
|
||||
*/
|
||||
onShow(){
|
||||
wx.hideHomeButton()
|
||||
}
|
||||
})
|
||||
@@ -28,6 +28,13 @@ Page({
|
||||
this.pushInfo();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数
|
||||
*/
|
||||
onShow(){
|
||||
wx.hideHomeButton()
|
||||
},
|
||||
|
||||
/**
|
||||
* 商城首页数据
|
||||
*/
|
||||
|
||||
@@ -38,4 +38,6 @@
|
||||
<mallIndex_list push-list="{{pushList}}" loding-stats="{{lodingStats}}" has-more="{{page.has_more}}"></mallIndex_list>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<storeTabBar pages-url="pages/mall/index"></storeTabBar>
|
||||
|
||||
@@ -10,10 +10,10 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
videoList: [], //获取短视频列表
|
||||
videoIndex: 0, //当前播放视频的下标
|
||||
videoId: "", //当前播放的视频id
|
||||
playState: true, //视频播放状态
|
||||
videoList : [], //获取短视频列表
|
||||
videoIndex : 0, //当前播放视频的下标
|
||||
videoId : "", //当前播放的视频id
|
||||
playState : true, //视频播放状态
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
<view>短视频</view>
|
||||
|
||||
<navigator url="plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=4">进入直播间</navigator>
|
||||
|
||||
<view class="videos-content">
|
||||
|
||||
<view style="margin-top: 10vh">
|
||||
<view bindtap="onId">改变全局id</view>
|
||||
</view>
|
||||
|
||||
<view class="videos-content" wx:if="{{1 == 2}}">
|
||||
<swiperViode
|
||||
wx:if="{{videoList.length > 0}}"
|
||||
class="swiper-viode"
|
||||
@@ -51,4 +49,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<storeTabBar pages-url="pages/shortVideo/index"></storeTabBar>
|
||||
|
||||
@@ -110,4 +110,6 @@
|
||||
<text>设置</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<storeTabBar pages-url="pages/user/index"></storeTabBar>
|
||||
|
||||
@@ -25,7 +25,7 @@ Page({
|
||||
key : "storeId",
|
||||
success : ()=>{
|
||||
wx.reLaunch({
|
||||
url: "/pages/shortVideo/index",
|
||||
url: "/pages/config/config",
|
||||
})
|
||||
},
|
||||
fail : ()=>{
|
||||
|
||||
Reference in New Issue
Block a user