Mine.vue 5.4 KB

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