Mine.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 v-if="toggleid==12">
  32. <mine ref="r1"></mine>
  33. </view>
  34. <view v-if="toggleid==13">
  35. <chatindex ref="r1"></chatindex>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import res from '../../common/data.json';
  41. import drawer from '../../components/drawer/threeLineDrawer.vue'
  42. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  43. import mine from '../../components/mine/Mine.vue';
  44. import chatindex from '../../components/mine/chat/Chatindex.vue';
  45. export default {
  46. components: {
  47. drawer: drawer,
  48. plusDrawer: plusDrawer,
  49. mine:mine,
  50. chatindex:chatindex
  51. },
  52. data:function(){
  53. return{
  54. toggleid:12,//12我的主页,13聊天通讯,默认12
  55. badge: 22,
  56. inconList:["form","favor","question","edit"],
  57. modalName:null,
  58. leftNavigationtitle:'我的功能分组',
  59. buttonHeight:'',
  60. address: '',
  61. drawerList: [
  62. {"name":"聊天通讯"},
  63. ],
  64. plusDrawerList: [],
  65. }
  66. },created: function() {
  67. this.viewUserid();
  68. this.monitoringAuthority();
  69. this.address = this.dataprocessing.getWindPowerStationName();
  70. this.FDC=this.dataprocessing.getWindPowerStationId();
  71. this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
  72. this.plusDrawerList=uni.getStorageSync('plusList');
  73. this.drawerList=uni.getStorageSync('leftlist5');
  74. console.log(this.drawerList);
  75. },
  76. onHide() {
  77. this.$refs.drawer.closeDrawer();
  78. this.hideModal();
  79. },
  80. onShow(){
  81. this.viewUserid();
  82. this.monitoringAuthority();
  83. this.address = this.dataprocessing.getWindPowerStationName();
  84. this.FDC=this.dataprocessing.getWindPowerStationId();
  85. this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
  86. },
  87. methods:{
  88. openDrawer: function() {
  89. if(this.$refs.drawer != undefined){
  90. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList,this.leftNavigationtitle);
  91. }else{
  92. }
  93. },
  94. closeDrawer: function() {
  95. this.drawerIsShow = false;
  96. },viewUserid: function() {
  97. this.plusDrawerList=uni.getStorageSync('plusList');
  98. },
  99. monitoringAuthority: function() {
  100. this.drawerList=uni.getStorageSync('leftlist5');
  101. },
  102. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  103. uni.setStorageSync('windpowerstationName', windpowerstationName);
  104. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  105. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  106. //this.common.goback('/pages/index/Index');
  107. },
  108. getWindPowerStationNameToSessionStorage() {
  109. uni.getStorageSync('windpowerstationName');
  110. return uni.getStorageSync('windpowerstationName');
  111. },
  112. showModal(e) {
  113. this.modalName = e.currentTarget.dataset.target;
  114. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  115. },
  116. hideModal() {
  117. this.modalName = null;
  118. this.$refs.plusDrawer.hideModal(this.modalName);
  119. },
  120. falseLogin: function() {
  121. this.removeUsernamePassword();
  122. uni.navigateTo({
  123. url: '/components/login/Login'
  124. });
  125. },
  126. removeUsernamePassword: function() {
  127. uni.removeStorageSync('gyeeusername');
  128. uni.removeStorageSync('gyeepassword');
  129. },
  130. }
  131. };
  132. </script>
  133. <style>
  134. body {
  135. font-family: '方正兰亭细黑_GBK';
  136. font-size: 20px;
  137. color: silver;
  138. background: #000;
  139. }
  140. @font-face {
  141. font-family: '方正兰亭细黑_GBK';
  142. src: url(../../static/fzltxh.TTF);
  143. }
  144. page {
  145. background-color: #1f1f1f;
  146. font-family: '方正兰亭细黑_GBK';
  147. overflow-x: hidden;
  148. }
  149. .top {
  150. width: 100%;
  151. height: 130upx;
  152. padding-top: 5upx;
  153. background-color: #1f1f1f;
  154. position: fixed;
  155. top: 0px;
  156. left: 0px;
  157. z-index: 100;
  158. }
  159. .threeLine {
  160. width: 50px;
  161. height: 45px;
  162. float: left;
  163. }
  164. .text {
  165. width: calc(100% - 100px);
  166. height: 45px;
  167. float: left;
  168. user-select: text;
  169. -webkit-user-select: text;
  170. -moz-user-select: text;
  171. -ms-user-select: text;
  172. color: silver;
  173. line-height: 45px;
  174. margin-top: 11px;
  175. font-size: 18px;
  176. }
  177. .notice {
  178. width: 50px;
  179. height: 45px;
  180. float: left;
  181. }
  182. .plus {
  183. width: 30px;
  184. height: 45px;
  185. float: right;
  186. color: white;
  187. font-size: 35px;
  188. line-height: 45px;
  189. text-align: right;
  190. margin-right: 2.5%;
  191. }
  192. .textWindpowerstation{
  193. width: 180px;
  194. height: 45px;
  195. float: left;
  196. text-align: center;
  197. margin-left: 18px;
  198. }
  199. .cu-btn {
  200. width: 80%;
  201. height: 40px;
  202. margin-left: 10%;
  203. margin-top: 25px;
  204. }
  205. </style>