[新增]企业店铺模块配置

This commit is contained in:
唐明明
2020-12-29 16:34:10 +08:00
parent c34a1d6021
commit 67dd6e617a
12 changed files with 184 additions and 100 deletions

View File

@@ -1,15 +1,18 @@
{ {
"pages": [ "pages": [
"pages/user/index", "pages/config/config",
"pages/user/companyMine/myActives/myActives",
"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",
"pages/card/index", "pages/card/index",
"pages/mall/index", "pages/mall/index",
"pages/mall/mall_details/mall_details",
"pages/live/index", "pages/live/index",
"pages/ticket/index", "pages/ticket/index",
"pages/home/index", "pages/home/index",

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

@@ -1,90 +1,97 @@
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [] "ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": true,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": false,
"useApiHook": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}, },
"enableEngineNative": false, "setting": {
"bundle": false, "urlCheck": true,
"useIsolateContext": true, "es6": true,
"useCompilerModule": true, "enhance": false,
"userConfirmedUseCompilerModuleSwitch": false, "postcss": true,
"userConfirmedBundleSwitch": false, "preloadBackgroundData": false,
"packNpmManually": false, "minified": true,
"packNpmRelationList": [], "newFeature": false,
"minifyWXSS": true "coverView": true,
}, "nodeModules": true,
"compileType": "miniprogram", "autoAudits": false,
"libVersion": "2.14.0", "showShadowRootInWxmlPanel": true,
"appid": "wxd931d03dfe955254", "scopeDataCheck": false,
"projectname": "%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E5%B0%8F%E7%A8%8B%E5%BA%8F", "uglifyFileName": false,
"debugOptions": { "checkInvalidKey": true,
"hidedInDevtools": [] "checkSiteMap": true,
}, "uploadWithSourceMap": true,
"scripts": {}, "compileHotReLoad": false,
"isGameTourist": false, "useMultiFrameRuntime": false,
"simulatorType": "wechat", "useApiHook": true,
"simulatorPluginLibVersion": {}, "babelSetting": {
"condition": { "ignore": [],
"plugin": { "disablePlugins": [],
"list": [] "outputPath": ""
},
"game": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": [
{
"name": "登录",
"pathName": "pages/login/login",
"query": "",
"scene": null
}, },
{ "enableEngineNative": false,
"name": "搜索", "bundle": false,
"pathName": "pages/company/search/search", "useIsolateContext": true,
"query": "", "useCompilerModule": true,
"scene": null "userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.14.0",
"appid": "wxd931d03dfe955254",
"projectname": "%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E5%B0%8F%E7%A8%8B%E5%BA%8F",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"isGameTourist": false,
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"plugin": {
"list": []
}, },
{ "game": {
"name": "商城", "list": []
"pathName": "pages/mall/index",
"query": "",
"scene": null
}, },
{ "gamePlugin": {
"name": "pages/home/beSureOrder/beSureOrder", "list": []
"pathName": "pages/home/beSureOrder/beSureOrder", },
"scene": null "miniprogram": {
"list": [
{
"name": "登录",
"pathName": "pages/login/login",
"query": "",
"scene": null
},
{
"name": "搜索",
"pathName": "pages/company/search/search",
"query": "",
"scene": null
},
{
"name": "商城",
"pathName": "pages/mall/index",
"query": "",
"scene": null
},
{
"name": "企业广场",
"pathName": "pages/company/index",
"query": "",
"scene": null
},
{
"name": "读取企业配置",
"pathName": "pages/config/config",
"query": "companyoid=17",
"scene": null
}
]
} }
]
} }
}
} }

BIN
static/tabbar.zip Normal file

Binary file not shown.