| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196 |
- <template>
- <view class="content">
- <view class="userInfo" @click="infoHandle">
- <view class="userInfoLeft">
- <image src="/static/person.png" mode=""></image>
- </view>
- <view class="userInfoRight">
- <view>{{userName}}--{{userCode}}</view>
- <view>{{deptName}}</view>
- </view>
- </view>
- <view class="userList">
- <view class="listCell" v-for="(item,index) in listCell" :key="index">
- <image :src="item.imgPath"></image>
- <text>{{item.itemText}}</text>
- <uni-icons class="fontIcon" type="arrowright" color="#d6d6d4" size="18"></uni-icons>
- </view>
- <view class="listCell" @touchend="touchHandle">
- <image src="/static/Wd.png"></image>
- <text>版本</text>
- <text class="versionNum">{{version}}</text>
- </view>
- </view>
- <view class="btnExit">
- <button type="primary" @click="btnExit">退出登录</button>
- </view>
- </view>
- </template>
- <script>
- import { debuggerModule, installDebugger } from 'uni_modules/imengyu-IMDebuggerWindow/common/debuggerExtern.js'
- import {
- mapGetters
- } from 'vuex';
- import store from '@/store';
- export default {
- data() {
- return {
- version: '',
- touchHandleTime:0,
- listCell: [
- // {
- // imgPath:'../../static/Wa.png',
- // itemText:'服务守则'
- // },
- ]
- }
- },
- onLoad() {
- store.dispatch("GetInfo")
- // 页面
- this.updateList()
- // #ifdef APP-PLUS
- this.version = 'v' + plus.runtime.version
- // #endif
- },
- methods: {
- updateList(){
- uni.$on("updateList", (res) => {
- store.dispatch("GetInfo")
- })
- },
- touchHandle(e) {
- this.touchHandleTime++
- console.log(this.touchHandleTime)
- if(this.touchHandleTime === 5){
- this.touchHandleTime = 0
- installDebugger({
- enableRequestInterceptor: true, //默认为false,指示是否拦截网络请求,参见下一条
- showGlobalFloatWindow: true //默认为true,指定是否添加一个全局的调试按钮,点击可跳转至窗口
- });
- }
-
- },
- btnExit() {
- uni.showModal({
- title: '确定退出吗?',
- content: '退出到登录页面',
- success: function(res) {
- if (res.confirm) {
- uni.setStorageSync('Username', '');
- uni.setStorageSync('Password', '');
- uni.setStorageSync('token', '');
- uni.reLaunch({
- url: '/pages/login/login'
- });
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- infoHandle(){
- uni.navigateTo({
- url:"personDetail/personDetail?userCode="+this.userCode
- })
- }
- },
- computed: {
- ...mapGetters([
- "userCode", // 用户工号
- "userName", // 用户名称
- "deptName", // 部门名称
- ])
- }
- }
- </script>
- <style lang="scss">
- .userInfo {
- // background: url(/static/setting_banner.png) no-repeat;
- background-color: rgb(0, 122, 255);
- background-size: 100% 100%;
- width: 100%;
- height: 260rpx;
- display: flex;
- .userInfoLeft {
- width: 150rpx;
- height: 150rpx;
- border-radius: 75rpx;
- margin: 30rpx 30rpx 0rpx 30rpx;
- background: #FFFFFF;
- image {
- width: 100%;
- height: 100%;
- padding: 30rpx 20rpx 30rpx 35rpx;
- box-sizing: border-box;
- }
- }
- .userInfoRight {
- margin-top: 50rpx;
- view {
- color: #FFFFFF;
- font-size: 30rpx;
- }
- }
- }
- .userList {
- width: 100%;
- border-top: 1rpx solid #d6d6d4;
- border-bottom: 1rpx solid #d6d6d4;
- background: #FFFFFF;
- margin-top: 40rpx;
- overflow: hidden;
- .listCell {
- width: 720rpx;
- margin-left: 30rpx;
- height: 84rpx;
- line-height: 84rpx;
- border-bottom: 1rpx solid #d6d6d4;
- position: relative;
- display: flex;
- image {
- width: 40rpx;
- height: 40rpx;
- margin: 22rpx 22rpx 0 22rpx;
- box-sizing: border-box;
- }
- .fontIcon {
- position: absolute;
- right: 40rpx;
- }
- .versionNum {
- position: absolute;
- right: 80rpx;
- color: #999998;
- }
- }
- .listCell:last-child {
- border: none;
- }
- }
- .btnExit {
- width: 80%;
- margin: 30rpx auto;
- }
- </style>
|