index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view class="header-banner-warp">
  3. <view class="header-banner">
  4. <view class="back">
  5. <span v-if="isBack" @click="backFn" class="iconfont">&#xe6c5;</span>
  6. </view>
  7. <view class="center-title">
  8. {{title || '菜单'}}
  9. </view>
  10. <view class="right-menu" @click="openMenu">
  11. <!-- <uni-icons type="bars" size="30"></uni-icons> -->
  12. </view>
  13. </view>
  14. <view class="menu-modal" v-if="menuModalType">
  15. <ul class="left-banner">
  16. <li class="active">嘻嘻嘻嘻嘻</li>
  17. <li>嘻嘻嘻嘻嘻</li>
  18. <li>嘻嘻嘻嘻嘻</li>
  19. <li>嘻嘻嘻嘻嘻</li>
  20. <li>嘻嘻嘻嘻嘻</li>
  21. <li>嘻嘻嘻嘻嘻</li>
  22. </ul>
  23. <view class="right-banner">
  24. <uni-collapse ref="collapse" v-model="value">
  25. <uni-collapse-item title="功能模块" :border="false">
  26. <view class="right-banner-box">
  27. <view class="">
  28. 12312
  29. </view>
  30. <view class="">
  31. 12312
  32. </view>
  33. <view class="">
  34. 12312
  35. </view>
  36. <view class="">
  37. 12312
  38. </view>
  39. <view class="">
  40. 12312
  41. </view>
  42. <view class="">
  43. 12312
  44. </view>
  45. </view>
  46. </uni-collapse-item>
  47. <uni-collapse-item title="功能模块" :border="false">
  48. <view class="content">
  49. <text class="text">折叠内容主体,这是一段比较长内容。默认折叠主要内容,只显示当前项标题。点击标题展开,才能看到这段文字。再次点击标题,折叠内容。</text>
  50. </view>
  51. </uni-collapse-item>
  52. <uni-collapse-item title="功能模块" :border="false">
  53. <view class="content">
  54. <text class="text">禁用状态内容主体,页面上是看不到这段话的。</text>
  55. </view>
  56. </uni-collapse-item>
  57. </uni-collapse>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. props:{
  65. title:{
  66. type:String,
  67. },
  68. isBack:{
  69. type:Boolean,
  70. default:true,
  71. },
  72. },
  73. data(){
  74. return {
  75. value:null,
  76. menuModalType:false,
  77. }
  78. },
  79. methods: {
  80. backFn(){
  81. uni.navigateBack({
  82. delta:1,//返回层数,2则上上页
  83. })
  84. },
  85. toRouter(j) {
  86. console.log(j)
  87. uni.navigateTo({
  88. url: '/pages/' + j.menuKey + '/' + j.menuKey
  89. })
  90. },
  91. openMenu() {
  92. this.menuModalType = !this.menuModalType
  93. console.log(this.menuModalType)
  94. },
  95. },
  96. }
  97. </script>
  98. <style lang="less">
  99. .uni-collapse-item{
  100. // height: 120rpx!important;
  101. }
  102. .header-banner-warp{
  103. background-color: #fff;
  104. padding-top: 40rpx;
  105. position: fixed;
  106. top: 0rpx;
  107. left: 0;
  108. right: 0;
  109. z-index: 10;
  110. border-bottom: 1rpx solid #dddddd;
  111. overflow: hidden;
  112. font-size: 32rpx;
  113. .header-banner {
  114. height: 88rpx;
  115. line-height: 88rpx;
  116. display: flex;
  117. justify-content: space-between;
  118. padding: 0 20rpx;
  119. background-color: #fff;
  120. }
  121. }
  122. .menu-modal {
  123. position: fixed;
  124. top: 129rpx;
  125. left: 0;
  126. bottom: 0;
  127. right: 0;
  128. display: flex;
  129. z-index: 1;
  130. .left-banner {
  131. width: 200rpx;
  132. background-color: #e9e9e9;
  133. font-size: 28rpx;
  134. li {
  135. height: 120rpx;
  136. line-height: 120rpx;
  137. color: #666666;
  138. text-align: center;
  139. }
  140. .active {
  141. background-color: #fff;
  142. color: #3370FF;
  143. position: relative;
  144. }
  145. .active::before {
  146. display: block;
  147. content: " ";
  148. width: 8rpx;
  149. height: 48rpx;
  150. position: absolute;
  151. left: 0rpx;
  152. top: 36rpx;
  153. background-color: #3370FF;
  154. }
  155. }
  156. .right-banner {
  157. width: calc(~ '100% - 200rpx');
  158. background-color: #ffffff;
  159. .right-banner-box{
  160. padding: 30rpx;
  161. display: flex;
  162. justify-content: space-between;
  163. flex-wrap:wrap;
  164. view{
  165. width: 32%;
  166. height: 64rpx;
  167. text-align: center;
  168. line-height: 64rpx;
  169. background-color: #F1F1F1;
  170. color: #333333;
  171. font-size: 24rpx;
  172. margin-bottom: 20rpx;
  173. }
  174. }
  175. }
  176. }
  177. </style>