| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- <template>
- <view class="my_box">
- <view class="my_info">
- <view class="my_info_logo_wai">
- <view class="my_info_logo">
- {{userinfo.username.slice(0,1)}}
- </view>
- </view>
- <view class="my_info_name">{{userinfo.username}}</view>
- </view>
- <view class="my_tab">
- <view class="my_tab_item" v-for="item,index in tablist" :key="index" @click="myskip(index)">
- <view class="item_name">
- {{item}}
- </view>
- <view class="item_info">
- <view class="" v-if="index==3">
- {{ids}}
- </view>
- <view class="item_info_dian" v-if="index==3&&newversion">
- </view>
- <u-icon name="arrow-right" color="#606060"></u-icon>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {mapMutations} from 'vuex';
- export default {
- data() {
- return {
- userinfo: {
- theme_info: {
- logo_url: ""
- },
- username: ""
- },
- tablist: ["个人中心", "监测日志", "监督记录", "版本信息", "我的轨迹"],
- newversion: false,
- ids: plus.runtime.version
- }
- },
- watch: {
- videoData(news, old) {
- console.log('触发了2222222222222222222222')
- console.log(news)
- uni.switchTab({
- url: '../response/index'
- })
- // if (news) {
- // }
- },
- },
- computed: {
- // 视频消息
- videoData() {
- return this.$store.state.video
- },
- },
- methods: {
- ...mapMutations(['updateUserInfo']),
- async getinfo() {
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=sysmenage.usermanager.user_info',
- })
- console.log(res)
- this.userinfo = res
- this.updateUserInfo(res);
- this.getversions()
- },
- async getversions() {
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=app.my.get_app_history',
- data: {
- current_version: this.ids
- }
- })
- if (res.new_app.app_version) {
- console.log(this.ids.match(/\d+/g).join(""))
- var news = res.new_app.app_version.match(/\d+/g).join("")
- var old = this.ids.match(/\d+/g).join("")
- if (news > old) {
- this.newversion = true
- } else {
- this.newversion = false
- }
- }
- },
- myskip(index) {
- if (index == 0) {
- uni.navigateTo({
- url: './myinfo',
- });
- } else if (index == 1) {
- uni.navigateTo({
- url: './monitorlog',
- });
- } else if (index == 2) {
- uni.navigateTo({
- url: './mymonit',
- });
- } else if (index == 3) {
- uni.navigateTo({
- url: './version',
- });
- }else if (index == 4) {
- uni.navigateTo({
- url: '/pages/my/map',
- });
- }
- }
- },
- onLoad() {
- this.getinfo()
- }
- }
- </script>
- <style lang="less">
- // page{
- // background-color: #f7f7f7;
- // }
- .my_box {
- width: 100%;
- height: 100vh;
- background-image: url(../../static/image/geren.jpg);
- background-size: 100%;
- background-repeat: no-repeat;
- .my_info {
- width: 90%;
- padding-top: 150rpx;
- text-align: center;
- margin: 0 auto;
- .my_info_logo_wai {
- width: 232rpx;
- height: 232rpx;
- border-radius: 50%;
- margin: 0 auto 30rpx;
- background-color: rgba(255, 255, 255, 0.15);
- display: flex;
- justify-content: space-around;
- align-items: center;
- // box-shadow: 5px 10px 5px #888888;
- .my_info_logo {
- width: 200rpx;
- height: 200rpx;
- // margin: 0 auto 30rpx;
- border-radius: 50%;
- background-image: linear-gradient(#addbff, #5cacff);
- // background-color: #409eff;
- color: #fff;
- line-height: 200rpx;
- font-size: 80rpx;
- .my_info_logo_bg {}
- }
- }
- .my_info_name {
- color: #fff;
- font-size: 34rpx;
- }
- }
- .my_tab {
- width: 90%;
- padding-top: 150rpx;
- margin: 0 auto;
- .my_tab_item {
- display: flex;
- padding: 30rpx 0;
- border-bottom: 1px solid #F6F6F6;
- justify-content: space-between;
- .item_name {
- color: #606060;
- }
- .item_info {
- display: flex;
- color: #606060;
- .item_info_dian {
- width: 10rpx;
- height: 10rpx;
- background-color: red;
- border-radius: 50%;
- margin: 0 5rpx;
- }
- }
- }
- }
- }
- </style>
|