Task.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <view class="content">
  3. <cu-custom bgColor="bg-blacks" :isBack="false">
  4. <block slot="right"><image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image></block>
  5. <block slot="right">
  6. <view class="icon cuIcon-notice text-white" v-if="badge != 0" style="margin-left: -70%;">
  7. <view class="cu-tag looknumber" style="margin-top: -2%;">
  8. <block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
  9. </view>
  10. </view>
  11. </block>
  12. <block slot="right"></block>
  13. <block slot="content">{{ address }}</block>
  14. <block slot="right"><view class="plus" @tap="showModal" data-target="viewModal">+</view></block>
  15. </cu-custom>
  16. <!-- 抽屉组件 -->
  17. <div><drawer ref="drawer"></drawer></div>
  18. <div class="plusDrawer" @tap="hideModal"><plusDrawer ref="plusDrawer"></plusDrawer></div>
  19. <scroll-view @tap="hideModal" scroll-y class="DrawerPage" :class="modalName == 'viewModal' ? 'show' : ''">
  20. <!-- 任务组件 -->
  21. <!-- <view class="taskcard "v-if="play">
  22. <view class="tasktab " @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)"><view class="cu-tag solids-bottom" :class="'line-white'">任务一</view></view>
  23. <view class="taskcontent flex align-center" style="color: #FFFFFF;" @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)">
  24. <view class="flex-subs text-center"><view class="padding">用于摘要或阅读文本页面默认字号</view></view>
  25. </view>
  26. <view class="taskbutton align-center padding">
  27. <button class="cu-btn bg-colorlan">确认</button>
  28. <button class="cu-btn bg-color24" @click="hiddencard">取消</button>
  29. </view>
  30. </view> -->
  31. <!-- 任务组件 -->
  32. <view class="taskcard " v-if="play">
  33. <view class="tasktab" @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)"><view class="cu-tag solids-bottom" :class="'line-white'">任务二</view></view>
  34. <view class="taskcontent flex align-center" style="color: #FFFFFF;" @tap="common.navTo('/components/task/taskCard/taskCard?taskName=' + taskName)">
  35. <view class="flex-subs text-center"><view class="padding">用于摘要或阅读文本页面默认字号</view></view>
  36. </view>
  37. <view class="taskbutton align-center padding">
  38. <button class="cu-btn bg-colorlan">确认</button>
  39. <button class="cu-btn bg-color24" @click="hiddencard">取消</button>
  40. </view>
  41. </view>
  42. </scroll-view>
  43. </view>
  44. </template>
  45. <script>
  46. import res from '../../common/data.json';
  47. import drawer from '../../components/drawer/threeLineDrawer.vue';
  48. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  49. export default {
  50. components: {
  51. drawer: drawer,
  52. plusDrawer: plusDrawer
  53. },
  54. data: function() {
  55. return {
  56. taskName: '任务',
  57. badge: 22,
  58. inconList: ['form', 'favor', 'question', 'edit'],
  59. modalName: null,
  60. address: '宁夏新能源公司',
  61. play:true,
  62. drawerList: [
  63. {
  64. name: '首页'
  65. },
  66. {
  67. name: '状态监视'
  68. },
  69. {
  70. name: '矩阵监视'
  71. },
  72. {
  73. name: '风场监视'
  74. },
  75. {
  76. name: '人员监视'
  77. }
  78. ],
  79. plusDrawerList: [
  80. {
  81. name: '宁夏新能源公司',
  82. windPowerStationId: 'NINGXIAXINNENGYUANGONGSI'
  83. },
  84. {
  85. name: '牛首山风电场',
  86. windPowerStationId: 'NSS_FDC'
  87. },
  88. {
  89. name: '香山风电场',
  90. windPowerStationId: 'XS_FDC'
  91. },
  92. {
  93. name: '石板泉风电场',
  94. windPowerStationId: 'SBQ_FDC'
  95. },
  96. {
  97. name: '青山风电场',
  98. windPowerStationId: 'QS_FDC'
  99. },
  100. {
  101. name: '麻黄山风电场',
  102. windPowerStationId: 'MHS_FDC'
  103. }
  104. ]
  105. };
  106. },
  107. onHide() {
  108. this.$refs.drawer.closeDrawer();
  109. this.hideModal();
  110. },
  111. onShow() {
  112. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  113. this.address = this.getWindPowerStationNameToSessionStorage();
  114. },
  115. methods: {
  116. openDrawer: function() {
  117. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList);
  118. },
  119. closeDrawer: function() {
  120. this.drawerIsShow = false;
  121. },
  122. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  123. uni.setStorageSync('windpowerstationName', windpowerstationName);
  124. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  125. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  126. //this.common.goback('/pages/index/Index');
  127. },
  128. getWindPowerStationNameToSessionStorage() {
  129. uni.getStorageSync('windpowerstationName');
  130. return uni.getStorageSync('windpowerstationName');
  131. },
  132. openDrawer: function() {
  133. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList);
  134. },
  135. showModal(e) {
  136. this.modalName = e.currentTarget.dataset.target;
  137. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  138. },
  139. hideModal() {
  140. this.modalName = null;
  141. this.$refs.plusDrawer.hideModal(this.modalName);
  142. },
  143. hiddencard(){
  144. this.play = false;
  145. }
  146. }
  147. };
  148. </script>
  149. <style>
  150. body {
  151. font-family: '方正兰亭细黑_GBK';
  152. font-size: 20px;
  153. color: silver;
  154. background: #fff;
  155. }
  156. @font-face {
  157. font-family: '方正兰亭细黑_GBK';
  158. src: url(../../static/fzltxh.TTF);
  159. }
  160. page {
  161. background-color: #1f1f1f;
  162. font-family: '方正兰亭细黑_GBK';
  163. overflow-x: hidden;
  164. }
  165. .top {
  166. width: 100%;
  167. height: 130upx;
  168. padding-top: 5upx;
  169. background-color: #1f1f1f;
  170. position: fixed;
  171. top: 0px;
  172. left: 0px;
  173. z-index: 100;
  174. }
  175. .threeLine {
  176. width: 50px;
  177. height: 45px;
  178. float: left;
  179. }
  180. .text {
  181. width: calc(100% - 100px);
  182. height: 45px;
  183. float: left;
  184. user-select: text;
  185. -webkit-user-select: text;
  186. -moz-user-select: text;
  187. -ms-user-select: text;
  188. color: silver;
  189. line-height: 45px;
  190. margin-top: 11px;
  191. font-size: 18px;
  192. }
  193. .notice {
  194. width: 50px;
  195. height: 45px;
  196. float: left;
  197. }
  198. .plus {
  199. width: 30px;
  200. height: 45px;
  201. float: right;
  202. color: white;
  203. font-size: 35px;
  204. line-height: 45px;
  205. text-align: right;
  206. margin-right: 2.5%;
  207. }
  208. .textWindpowerstation {
  209. width: 180px;
  210. height: 45px;
  211. float: left;
  212. text-align: center;
  213. margin-left: 18px;
  214. }
  215. .taskcard {
  216. margin-left: 10%;
  217. width: 80%;
  218. height: 200px;
  219. margin-top: 3%;
  220. background-color: #242424;
  221. }
  222. .tasktab {
  223. height: 30px;
  224. width: 100%;
  225. margin-left: 3%;
  226. margin-top: 3%;
  227. }
  228. .taskcontent {
  229. height: 100px;
  230. }
  231. .taskbutton {
  232. width: 100%;
  233. height: 50px;
  234. }
  235. .cu-tag {
  236. float: left;
  237. }
  238. .solids-bottom::after {
  239. border: 0px solid #eee;
  240. }
  241. .cu-btn {
  242. float: right;
  243. margin-left: 3px;
  244. }
  245. .DrawerPage {
  246. position: fixed;
  247. width: 100vw;
  248. height: 100vh;
  249. left: 0vw;
  250. background-color: #1f1f1f;
  251. transition: all 0.4s;
  252. }
  253. .DrawerPage.show {
  254. transform: scale(0.9, 0.9);
  255. left: 85vw;
  256. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  257. transform-origin: 0;
  258. }
  259. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  260. width: 64upx;
  261. height: 64upx;
  262. line-height: 64upx;
  263. margin: 0;
  264. display: inline-block;
  265. }
  266. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  267. margin: 0;
  268. }
  269. .DrawerPage .nav {
  270. flex: 1;
  271. }
  272. .DrawerPage .nav .cu-item.cur {
  273. border-bottom: 0;
  274. position: relative;
  275. }
  276. .DrawerPage .nav .cu-item.cur::after {
  277. content: '';
  278. width: 10upx;
  279. height: 10upx;
  280. background-color: currentColor;
  281. position: absolute;
  282. bottom: 10upx;
  283. border-radius: 10upx;
  284. left: 0;
  285. right: 0;
  286. margin: auto;
  287. }
  288. .DrawerPage .cu-bar.tabbar .action {
  289. flex: initial;
  290. }
  291. .bg-color24:active{
  292. background-color: #a1a1a1;
  293. opacity: 0.8;
  294. }
  295. .bg-colorlan:active{
  296. background-color: #00aaff;
  297. opacity: 0.8;
  298. }
  299. </style>