threeLineDrawer.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. //#ifdef H5
  66. this.$root.leftbar();
  67. //#endif
  68. //#ifdef APP-PLUS
  69. this.$parent.leftbar();
  70. //#endif
  71. },
  72. clickChangeColor: function(index) {
  73. this.changeGary = index;
  74. },
  75. goToIndex:function(item){
  76. console.log(item.remark1);
  77. if(item.remark1 == '/pages/index/Index'){
  78. uni.switchTab({
  79. url: item.remark1
  80. });
  81. }
  82. else if(item.remark1 == '/pages/forecast/Forecast'){
  83. this.$parent.$root.toggleSwitch = false;
  84. uni.switchTab({
  85. url: item.remark1
  86. });
  87. }
  88. else if(item.remark1 == '/components/weatherProphethomepage/WeatherProphethomepage'){
  89. this.$parent.$root.toggleSwitch = true;
  90. }
  91. else{
  92. uni.navigateTo({
  93. url: item.remark1
  94. })
  95. }
  96. }
  97. }
  98. }
  99. </script>
  100. <style>
  101. .container{
  102. }
  103. .sisGroup {
  104. width: 90%;
  105. height: 65px;
  106. color: silver;
  107. font-size: 13px;
  108. padding-top: 40px;
  109. margin-left: 5%;
  110. font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, Simsun, sans-serif;
  111. }
  112. .statusMonitoring {
  113. background-color: #393939;
  114. width: 90%;
  115. margin-left: 5%;
  116. height: 40px;
  117. margin-top: 10px;
  118. /* text-align: center; */
  119. color: silver;
  120. font-size: 14px;
  121. padding-top: 10px;
  122. padding-left: 10px;
  123. font-family: Helvetica Neue, Helvetica, sans-serif;
  124. }
  125. .picture {
  126. width: 300px;
  127. height: 700px;
  128. background-color: #1A1A1A;
  129. }
  130. .cu-bar {
  131. position: fixed;
  132. top: calc(100% - 50px);
  133. width: 100%;
  134. background-color: #1A1A1A;
  135. }
  136. .icon {
  137. float: left;
  138. }
  139. .text-black {
  140. float: left;
  141. line-height: 28px;
  142. font-size: 15px;
  143. background-color: #1A1A1A;
  144. color: silver;
  145. }
  146. .iconImgage{
  147. width: 29px;
  148. height: 35px;
  149. background-color: red;
  150. margin-left: 82px;
  151. margin-top: -25px;
  152. background-image: url(../../static/picture/i.jpg);
  153. }
  154. .item {
  155. width: 90%;
  156. height: 40px;
  157. margin-top: 10px;
  158. margin-left: 5%;
  159. /* float: right; */
  160. /* margin-right: 10px; */
  161. background-color: #272727;
  162. /* text-align: center; */
  163. color: silver;
  164. font-size: 14px;
  165. padding-top: 10px;
  166. padding-left: 10px;
  167. font-family: Helvetica Neue, Helvetica, sans-serif;
  168. }
  169. </style>