index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <template>
  2. <view class="my_box">
  3. <view class="my_info">
  4. <view class="my_info_logo_wai">
  5. <view class="my_info_logo">
  6. {{userinfo.username.slice(0,1)}}
  7. </view>
  8. </view>
  9. <view class="my_info_name">{{userinfo.username}}</view>
  10. </view>
  11. <view class="my_tab">
  12. <view class="my_tab_item" v-for="item,index in tablist" :key="index" @click="myskip(index)">
  13. <view class="item_name">
  14. {{item}}
  15. </view>
  16. <view class="item_info">
  17. <view class="" v-if="index==3">
  18. {{ids}}
  19. </view>
  20. <view class="item_info_dian" v-if="index==3&&newversion">
  21. </view>
  22. <u-icon name="arrow-right" color="#606060"></u-icon>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. import {mapMutations} from 'vuex';
  30. export default {
  31. data() {
  32. return {
  33. userinfo: {
  34. theme_info: {
  35. logo_url: ""
  36. },
  37. username: ""
  38. },
  39. tablist: ["个人中心", "监测日志", "监督记录", "版本信息", "我的轨迹"],
  40. newversion: false,
  41. ids: plus.runtime.version
  42. }
  43. },
  44. watch: {
  45. videoData(news, old) {
  46. console.log('触发了2222222222222222222222')
  47. console.log(news)
  48. uni.switchTab({
  49. url: '../response/index'
  50. })
  51. // if (news) {
  52. // }
  53. },
  54. },
  55. computed: {
  56. // 视频消息
  57. videoData() {
  58. return this.$store.state.video
  59. },
  60. },
  61. methods: {
  62. ...mapMutations(['updateUserInfo']),
  63. async getinfo() {
  64. const res = await this.$myRequest({
  65. url: '/api/api_gateway?method=sysmenage.usermanager.user_info',
  66. })
  67. console.log(res)
  68. this.userinfo = res
  69. this.updateUserInfo(res);
  70. this.getversions()
  71. },
  72. async getversions() {
  73. const res = await this.$myRequest({
  74. url: '/api/api_gateway?method=app.my.get_app_history',
  75. data: {
  76. current_version: this.ids
  77. }
  78. })
  79. if (res.new_app.app_version) {
  80. console.log(this.ids.match(/\d+/g).join(""))
  81. var news = res.new_app.app_version.match(/\d+/g).join("")
  82. var old = this.ids.match(/\d+/g).join("")
  83. if (news > old) {
  84. this.newversion = true
  85. } else {
  86. this.newversion = false
  87. }
  88. }
  89. },
  90. myskip(index) {
  91. if (index == 0) {
  92. uni.navigateTo({
  93. url: './myinfo',
  94. });
  95. } else if (index == 1) {
  96. uni.navigateTo({
  97. url: './monitorlog',
  98. });
  99. } else if (index == 2) {
  100. uni.navigateTo({
  101. url: './mymonit',
  102. });
  103. } else if (index == 3) {
  104. uni.navigateTo({
  105. url: './version',
  106. });
  107. }else if (index == 4) {
  108. uni.navigateTo({
  109. url: '/pages/my/map',
  110. });
  111. }
  112. }
  113. },
  114. onLoad() {
  115. this.getinfo()
  116. }
  117. }
  118. </script>
  119. <style lang="less">
  120. // page{
  121. // background-color: #f7f7f7;
  122. // }
  123. .my_box {
  124. width: 100%;
  125. height: 100vh;
  126. background-image: url(../../static/image/geren.jpg);
  127. background-size: 100%;
  128. background-repeat: no-repeat;
  129. .my_info {
  130. width: 90%;
  131. padding-top: 150rpx;
  132. text-align: center;
  133. margin: 0 auto;
  134. .my_info_logo_wai {
  135. width: 232rpx;
  136. height: 232rpx;
  137. border-radius: 50%;
  138. margin: 0 auto 30rpx;
  139. background-color: rgba(255, 255, 255, 0.15);
  140. display: flex;
  141. justify-content: space-around;
  142. align-items: center;
  143. // box-shadow: 5px 10px 5px #888888;
  144. .my_info_logo {
  145. width: 200rpx;
  146. height: 200rpx;
  147. // margin: 0 auto 30rpx;
  148. border-radius: 50%;
  149. background-image: linear-gradient(#addbff, #5cacff);
  150. // background-color: #409eff;
  151. color: #fff;
  152. line-height: 200rpx;
  153. font-size: 80rpx;
  154. .my_info_logo_bg {}
  155. }
  156. }
  157. .my_info_name {
  158. color: #fff;
  159. font-size: 34rpx;
  160. }
  161. }
  162. .my_tab {
  163. width: 90%;
  164. padding-top: 150rpx;
  165. margin: 0 auto;
  166. .my_tab_item {
  167. display: flex;
  168. padding: 30rpx 0;
  169. border-bottom: 1px solid #F6F6F6;
  170. justify-content: space-between;
  171. .item_name {
  172. color: #606060;
  173. }
  174. .item_info {
  175. display: flex;
  176. color: #606060;
  177. .item_info_dian {
  178. width: 10rpx;
  179. height: 10rpx;
  180. background-color: red;
  181. border-radius: 50%;
  182. margin: 0 5rpx;
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>