plusDrawer.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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.windPowerStationId);" 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. this.common.goback('/pages/index/Index');
  66. },
  67. getWindPowerStationNamesToSessionStorage() {
  68. uni.getStorageSync('windpowerstationNames');
  69. console.log(uni.getStorageSync('windpowerstationNames'));
  70. return uni.getStorageSync('windpowerstationNames');
  71. },
  72. },
  73. }
  74. </script>
  75. <style>
  76. page {
  77. background-image: var(--gradualBlue);
  78. width: 100vw;
  79. overflow: hidden;
  80. }
  81. .DrawerPage {
  82. position: fixed;
  83. width: 100vw;
  84. height: 100vh;
  85. left: 0vw;
  86. background-color: #242424;
  87. transition: all 0.4s;
  88. }
  89. .DrawerPage.show {
  90. transform: scale(0.9, 0.9);
  91. left: 85vw;
  92. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  93. transform-origin: 0;
  94. background-color: #242424;
  95. }
  96. .DrawerWindow {
  97. position: absolute;
  98. width: 85vw;
  99. height: 100vh;
  100. left: 0;
  101. top: 0;
  102. transform: scale(0.9, 0.9) translateX(-100%);
  103. opacity: 0;
  104. pointer-events: none;
  105. transition: all 0.4s;
  106. padding: 100upx 0;
  107. background-color: #242424;
  108. }
  109. .DrawerWindow.show {
  110. transform: scale(1, 1) translateX(0%);
  111. opacity: 1;
  112. pointer-events: all;
  113. background-color: #242424;
  114. }
  115. .DrawerClose {
  116. position: absolute;
  117. width: 40vw;
  118. height: 100vh;
  119. right: 0;
  120. top: 0;
  121. color: transparent;
  122. padding-bottom: 30upx;
  123. display: flex;
  124. align-items: flex-end;
  125. justify-content: center;
  126. background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));
  127. letter-spacing: 5px;
  128. font-size: 50upx;
  129. opacity: 0;
  130. pointer-events: none;
  131. transition: all 0.4s;
  132. background-color: #242424;
  133. }
  134. .DrawerClose.show {
  135. opacity: 1;
  136. pointer-events: all;
  137. width: 15vw;
  138. color: #fff;
  139. background-color: #242424;
  140. }
  141. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  142. width: 64upx;
  143. height: 64upx;
  144. line-height: 64upx;
  145. margin: 0;
  146. display: inline-block;
  147. background-color: #242424;
  148. }
  149. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  150. margin: 0;
  151. }
  152. .DrawerPage .nav {
  153. flex: 1;
  154. }
  155. .DrawerPage .nav .cu-item.cur {
  156. border-bottom: 0;
  157. position: relative;
  158. }
  159. .DrawerPage .nav .cu-item.cur::after {
  160. content: "";
  161. width: 10upx;
  162. height: 10upx;
  163. background-color: currentColor;
  164. position: absolute;
  165. bottom: 10upx;
  166. border-radius: 10upx;
  167. left: 0;
  168. right: 0;
  169. margin: auto;
  170. }
  171. .DrawerPage .cu-bar.tabbar .action {
  172. flex: initial;
  173. }
  174. </style>