plusDrawer.vue 4.3 KB

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