plusDrawer.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <template>
  2. <view>
  3. <!-- <scroll-view scroll-y class="DrawerPage" :class="modalName=='viewModal'?'show':''" >
  4. </scroll-view> -->
  5. <view class="DrawerClose" :class="modalName=='viewModal'?'show':''" @tap="hideModal" >
  6. <text class="cuIcon-pullright"></text>
  7. </view>
  8. <scroll-view scroll-y class="DrawerWindow" :class="modalName=='viewModal'?'show':''" @tap="showModal" data-target="viewModal"
  9. :style="{'margin-top':marginright}">
  10. <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg" >
  11. <view class="cu-item arrow" v-for="(item,index) in plusDrawerList" :key="index" @tap="pushWindPowerStationNameToSessionStorage(item.name,item.windId);" style=" background-color: #272727; border-bottom: 1rpx solid #1F1F1F;">
  12. <view class="content">
  13. <!-- <text class="cuIcon-github text-grey"></text> -->
  14. <text class="text-grey">{{item.name}}</text>
  15. </view>
  16. </view>
  17. </view>
  18. </scroll-view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. modalName: null,
  26. plusDrawerList: [],
  27. width: '',
  28. windPowerStationId: '',
  29. listWidth: '',
  30. marginright: ''
  31. };
  32. },
  33. onLoad() {
  34. this.windpowerstationIds = JSON.parse(uni.getStorageSync('windpowerstationNames'));
  35. uni.showLoading({
  36. title: '加载中...',
  37. mask: true,
  38. });
  39. },
  40. onReady() {
  41. uni.hideLoading();
  42. },
  43. onShow() {
  44. this.hideModal();
  45. },
  46. created: function() {
  47. // this.listWidth="352px";
  48. // this.marginright="-20px";
  49. },
  50. methods: {
  51. showModal(plusDrawerList, modalName) {
  52. this.plusDrawerList = plusDrawerList;
  53. this.modalName = modalName;
  54. },
  55. hideModal(modalName) {
  56. this.modalName = null;
  57. },
  58. // tabSelect(e) {
  59. // this.TabCur = e.currentTarget.dataset.id;
  60. // this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60
  61. // },
  62. pushWindPowerStationNameToSessionStorage(windpowerstationName, windPowerStationId) {
  63. uni.setStorageSync('windpowerstationName', windpowerstationName);
  64. uni.setStorageSync('windPowerStationId', windPowerStationId);
  65. //debugger
  66. this.common.goback('/pages/index/Index');
  67. },
  68. getWindPowerStationNamesToSessionStorage() {
  69. uni.getStorageSync('windpowerstationNames');
  70. console.log(uni.getStorageSync('windpowerstationNames'));
  71. return uni.getStorageSync('windpowerstationNames');
  72. },
  73. },
  74. }
  75. </script>
  76. <style>
  77. page {
  78. background-image: var(--gradualBlue);
  79. width: 100vw;
  80. overflow: hidden;
  81. }
  82. .DrawerPage {
  83. position: fixed;
  84. width: 100vw;
  85. height: 100vh;
  86. left: 0vw;
  87. background-color: #242424;
  88. transition: all 0.4s;
  89. }
  90. .DrawerPage.show {
  91. transform: scale(0.9, 0.9);
  92. left: 85vw;
  93. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  94. transform-origin: 0;
  95. background-color: #242424;
  96. }
  97. .DrawerWindow {
  98. position: absolute;
  99. width: 85vw;
  100. height: 100vh;
  101. left: 0;
  102. top: 0;
  103. transform: scale(0.9, 0.9) translateX(-100%);
  104. opacity: 0;
  105. pointer-events: none;
  106. transition: all 0.4s;
  107. padding: 100upx 0;
  108. background-color: #242424;
  109. }
  110. .DrawerWindow.show {
  111. transform: scale(1, 1) translateX(0%);
  112. opacity: 1;
  113. pointer-events: all;
  114. background-color: #242424;
  115. }
  116. .DrawerClose {
  117. position: absolute;
  118. width: 40vw;
  119. height: 100vh;
  120. right: 0;
  121. top: 0;
  122. color: transparent;
  123. padding-bottom: 30upx;
  124. display: flex;
  125. align-items: flex-end;
  126. justify-content: center;
  127. background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
  128. letter-spacing: 5px;
  129. font-size: 50upx;
  130. opacity: 0;
  131. pointer-events: none;
  132. transition: all 0.4s;
  133. background-color: #242424;
  134. }
  135. .DrawerClose.show {
  136. opacity: 1;
  137. pointer-events: all;
  138. width: 15vw;
  139. color: #fff;
  140. background-color: #242424;
  141. }
  142. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  143. width: 64upx;
  144. height: 64upx;
  145. line-height: 64upx;
  146. margin: 0;
  147. display: inline-block;
  148. background-color: #242424;
  149. }
  150. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  151. margin: 0;
  152. }
  153. .DrawerPage .nav {
  154. flex: 1;
  155. }
  156. .DrawerPage .nav .cu-item.cur {
  157. border-bottom: 0;
  158. position: relative;
  159. }
  160. .DrawerPage .nav .cu-item.cur::after {
  161. content: "";
  162. width: 10upx;
  163. height: 10upx;
  164. background-color: currentColor;
  165. position: absolute;
  166. bottom: 10upx;
  167. border-radius: 10upx;
  168. left: 0;
  169. right: 0;
  170. margin: auto;
  171. }
  172. .DrawerPage .cu-bar.tabbar .action {
  173. flex: initial;
  174. }
  175. </style>