Mine.vue 5.6 KB

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