Mine.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="content">
  3. <cu-custom bgColor="bg-blacks" :isBack="false">
  4. <block slot="right">
  5. <image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image>
  6. </block>
  7. <block slot="right">
  8. <view class="icon cuIcon-notice text-white" v-if="badge != 0" style="margin-left: -70%;">
  9. <view class="cu-tag looknumber" style="margin-top: -2%;">
  10. <block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
  11. </view>
  12. </view>
  13. </block>
  14. <block slot="right">
  15. </block>
  16. <block slot="content">{{address}}</block>
  17. <block slot="right">
  18. <view class="plus" @tap="showModal" data-target="viewModal">+</view>
  19. </block>
  20. </cu-custom>
  21. <!-- 抽屉组件 -->
  22. <div>
  23. <drawer ref="drawer"></drawer>
  24. </div>
  25. <div class="plusDrawer" @tap="hideModal">
  26. <plusDrawer ref="plusDrawer"></plusDrawer>
  27. </div>
  28. <view>
  29. <button class="cu-btn bg-red lg" @tap="falseLogin" type="" :style="{ 'height': buttonHeight}">注销账号</button>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import res from '../../common/data.json';
  35. import drawer from '../../components/drawer/threeLineDrawer.vue'
  36. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  37. export default {
  38. components: {
  39. "drawer": drawer,
  40. plusDrawer: plusDrawer
  41. },
  42. data:function(){
  43. return{
  44. badge: 22,
  45. inconList:["form","favor","question","edit"],
  46. modalName:null,
  47. buttonHeight:'',
  48. address: '宁夏新能源公司',
  49. drawerList: [{
  50. "name": "首页"
  51. },
  52. {
  53. "name": "状态监视"
  54. },
  55. {
  56. "name": "矩阵监视"
  57. },
  58. {
  59. "name": "风场监视"
  60. },
  61. {
  62. "name": "人员监视"
  63. },
  64. ],
  65. plusDrawerList: [{
  66. name: '宁夏新能源公司',
  67. windPowerStationId: 'NINGXIAXINNENGYUANGONGSI'
  68. },
  69. {
  70. name: '牛首山风电场',
  71. windPowerStationId: 'NSS_FDC'
  72. },
  73. {
  74. name: '香山风电场',
  75. windPowerStationId: 'XS_FDC'
  76. },
  77. {
  78. name: '石板泉风电场',
  79. windPowerStationId: 'SBQ_FDC'
  80. },
  81. {
  82. name: '青山风电场',
  83. windPowerStationId: 'QS_FDC'
  84. },
  85. {
  86. name: '麻黄山风电场',
  87. windPowerStationId: 'MHS_FDC'
  88. }
  89. ],
  90. }
  91. },
  92. onHide() {
  93. this.$refs.drawer.closeDrawer();
  94. this.hideModal();
  95. },
  96. onShow(){
  97. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  98. this.address = this.getWindPowerStationNameToSessionStorage();
  99. },
  100. methods:{
  101. openDrawer:function(){
  102. this.$refs.drawer.openDrawer(250,this.drawerList,this.inconList);
  103. },
  104. closeDrawer:function(){
  105. this.drawerIsShow=false;
  106. },
  107. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  108. uni.setStorageSync('windpowerstationName', windpowerstationName);
  109. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  110. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  111. //this.common.goback('/pages/index/Index');
  112. },
  113. getWindPowerStationNameToSessionStorage() {
  114. uni.getStorageSync('windpowerstationName');
  115. return uni.getStorageSync('windpowerstationName');
  116. },
  117. showModal(e) {
  118. this.modalName = e.currentTarget.dataset.target;
  119. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  120. },
  121. hideModal() {
  122. this.modalName = null;
  123. this.$refs.plusDrawer.hideModal(this.modalName);
  124. },
  125. falseLogin: function() {
  126. this.removeUsernamePassword();
  127. uni.navigateTo({
  128. url: '/components/login/Login'
  129. });
  130. },
  131. removeUsernamePassword: function() {
  132. uni.removeStorageSync('gyeeusername');
  133. uni.removeStorageSync('gyeepassword');
  134. },
  135. }
  136. };
  137. </script>
  138. <style>
  139. body {
  140. font-family: '方正兰亭细黑_GBK';
  141. font-size: 20px;
  142. color: silver;
  143. background: #000;
  144. }
  145. @font-face {
  146. font-family: '方正兰亭细黑_GBK';
  147. src: url(../../static/fzltxh.TTF);
  148. }
  149. page {
  150. background-color: #1f1f1f;
  151. font-family: '方正兰亭细黑_GBK';
  152. overflow-x: hidden;
  153. }
  154. .top {
  155. width: 100%;
  156. height: 130upx;
  157. padding-top: 5upx;
  158. background-color: #1f1f1f;
  159. position: fixed;
  160. top: 0px;
  161. left: 0px;
  162. z-index: 100;
  163. }
  164. .threeLine {
  165. width: 50px;
  166. height: 45px;
  167. float: left;
  168. }
  169. .text {
  170. width: calc(100% - 100px);
  171. height: 45px;
  172. float: left;
  173. user-select: text;
  174. -webkit-user-select: text;
  175. -moz-user-select: text;
  176. -ms-user-select: text;
  177. color: silver;
  178. line-height: 45px;
  179. margin-top: 11px;
  180. font-size: 18px;
  181. }
  182. .notice {
  183. width: 50px;
  184. height: 45px;
  185. float: left;
  186. }
  187. .plus {
  188. width: 30px;
  189. height: 45px;
  190. float: right;
  191. color: white;
  192. font-size: 35px;
  193. line-height: 45px;
  194. text-align: right;
  195. margin-right: 2.5%;
  196. }
  197. .textWindpowerstation{
  198. width: 180px;
  199. height: 45px;
  200. float: left;
  201. text-align: center;
  202. margin-left: 18px;
  203. }
  204. .cu-btn {
  205. width: 80%;
  206. height: 40px;
  207. margin-left: 10%;
  208. margin-top: 25px;
  209. }
  210. </style>