threeLineDrawer.vue 4.9 KB

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