threeLineDrawer.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view class="container">
  3. <!-- 抽屜 -->
  4. <uni-drawer :visible="drawerIsShow" :width="width" @close="closeDrawer" style="z-index: 99999;">
  5. <view style="padding:0rpx; background-color:#1A1A1A;">
  6. <view class="picture">
  7. <view class="sisGroup">{{leftNavigationtitle}}
  8. <view class="iconImgage">
  9. </view>
  10. </view>
  11. <view v-for="(item,index) in drawerList" :class="[changeGary==index?'statusMonitoring':'item']" :key="index" @click="clickChangeColor(index)">
  12. <div @click="goToIndex(item);closeDrawer();">
  13. {{item.name}}
  14. </div>
  15. </view>
  16. </view>
  17. <view class="cu-bar tabbar bg-black">
  18. <view class="action">
  19. <view class="icon cuIcon-repair text-black">
  20. </view>
  21. <view class="text-black">设置</view>
  22. </view>
  23. <view class="action" style="margin-left: 30px;">
  24. <view class="icon cuIcon-command text-black">
  25. </view>
  26. <view class="text-black">修改密码</view>
  27. </view>
  28. </view>
  29. </view>
  30. </uni-drawer>
  31. </view>
  32. </template>
  33. <script>
  34. import uniDrawer from "@/uni-drawer/uni-drawer.vue"
  35. import uniList from '@/uni-list/uni-list.vue'
  36. import uniListItem from '@/uni-list-item/uni-list-item.vue'
  37. import uniIcons from '@/uni-icons/uni-icons.vue'
  38. export default {
  39. components: {
  40. uniDrawer,
  41. uniList,
  42. uniListItem,
  43. uniIcons
  44. },
  45. data: function() {
  46. return {
  47. drawerIsShow: false,
  48. drawerList: [],
  49. width: 250,
  50. inconList: [],
  51. changeGary: -1,
  52. leftNavigationtitle:'',
  53. }
  54. },
  55. methods: {
  56. openDrawer: function(width, drawerList, inconList,leftNavigationtitle) {
  57. this.drawerIsShow = true;
  58. this.drawerList = drawerList;
  59. this.width = width;
  60. this.inconList = inconList;
  61. this.leftNavigationtitle = leftNavigationtitle;
  62. },
  63. closeDrawer: function() {
  64. this.drawerIsShow = false;
  65. this.$parent.leftbar();
  66. },
  67. clickChangeColor: function(index) {
  68. this.changeGary = index;
  69. },
  70. goToIndex:function(item){
  71. console.log(item.remark1);
  72. if(item.remark1 == '/pages/index/Index'){
  73. uni.switchTab({
  74. url: item.remark1
  75. });
  76. }
  77. else if(item.remark1 == '/pages/forecast/Forecast'){
  78. this.$parent.$root.toggleSwitch = false;
  79. uni.switchTab({
  80. url: item.remark1
  81. });
  82. }
  83. else if(item.remark1 == '/components/weatherProphethomepage/WeatherProphethomepage'){
  84. this.$parent.$root.toggleSwitch = true;
  85. }
  86. else{
  87. uni.navigateTo({
  88. url: item.remark1
  89. })
  90. }
  91. }
  92. }
  93. }
  94. </script>
  95. <style>
  96. .container{
  97. }
  98. .sisGroup {
  99. width: 90%;
  100. height: 65px;
  101. color: silver;
  102. font-size: 13px;
  103. padding-top: 40px;
  104. margin-left: 5%;
  105. font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
  106. }
  107. .statusMonitoring {
  108. background-color: #393939;
  109. width: 90%;
  110. margin-left: 5%;
  111. height: 40px;
  112. margin-top: 10px;
  113. /* text-align: center; */
  114. color: silver;
  115. font-size: 14px;
  116. padding-top: 10px;
  117. padding-left: 10px;
  118. font-family: Helvetica Neue, Helvetica, sans-serif;
  119. }
  120. .picture {
  121. width: 300px;
  122. height: 700px;
  123. background-color: #1A1A1A;
  124. }
  125. .cu-bar {
  126. position: fixed;
  127. top: calc(100% - 50px);
  128. width: 100%;
  129. background-color: #1A1A1A;
  130. }
  131. .icon {
  132. float: left;
  133. }
  134. .text-black {
  135. float: left;
  136. line-height: 28px;
  137. font-size: 15px;
  138. background-color: #1A1A1A;
  139. color: silver;
  140. }
  141. .iconImgage{
  142. width: 29px;
  143. height: 35px;
  144. background-color: red;
  145. margin-left: 82px;
  146. margin-top: -25px;
  147. background-image: url(../../static/picture/i.jpg);
  148. }
  149. .item {
  150. width: 90%;
  151. height: 40px;
  152. margin-top: 10px;
  153. margin-left: 5%;
  154. /* float: right; */
  155. /* margin-right: 10px; */
  156. background-color: #272727;
  157. /* text-align: center; */
  158. color: silver;
  159. font-size: 14px;
  160. padding-top: 10px;
  161. padding-left: 10px;
  162. font-family: Helvetica Neue, Helvetica, sans-serif;
  163. }
  164. </style>