Compare commits

...

2 Commits

Author SHA1 Message Date
唐明明
f8dd20a7a6 [新增]企业组件配置 2020-12-29 16:39:10 +08:00
唐明明
67dd6e617a [新增]企业店铺模块配置 2020-12-29 16:34:10 +08:00
18 changed files with 102 additions and 18 deletions

View File

@@ -1,8 +1,12 @@
{ {
"pages": [ "pages": [
"pages/config/config",
"pages/welcome/index", "pages/welcome/index",
"pages/company/index", "pages/company/index",
"pages/company/search/search", "pages/company/search/search",
"pages/user/index",
"pages/user/companyMine/myActives/myActives",
"pages/shortVideo/index", "pages/shortVideo/index",
"pages/richText/richText", "pages/richText/richText",
"pages/login/login", "pages/login/login",

View File

@@ -5,7 +5,7 @@
* 碌碌无为枉半生,一朝惊醒万事空。 * 碌碌无为枉半生,一朝惊醒万事空。
*/ */
import { mall, video, ticket, user} from "../lib/tabBarData" import { tabBar } from "../lib/storeConfig"
Component({ Component({
/** /**
@@ -15,21 +15,23 @@ Component({
selected : 0, selected : 0,
color : "#4e4f51", color : "#4e4f51",
selectedColor: "#0b0041", selectedColor: "#0b0041",
list : [video, mall, ticket, user] list : []
}, },
/** /**
* 生命周期函数 * 生命周期函数
*/ */
lifetimes:{ attached(){
// attached: ()=>{ if(this.data.list.length <= 0 && tabBar.length > 0){
// //获取模版信息 this.setData({
// wx.$api.publics.storeConfig({ list: tabBar
// company_id: "17" })
// }).then(res=>{ }else{
// console.log(res) wx.showToast({
// }) title: "获取店铺模块信息失败",
// } icon : "none"
})
}
}, },
/** /**

13
lib/storeConfig.js Normal file
View File

@@ -0,0 +1,13 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
// 企业tabBar配置
const tabBar = []
export {
tabBar
}

View File

@@ -7,7 +7,7 @@
// 商城 // 商城
const mall = { const mall = {
"pagePath": "pages/mall/index", "pagePath": "/pages/mall/index",
"text": "商城", "text": "商城",
"iconPath": "/static/tabbar/tabbar_icon_01.png", "iconPath": "/static/tabbar/tabbar_icon_01.png",
"selectedIconPath": "/static/tabbar/tabbar_icon_show_01.png" "selectedIconPath": "/static/tabbar/tabbar_icon_show_01.png"
@@ -15,7 +15,7 @@ const mall = {
// 短视频 // 短视频
const video = { const video = {
"pagePath": "pages/shortVideo/index", "pagePath": "/pages/shortVideo/index",
"text": "首页", "text": "首页",
"iconPath": "/static/tabbar/tabbar_icon_00.png", "iconPath": "/static/tabbar/tabbar_icon_00.png",
"selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png" "selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png"
@@ -23,7 +23,7 @@ const video = {
// 优惠券 // 优惠券
const ticket = { const ticket = {
"pagePath": "pages/ticket/index", "pagePath": "/pages/ticket/index",
"text": "优惠", "text": "优惠",
"iconPath": "/static/tabbar/tabbar_icon_02.png", "iconPath": "/static/tabbar/tabbar_icon_02.png",
"selectedIconPath": "/static/tabbar/tabbar_icon_show_02.png" "selectedIconPath": "/static/tabbar/tabbar_icon_show_02.png"
@@ -31,7 +31,7 @@ const ticket = {
// 我的 // 我的
const user = { const user = {
"pagePath": "pages/user/index", "pagePath": "/pages/user/index",
"text": "我的", "text": "我的",
"iconPath": "/static/tabbar/tabbar_icon_03.png", "iconPath": "/static/tabbar/tabbar_icon_03.png",
"selectedIconPath": "/static/tabbar/tabbar_icon_show_03.png" "selectedIconPath": "/static/tabbar/tabbar_icon_show_03.png"
@@ -43,4 +43,3 @@ export {
ticket, ticket,
user user
} }

47
pages/config/config.js Normal file
View File

@@ -0,0 +1,47 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
*/
import { tabBar } from "../../lib/storeConfig"
import { mall, video, ticket, user } from "../../lib/tabBarData"
Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad(e) {
if (e.companyoid && e.companyoid == "") {
wx.showToast({
title: "参数错误缺少companyoId"
})
return
}
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
})
})
}
})

3
pages/config/config.json Normal file
View File

@@ -0,0 +1,3 @@
{
"usingComponents": {}
}

5
pages/config/config.wxml Normal file
View File

@@ -0,0 +1,5 @@
<view class="pack-center pages-loding">
<image src="/static/icons/loding.gif" mode="widthFix"></image>
<view>加载企业信息</view>
</view>

1
pages/config/config.wxss Normal file
View File

@@ -0,0 +1 @@
/* pages/config/config.wxss */

View File

@@ -1,3 +1,6 @@
短视频
<view class="videos-content"> <view class="videos-content">
<swiperViode <swiperViode
wx:if="{{videoList.length > 0}}" wx:if="{{videoList.length > 0}}"

View File

@@ -19,6 +19,7 @@
.videos-content{ .videos-content{
position: relative; position: relative;
height: 100vh; height: 100vh;
display: none;
} }
/* 视频信息 */ /* 视频信息 */

View File

@@ -80,10 +80,16 @@
"scene": null "scene": null
}, },
{ {
"name": "pages/user/index", "name": "企业广场",
"pathName": "pages/user/index", "pathName": "pages/company/index",
"query": "", "query": "",
"scene": null "scene": null
},
{
"name": "读取企业配置",
"pathName": "pages/config/config",
"query": "companyoid=17",
"scene": null
} }
] ]
} }

BIN
static/tabbar.zip Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB