diff --git a/app.js b/app.js index 8abc9c5..820a03e 100644 --- a/app.js +++ b/app.js @@ -14,9 +14,9 @@ App({ wx.$qqMap = new QQMapWX({ key: "3TBBZ-O42LU-HXCVQ-2M66A-NCFTT-LMBHU" }) - //挂载api方法 wx.$api = apis + }, globalData: { navAppInfo : { @@ -24,6 +24,7 @@ App({ envVersion : "trial", goodUrl : "/pages/goods/show?goodsId=", cardUrl : "/pages/card/index?cardid=" - } + }, + id : 1 } }) diff --git a/app.json b/app.json index 7b734bc..e8be1d5 100644 --- a/app.json +++ b/app.json @@ -1,8 +1,7 @@ { "pages": [ - "pages/config/config", - "pages/welcome/index", + "pages/config/config", "pages/company/index", "pages/company/search/search", "pages/shortVideo/index", @@ -45,42 +44,14 @@ "pages/home/projectSuccess/projectSuccess", "pages/home/activeSuccess/activeSuccess" ], - "tabBar": { - "list": [{ - "pagePath": "pages/shortVideo/index", - "text": "视频", - "iconPath": "/static/tabbar/tabbar_icon_00.png", - "selectedIconPath": "/static/tabbar/tabbar_icon_show_00.png" - }, - { - "pagePath": "pages/mall/index", - "text": "商城", - "iconPath": "/static/tabbar/tabbar_icon_01.png", - "selectedIconPath": "/static/tabbar/tabbar_icon_show_01.png" - }, - { - "pagePath": "pages/ticket/index", - "text": "优惠", - "iconPath": "/static/tabbar/tabbar_icon_02.png", - "selectedIconPath": "/static/tabbar/tabbar_icon_show_02.png" - }, - { - "pagePath": "pages/user/index", - "text": "我的", - "iconPath": "/static/tabbar/tabbar_icon_03.png", - "selectedIconPath": "/static/tabbar/tabbar_icon_show_03.png" - } - ], - "selectedColor": "#0b0041", - "color": "#4e4f51", - "borderStyle": "white", - "custom": true - }, "window": { "navigationBarBackgroundColor": "#fff", "navigationBarTitleText": "", "navigationBarTextStyle": "black" }, + "usingComponents": { + "storeTabBar": "/components/storeTabBar/storeTabBar" + }, "plugins": { "live-player-plugin": { "version": "1.2.5", diff --git a/components/mallIndex_list/mallIndex_list.wxml b/components/mallIndex_list/mallIndex_list.wxml index 800d169..f675b92 100644 --- a/components/mallIndex_list/mallIndex_list.wxml +++ b/components/mallIndex_list/mallIndex_list.wxml @@ -7,7 +7,7 @@ - + diff --git a/components/mallIndex_list/mallIndex_list.wxss b/components/mallIndex_list/mallIndex_list.wxss index 3a1f669..3282c70 100644 --- a/components/mallIndex_list/mallIndex_list.wxss +++ b/components/mallIndex_list/mallIndex_list.wxss @@ -34,7 +34,7 @@ padding-top: 100%; } -.recommend-img image { +.recommend-img-src { position: absolute; width: 100%; height: 100%; @@ -65,7 +65,6 @@ .recommend-cost { font-size: 24rpx; color: #999; - /* text-decoration:line-through; */ margin: 2rpx 0 0 20rpx; } diff --git a/components/mallIndex_video/mallIndex_video.wxml b/components/mallIndex_video/mallIndex_video.wxml index 31eb937..0d89044 100644 --- a/components/mallIndex_video/mallIndex_video.wxml +++ b/components/mallIndex_video/mallIndex_video.wxml @@ -4,7 +4,7 @@ 商品直播间专区 - LIVE + LIVE @@ -16,7 +16,7 @@ - 正在直播 + 正在直播 diff --git a/components/mallIndex_video/mallIndex_video.wxss b/components/mallIndex_video/mallIndex_video.wxss index 2a92c42..a426ae4 100644 --- a/components/mallIndex_video/mallIndex_video.wxss +++ b/components/mallIndex_video/mallIndex_video.wxss @@ -40,7 +40,7 @@ margin-top: 5rpx; } -.videoTitle-name-img image { +.videoTitle-name-img-img { width: 34rpx; height: 34rpx; margin: 1rpx 6rpx 0 10rpx; @@ -73,7 +73,7 @@ padding-top: 80%; } -.videoList-img .videoList-cover { +.videoList-cover { position: absolute; top: 0; left: 0; @@ -96,7 +96,7 @@ box-shadow: 0 0 10rpx rgba(0, 0, 0, .05); } -.videoList-tips image { +.videoList-tips-image { width: 30rpx; height: 30rpx; margin: 8rpx 10rpx 6rpx 0; diff --git a/components/storeTabBar/storeTabBar.js b/components/storeTabBar/storeTabBar.js new file mode 100644 index 0000000..e4bb99a --- /dev/null +++ b/components/storeTabBar/storeTabBar.js @@ -0,0 +1,56 @@ +/** + * Web唐明明 + * 匆匆数载恍如梦,岁月迢迢华发增。 + * 碌碌无为枉半生,一朝惊醒万事空。 + */ + +import { tabBar } from "../../lib/storeConfig" + +Component({ + /** + * 组件接收参数 + */ + properties: { + // 显示组件页面的路径 + pagesUrl : { + type : String, + value : "" + } + }, + + /** + * 组件的初始数据 + */ + data: { + selected : 0, + color : "#4e4f51", + selectedColor : "#0b0041", + list : [] + }, + + /** + * 生命周期函数 + */ + pageLifetimes: { + show(){ + let selectedIndex = tabBar.findIndex(val=> val.pagePath == '/' + this.data.pagesUrl) + this.setData({ + list : tabBar, + selected: selectedIndex + }) + } + }, + + /** + * 组件的方法列表 + */ + methods: { + switchTab(e) { + const data = e.currentTarget.dataset + const url = data.path + wx.reLaunch({ + url + }) + } + } +}) \ No newline at end of file diff --git a/components/storeTabBar/storeTabBar.json b/components/storeTabBar/storeTabBar.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/components/storeTabBar/storeTabBar.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/custom-tab-bar/index.wxml b/components/storeTabBar/storeTabBar.wxml similarity index 50% rename from custom-tab-bar/index.wxml rename to components/storeTabBar/storeTabBar.wxml index e54d25a..a8aa312 100644 --- a/custom-tab-bar/index.wxml +++ b/components/storeTabBar/storeTabBar.wxml @@ -1,9 +1,8 @@ - - - {{item.text}} + + {{item.text}} diff --git a/custom-tab-bar/index.wxss b/components/storeTabBar/storeTabBar.wxss similarity index 90% rename from custom-tab-bar/index.wxss rename to components/storeTabBar/storeTabBar.wxss index fe6d9b7..4ffc7f7 100644 --- a/custom-tab-bar/index.wxss +++ b/components/storeTabBar/storeTabBar.wxss @@ -5,7 +5,7 @@ * 碌碌无为枉半生,一朝惊醒万事空。 */ -.tab-bar { + .tab-bar { position: fixed; bottom: 0; left: 0; @@ -34,11 +34,11 @@ flex-direction: column; } -.tab-bar-item cover-image { +.tab-bar-item-icon{ width: 24px; height: 24px; } -.tab-bar-item cover-view { +.tab-bar-text{ font-size: 10px; } diff --git a/custom-tab-bar/index.js b/custom-tab-bar/index.js deleted file mode 100644 index 49bf6f2..0000000 --- a/custom-tab-bar/index.js +++ /dev/null @@ -1,52 +0,0 @@ - -/** - * Web唐明明 - * 匆匆数载恍如梦,岁月迢迢华发增。 - * 碌碌无为枉半生,一朝惊醒万事空。 - */ - -import { tabBar } from "../lib/storeConfig" - -Component({ - /** - * 组件的初始数据 - */ - data: { - selected : 0, - color : "#4e4f51", - selectedColor: "#0b0041", - list : [] - }, - - /** - * 生命周期函数 - */ - attached(){ - if(this.data.list.length <= 0 && tabBar.length > 0){ - this.setData({ - list: tabBar - }) - }else{ - wx.showToast({ - title: "获取店铺模块信息失败", - icon : "none" - }) - } - }, - - /** - * 组件的方法列表 - */ - methods: { - switchTab(e) { - const data = e.currentTarget.dataset - const url = data.path - wx.switchTab({ - url - }) - this.setData({ - selected: data.index - }) - } - } -}) \ No newline at end of file diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json deleted file mode 100644 index fba482a..0000000 --- a/custom-tab-bar/index.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "component": true -} \ No newline at end of file diff --git a/pages/company/index.js b/pages/company/index.js index cd18f54..8be121a 100644 --- a/pages/company/index.js +++ b/pages/company/index.js @@ -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", }) } } diff --git a/pages/config/config.js b/pages/config/config.js index a589427..2128690 100644 --- a/pages/config/config.js +++ b/pages/config/config.js @@ -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() } }) \ No newline at end of file diff --git a/pages/mall/index.js b/pages/mall/index.js index 515a489..a81d184 100644 --- a/pages/mall/index.js +++ b/pages/mall/index.js @@ -28,6 +28,13 @@ Page({ this.pushInfo(); }, + /** + * 生命周期函数 + */ + onShow(){ + wx.hideHomeButton() + }, + /** * 商城首页数据 */ diff --git a/pages/mall/index.wxml b/pages/mall/index.wxml index 41b791b..c7d8a90 100644 --- a/pages/mall/index.wxml +++ b/pages/mall/index.wxml @@ -38,4 +38,6 @@ - \ No newline at end of file + + + diff --git a/pages/shortVideo/index.js b/pages/shortVideo/index.js index 663caa9..694dd31 100644 --- a/pages/shortVideo/index.js +++ b/pages/shortVideo/index.js @@ -10,10 +10,10 @@ Page({ * 页面的初始数据 */ data: { - videoList: [], //获取短视频列表 - videoIndex: 0, //当前播放视频的下标 - videoId: "", //当前播放的视频id - playState: true, //视频播放状态 + videoList : [], //获取短视频列表 + videoIndex : 0, //当前播放视频的下标 + videoId : "", //当前播放的视频id + playState : true, //视频播放状态 }, /** diff --git a/pages/shortVideo/index.wxml b/pages/shortVideo/index.wxml index 4964435..dded866 100644 --- a/pages/shortVideo/index.wxml +++ b/pages/shortVideo/index.wxml @@ -1,15 +1,13 @@ -短视频 -短视频 -短视频 -短视频 -短视频 -短视频 -短视频 -短视频 + 进入直播间 - + + + 改变全局id + + + - \ No newline at end of file + + + diff --git a/pages/user/index.wxml b/pages/user/index.wxml index 110d4d5..246021c 100644 --- a/pages/user/index.wxml +++ b/pages/user/index.wxml @@ -110,4 +110,6 @@ 设置 - \ No newline at end of file + + + diff --git a/pages/welcome/index.js b/pages/welcome/index.js index 311733d..4e64271 100644 --- a/pages/welcome/index.js +++ b/pages/welcome/index.js @@ -25,7 +25,7 @@ Page({ key : "storeId", success : ()=>{ wx.reLaunch({ - url: "/pages/shortVideo/index", + url: "/pages/config/config", }) }, fail : ()=>{ diff --git a/project.config.json b/project.config.json index 803f59b..d54c140 100644 --- a/project.config.json +++ b/project.config.json @@ -86,9 +86,9 @@ "scene": null }, { - "name": "读取企业配置", + "name": "分享进入", "pathName": "pages/config/config", - "query": "companyoid=17", + "query": "", "scene": null } ]