mine.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <template>
  2. <view>
  3. <img src="../../static/mine/banner.png" class="banner" />
  4. <div class="info">
  5. <div class="headerandwelcome">
  6. <img src="../../static/mine/head.png" alt="" class="header" />
  7. <div class="weltxt">
  8. {{ getUserLocalStorageInfo.user.truename }},欢迎您!
  9. </div>
  10. </div>
  11. <div class="labelpage">
  12. <div class="labelpage_row">
  13. <img height="44rpx" src="../../static/mine/versionicon.png" alt="" />
  14. <div class="labelpage_text">
  15. <div class="labelpage_name">当前版本号</div>
  16. <div class="labelpage_value">v1.0.1</div>
  17. <div class="border"></div>
  18. </div>
  19. </div>
  20. <div
  21. class="labelpage_row"
  22. style="margin-top: 48rpx"
  23. @click="editPassWord()"
  24. >
  25. <img height="44rpx" src="../../static/mine/editpassword.png" alt="" />
  26. <div class="labelpage_text">
  27. <div class="labelpage_name">密码修改</div>
  28. <div class="labelpage_value">
  29. <img
  30. src="../../static/mine/youjiantou.png"
  31. style="width: 44rpx; height: 44rpx"
  32. alt=""
  33. />
  34. </div>
  35. <div class="border"></div>
  36. </div>
  37. </div>
  38. <div
  39. class="labelpage_row"
  40. style="margin-top: 48rpx"
  41. @click="changeUserType"
  42. >
  43. <img height="44rpx" src="../../static/mine/editpassword.png" alt="" />
  44. <div class="labelpage_text">
  45. <div class="labelpage_name">切换账号</div>
  46. <div class="labelpage_value">
  47. <img
  48. src="../../static/mine/youjiantou.png"
  49. style="width: 44rpx; height: 44rpx"
  50. alt=""
  51. />
  52. </div>
  53. <div class="border"></div>
  54. </div>
  55. </div>
  56. <div
  57. class="labelpage_row"
  58. style="margin-top: 48rpx"
  59. @click="outLogin()"
  60. >
  61. <img height="44rpx" src="../../static/mine/outicon.png" alt="" />
  62. <div class="labelpage_text">
  63. <div class="labelpage_name">退出账号</div>
  64. <div class="labelpage_value">
  65. <img
  66. src="../../static/mine/youjiantou.png"
  67. style="width: 44rpx; height: 44rpx"
  68. alt=""
  69. />
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </view>
  76. </template>
  77. <script>
  78. import { getUserInfo, getUserLocalStorageInfo } from "@/js_sdk/http";
  79. export default {
  80. data() {
  81. return {
  82. userInfo: {},
  83. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  84. userType: true
  85. };
  86. },
  87. onLoad() {
  88. //option为object类型,会序列化上个页面传递的参数
  89. // this.getUserInfo(); //打印出上个页面传递的参数。
  90. },
  91. methods: {
  92. changeUserType(){
  93. this.$nextTick(()=>{
  94. uni.switchTab({
  95. url: "/pages/index/index",
  96. success: function (e) {
  97. uni.$emit('userType', 'OK')
  98. }
  99. })
  100. })
  101. },
  102. outLogin() {
  103. wx.showModal({
  104. title: "提示!",
  105. content: "是否确认退出登录?",
  106. success: function (res) {
  107. if (res.confirm) {
  108. uni.clearStorageSync();
  109. uni.reLaunch({
  110. url: "/pages/login/login",
  111. });
  112. }
  113. },
  114. });
  115. },
  116. editPassWord() {
  117. uni.navigateTo({
  118. url: "/pages/subPackages/password/index",
  119. });
  120. },
  121. async getUserInfo() {
  122. let data = await getUserInfo();
  123. this.userInfo = data.data;
  124. },
  125. },
  126. };
  127. </script>
  128. <style scoped lang="scss">
  129. .banner {
  130. width: 100%;
  131. //height: 424rpx;
  132. position: absolute;
  133. z-index: 1;
  134. }
  135. .headerandwelcome {
  136. margin-bottom: 60rpx;
  137. height: 120rpx;
  138. width: 100%;
  139. }
  140. .info {
  141. position: absolute;
  142. width: calc(100% - 64rpx);
  143. margin: 60rpx 32rpx 0 32rpx;
  144. z-index: 2;
  145. }
  146. .header {
  147. height: 120rpx;
  148. width: 120rpx;
  149. margin-left: 15rpx;
  150. border-radius: 50%;
  151. float: left;
  152. }
  153. .weltxt {
  154. height: 120rpx;
  155. line-height: 120rpx;
  156. color: #ffffff;
  157. margin-left: 32rpx;
  158. float: left;
  159. }
  160. .labelpage {
  161. width: calc(100% - 96rpx);
  162. height: 388rpx;
  163. padding: 96rpx 48rpx;
  164. border-radius: 12rpx 12rpx 12rpx 12rpx;
  165. background: #ffffff;
  166. }
  167. .labelpage_row {
  168. height: 83rpx;
  169. width: 100%;
  170. img {
  171. height: 44rpx;
  172. width: 44rpx;
  173. float: left;
  174. margin-right: 12rpx;
  175. }
  176. .labelpage_text {
  177. width: calc(100% - 64rpx);
  178. height: 44rpx;
  179. line-height: 44rpx;
  180. float: left;
  181. }
  182. .labelpage_name {
  183. height: 44rpx;
  184. line-height: 44rpx;
  185. float: left;
  186. font-size: 28rpx;
  187. color: #081640;
  188. font-weight: 400;
  189. }
  190. .labelpage_value {
  191. height: 44rpx;
  192. line-height: 44rpx;
  193. float: right;
  194. font-size: 28rpx;
  195. color: #1d18bc;
  196. font-weight: 400;
  197. }
  198. .border {
  199. margin-top: 48rpx;
  200. width: 100%;
  201. height: 1rpx;
  202. border-bottom: 2rpx solid #e6e6e6;
  203. float: left;
  204. }
  205. }
  206. </style>