帧视界壹通告,付费看视频的微信小程序
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.

101 lines
2.1 KiB

11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
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. :key="index"
  7. @click="toPath(item, index)">
  8. <view class="icon">
  9. <image :src="select == index ?
  10. item.selectedIconPath :
  11. item.iconPath" class="icon-image" mode=""></image>
  12. </view>
  13. <view class="title">
  14. {{ item.title }}
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. name:"tabbar",
  22. props : ['select'],
  23. data() {
  24. return {
  25. list : [
  26. {
  27. "selectedIconPath": "/static/image/tabbar/1.png",
  28. "iconPath": "/static/image/tabbar/2.png",
  29. "pagePath": "/pages/index/index",
  30. "title": "首页",
  31. },{
  32. "selectedIconPath": "/static/image/tabbar/3.png",
  33. "iconPath": "/static/image/tabbar/4.png",
  34. "pagePath": "/pages/index/publish",
  35. "title": "发布",
  36. },{
  37. "selectedIconPath": "/static/image/tabbar/5.png",
  38. "iconPath": "/static/image/tabbar/6.png",
  39. "pagePath": "/pages/index/center",
  40. "title": "我的",
  41. }
  42. ]
  43. };
  44. },
  45. methods : {
  46. toPath(item, index){
  47. if(index == this.select){
  48. return
  49. }
  50. uni.redirectTo({
  51. url: item.pagePath
  52. })
  53. },
  54. }
  55. }
  56. </script>
  57. <style scoped lang="scss">
  58. .tabbar{
  59. position: fixed;
  60. width: 750rpx;
  61. background-color: #fff;
  62. display: flex;
  63. justify-content: center;
  64. align-items: center;
  65. flex-direction: row;
  66. height: 120rpx;
  67. z-index: 999999;
  68. bottom: 0;
  69. left: 0;
  70. line-height: 50rpx;
  71. color: #333;
  72. .item{
  73. flex: 1;
  74. display: flex;
  75. flex-direction: column;
  76. justify-content: center;
  77. align-items: center;
  78. .icon{
  79. width: 54rpx;
  80. height: 54rpx;
  81. .icon-image{
  82. width: 54rpx;
  83. height: 54rpx;
  84. }
  85. }
  86. .title{
  87. overflow: hidden;
  88. // white-space: nowrap;
  89. // text-overflow: ellipsis;
  90. // -o-text-overflow: ellipsis;
  91. font-size: 23rpx;
  92. }
  93. }
  94. }
  95. .active .title{
  96. background: $uni-linear-gradient-color; /*设置渐变的方向从左到右 颜色从ff0000到ffff00*/
  97. -webkit-background-clip: text;/*将设置的背景颜色限制在文字中*/
  98. -webkit-text-fill-color: transparent;/*给文字设置成透明*/
  99. }
  100. </style>