帧视界壹通告,付费看视频的微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.2 KiB

11 months ago
  1. <template>
  2. <view class="tabbar">
  3. <view
  4. :class="{item : true, active : select == index}"
  5. v-for="(item, index) in list"
  6. @click="toPath(item, index)">
  7. <view class="icon">
  8. <image :src="select == index ?
  9. item.selectedIconPath :
  10. item.iconPath" class="icon-image" mode=""></image>
  11. </view>
  12. <view class="title">
  13. <image :src="item.selectedTextPath"
  14. v-if="select == index"></image>
  15. <text v-else>{{ item.title }}</text>
  16. </view>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. name:"tabbar",
  23. props : ['select'],
  24. data() {
  25. return {
  26. list : [
  27. {
  28. "selectedIconPath": "/static/image/tabbar/1.png",
  29. "iconPath": "/static/image/tabbar/2.png",
  30. "pagePath": "/pages/index/index",
  31. "title": "首页",
  32. "selectedTextPath": "/static/image/tabbar/1t.png",
  33. },{
  34. "selectedIconPath": "/static/image/tabbar/3.png",
  35. "iconPath": "/static/image/tabbar/4.png",
  36. "pagePath": "/pages/index/publish",
  37. "title": "发布",
  38. "selectedTextPath": "/static/image/tabbar/3t.png",
  39. },{
  40. "selectedIconPath": "/static/image/tabbar/5.png",
  41. "iconPath": "/static/image/tabbar/6.png",
  42. "pagePath": "/pages/index/center",
  43. "title": "我的",
  44. "selectedTextPath": "/static/image/tabbar/5t.png",
  45. }
  46. ]
  47. };
  48. },
  49. methods : {
  50. toPath(item, index){
  51. if(index == this.select){
  52. return
  53. }
  54. uni.redirectTo({
  55. url: item.pagePath
  56. })
  57. },
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .tabbar{
  63. position: fixed;
  64. width: 750rpx;
  65. background-color: #f7f7f7;
  66. display: flex;
  67. justify-content: center;
  68. align-items: center;
  69. flex-direction: row;
  70. height: 120rpx;
  71. z-index: 999999;
  72. bottom: 0;
  73. left: 0;
  74. line-height: 50rpx;
  75. color: #333;
  76. .item{
  77. flex: 1;
  78. display: flex;
  79. flex-direction: column;
  80. justify-content: center;
  81. align-items: center;
  82. .icon{
  83. width: 54rpx;
  84. height: 54rpx;
  85. .icon-image{
  86. width: 54rpx;
  87. height: 54rpx;
  88. }
  89. }
  90. .title{
  91. overflow: hidden;
  92. // white-space: nowrap;
  93. // text-overflow: ellipsis;
  94. // -o-text-overflow: ellipsis;
  95. font-size: 23rpx;
  96. image{
  97. width: 50rpx;
  98. height: 35rpx;
  99. margin-top: 10rpx;
  100. }
  101. }
  102. }
  103. }
  104. .active{
  105. // color: #03c061 !important;x
  106. }
  107. </style>