Task.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. </template>
  30. <script>
  31. import res from '../../common/data.json';
  32. import drawer from '../../components/drawer/threeLineDrawer.vue'
  33. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  34. export default {
  35. components: {
  36. "drawer": drawer,
  37. plusDrawer: plusDrawer
  38. },
  39. data:function(){
  40. return{
  41. badge: 22,
  42. inconList:["form","favor","question","edit"],
  43. modalName:null,
  44. address: '宁夏新能源公司',
  45. drawerList: [{
  46. "name": "首页"
  47. },
  48. {
  49. "name": "状态监视"
  50. },
  51. {
  52. "name": "矩阵监视"
  53. },
  54. {
  55. "name": "风场监视"
  56. },
  57. {
  58. "name": "人员监视"
  59. },
  60. ],
  61. plusDrawerList: [{
  62. name: '宁夏新能源公司',
  63. windPowerStationId: 'NINGXIAXINNENGYUANGONGSI'
  64. },
  65. {
  66. name: '牛首山风电场',
  67. windPowerStationId: 'NSS_FDC'
  68. },
  69. {
  70. name: '香山风电场',
  71. windPowerStationId: 'XS_FDC'
  72. },
  73. {
  74. name: '石板泉风电场',
  75. windPowerStationId: 'SBQ_FDC'
  76. },
  77. {
  78. name: '青山风电场',
  79. windPowerStationId: 'QS_FDC'
  80. },
  81. {
  82. name: '麻黄山风电场',
  83. windPowerStationId: 'MHS_FDC'
  84. }
  85. ],
  86. }
  87. },
  88. onHide() {
  89. this.$refs.drawer.closeDrawer();
  90. this.hideModal();
  91. },
  92. onShow(){
  93. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  94. this.address = this.getWindPowerStationNameToSessionStorage();
  95. },
  96. methods:{
  97. openDrawer:function(){
  98. this.$refs.drawer.openDrawer(250,this.drawerList,this.inconList);
  99. },
  100. closeDrawer:function(){
  101. this.drawerIsShow=false;
  102. },
  103. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  104. uni.setStorageSync('windpowerstationName', windpowerstationName);
  105. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  106. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  107. //this.common.goback('/pages/index/Index');
  108. },
  109. getWindPowerStationNameToSessionStorage() {
  110. uni.getStorageSync('windpowerstationName');
  111. return uni.getStorageSync('windpowerstationName');
  112. },
  113. openDrawer: function() {
  114. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList);
  115. },
  116. showModal(e) {
  117. this.modalName = e.currentTarget.dataset.target;
  118. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  119. },
  120. hideModal() {
  121. this.modalName = null;
  122. this.$refs.plusDrawer.hideModal(this.modalName);
  123. },
  124. }
  125. };
  126. </script>
  127. <style>
  128. body {
  129. font-family: '方正兰亭细黑_GBK';
  130. font-size: 20px;
  131. color: silver;
  132. background: #000;
  133. }
  134. @font-face {
  135. font-family: '方正兰亭细黑_GBK';
  136. src: url(../../static/fzltxh.TTF);
  137. }
  138. page {
  139. background-color: #1f1f1f;
  140. font-family: '方正兰亭细黑_GBK';
  141. overflow-x: hidden;
  142. }
  143. .top {
  144. width: 100%;
  145. height: 130upx;
  146. padding-top: 5upx;
  147. background-color: #1f1f1f;
  148. position: fixed;
  149. top: 0px;
  150. left: 0px;
  151. z-index: 100;
  152. }
  153. .threeLine {
  154. width: 50px;
  155. height: 45px;
  156. float: left;
  157. }
  158. .text {
  159. width: calc(100% - 100px);
  160. height: 45px;
  161. float: left;
  162. user-select: text;
  163. -webkit-user-select: text;
  164. -moz-user-select: text;
  165. -ms-user-select: text;
  166. color: silver;
  167. line-height: 45px;
  168. margin-top: 11px;
  169. font-size: 18px;
  170. }
  171. .notice {
  172. width: 50px;
  173. height: 45px;
  174. float: left;
  175. }
  176. .plus {
  177. width: 30px;
  178. height: 45px;
  179. float: right;
  180. color: white;
  181. font-size: 35px;
  182. line-height: 45px;
  183. text-align: right;
  184. margin-right: 2.5%;
  185. }
  186. .textWindpowerstation{
  187. width: 180px;
  188. height: 45px;
  189. float: left;
  190. text-align: center;
  191. margin-left: 18px;
  192. }
  193. </style>