Browse Source

更新底部导航栏

master
前端-胡立永 9 months ago
parent
commit
e378c2e83a
14 changed files with 56 additions and 29 deletions
  1. +47
    -21
      components/base/tabBar.vue
  2. +4
    -3
      locale/en.js
  3. +1
    -1
      pages/center/center.vue
  4. +1
    -1
      pages/order/order.vue
  5. +1
    -1
      pages/prizeDraw/prizeDraw.vue
  6. BIN
      static/tabbar/1.png
  7. BIN
      static/tabbar/2.png
  8. BIN
      static/tabbar/3.png
  9. BIN
      static/tabbar/4.png
  10. BIN
      static/tabbar/5.png
  11. BIN
      static/tabbar/6.png
  12. BIN
      static/tabbar/7.png
  13. BIN
      static/tabbar/8.png
  14. +2
    -2
      utils/clickSound.js

+ 47
- 21
components/base/tabBar.vue View File

@ -5,7 +5,7 @@
@click="toPath(item, index)" @click="toPath(item, index)"
v-for="(item, index) in list"> v-for="(item, index) in list">
<view class="icon"> <view class="icon">
<image :src="select == index ? item.selectedIconPath : item.iconPath" class="icon-image" mode=""></image>
<image :src="'/static/tabbar/' + (index + 1) + '.png'" class="icon-image" mode=""></image>
</view> </view>
<view class="title"> <view class="title">
{{ $t(item.title) }} {{ $t(item.title) }}
@ -40,27 +40,48 @@
props : ['select'], props : ['select'],
data() { data() {
return { return {
// "list": [
// {
// "selectedIconPath": "/static/tabbar/2.png",
// "iconPath": "/static/tabbar/1.png",
// "pagePath": "/pages/home/home",
// "title": "tabbar.title.1"
// },{
// "selectedIconPath": "/static/tabbar/4.png",
// "iconPath": "/static/tabbar/3.png",
// "pagePath": "/pages/prizeDraw/prizeDraw",
// "title": "tabbar.title.2"
// },{
// "selectedIconPath": "/static/tabbar/6.png",
// "iconPath": "/static/tabbar/5.png",
// "pagePath": "/pages/order/order",
// "title": "tabbar.title.3"
// },{
// "selectedIconPath": "/static/tabbar/8.png",
// "iconPath": "/static/tabbar/7.png",
// "pagePath": "/pages/center/center",
// "title": "tabbar.title.4"
// }
// ],
"list": [ "list": [
{ {
"selectedIconPath": "/static/tabbar/2.png",
"iconPath": "/static/tabbar/1.png",
"pagePath": "/pages/home/home", "pagePath": "/pages/home/home",
"title": "tabbar.title.1" "title": "tabbar.title.1"
},{
"selectedIconPath": "/static/tabbar/4.png",
"iconPath": "/static/tabbar/3.png",
"pagePath": "/pages/prizeDraw/prizeDraw",
"title": "tabbar.title.2"
},{
"selectedIconPath": "/static/tabbar/6.png",
"iconPath": "/static/tabbar/5.png",
},
{
"pagePath": "/pages/order/order", "pagePath": "/pages/order/order",
"title": "tabbar.title.2"
},
{
"pagePath": "/pages/prizeDraw/prizeDraw",
"title": "tabbar.title.3" "title": "tabbar.title.3"
},{
"selectedIconPath": "/static/tabbar/8.png",
"iconPath": "/static/tabbar/7.png",
"pagePath": "/pages/center/center",
},
{
"title": "tabbar.title.4" "title": "tabbar.title.4"
},
{
"pagePath": "/pages/center/center",
"title": "tabbar.title.5"
} }
] ]
} }
@ -70,6 +91,11 @@
if(index == this.select){ if(index == this.select){
return return
} }
if(!item.pagePath){
return
}
this.$play() this.$play()
uni.redirectTo({ uni.redirectTo({
url: item.pagePath url: item.pagePath
@ -83,7 +109,7 @@
.list{ .list{
position: fixed; position: fixed;
width: 100vw; width: 100vw;
background-color: #fff;
background-color: #000;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -93,9 +119,10 @@
bottom: 0; bottom: 0;
left: 0; left: 0;
line-height: 50rpx; line-height: 50rpx;
color: #000;
color: #fff;
box-shadow: 0px 0rpx 10rpx 10rpx #00000022; box-shadow: 0px 0rpx 10rpx 10rpx #00000022;
width: 750rpx; width: 750rpx;
font-weight: 500;
.item:nth-child(2){ .item:nth-child(2){
// .icon{ // .icon{
// .icon-image{ // .icon-image{
@ -118,8 +145,8 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.icon-image{ .icon-image{
width: 40rpx;
height: 40rpx;
width: 45rpx;
height: 45rpx;
} }
} }
.icon-image{ .icon-image{
@ -135,7 +162,6 @@
} }
} }
.active{ .active{
color: #000 !important;
font-weight: 900;
color: rgb(92, 173, 255) !important;
} }
</style> </style>

+ 4
- 3
locale/en.js View File

@ -3,9 +3,10 @@ export default {
"language.cancel": "cancel", "language.cancel": "cancel",
"page.login.title": "login", "page.login.title": "login",
"tabbar.title.1": "Home", "tabbar.title.1": "Home",
"tabbar.title.2": "STARTING",
"tabbar.title.3": "Order",
"tabbar.title.4": "Individual center",
"tabbar.title.2": "Records",
"tabbar.title.3": "Starting",
"tabbar.title.4": "Service",
"tabbar.title.5": "Account",
"nav.login": "Login", "nav.login": "Login",
"nav.register": "Register", "nav.register": "Register",
"nav.home": "Home", "nav.home": "Home",


+ 1
- 1
pages/center/center.vue View File

@ -189,7 +189,7 @@
</view> </view>
</u-popup> </u-popup>
<sTabbar select="3" />
<sTabbar select="4" />
<!-- 选择语言弹框 --> <!-- 选择语言弹框 -->
<changeLanguage :show.sync="showLanguage" @close="closeLanguage"></changeLanguage> <changeLanguage :show.sync="showLanguage" @close="closeLanguage"></changeLanguage>


+ 1
- 1
pages/order/order.vue View File

@ -105,7 +105,7 @@
:showCancelButton="true" :showCancelButton="true"
></u-modal> ></u-modal>
<sTabbar select="2"/>
<sTabbar select="1"/>
</view> </view>
</template> </template>


+ 1
- 1
pages/prizeDraw/prizeDraw.vue View File

@ -103,7 +103,7 @@
</view> </view>
</view> </view>
<sTabbar select="1" />
<sTabbar select="2" />
<u-popup :show="show" mode="bottom" @close="show = false;$play()"> <u-popup :show="show" mode="bottom" @close="show = false;$play()">
<view style="font-size: 35rpx;text-align: center; <view style="font-size: 35rpx;text-align: center;


BIN
static/tabbar/1.png View File

Before After
Width: 200  |  Height: 200  |  Size: 2.7 KiB Width: 84  |  Height: 84  |  Size: 2.2 KiB

BIN
static/tabbar/2.png View File

Before After
Width: 200  |  Height: 200  |  Size: 2.8 KiB Width: 84  |  Height: 84  |  Size: 1.7 KiB

BIN
static/tabbar/3.png View File

Before After
Width: 222  |  Height: 200  |  Size: 4.5 KiB Width: 84  |  Height: 84  |  Size: 2.6 KiB

BIN
static/tabbar/4.png View File

Before After
Width: 222  |  Height: 200  |  Size: 4.7 KiB Width: 84  |  Height: 84  |  Size: 2.4 KiB

BIN
static/tabbar/5.png View File

Before After
Width: 200  |  Height: 200  |  Size: 2.5 KiB Width: 84  |  Height: 84  |  Size: 2.0 KiB

BIN
static/tabbar/6.png View File

Before After
Width: 200  |  Height: 200  |  Size: 2.6 KiB

BIN
static/tabbar/7.png View File

Before After
Width: 150  |  Height: 150  |  Size: 3.2 KiB

BIN
static/tabbar/8.png View File

Before After
Width: 150  |  Height: 150  |  Size: 3.1 KiB

+ 2
- 2
utils/clickSound.js View File

@ -7,6 +7,6 @@ audio.playbackRate = 1.5
export function play(){ export function play(){
// audio.pause(); // audio.pause();
audio.currentTime = 0
audio.play()
// audio.currentTime = 0
// audio.play()
} }

Loading…
Cancel
Save