123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <template>
- <view class="container">
- <!-- 门店信息 -->
- <view class="store">
- <view class="storeInfo">
- <image :src="personIcon" class="personImg"></image>
- <view class="storeName">
- <view>{{ pageData ? pageData.orgName : '-' }}</view>
- <view class="font28">{{ pageData ? pageData.userNameCN : '-' }}</view>
- </view>
- </view>
- </view>
- <!-- 列表 -->
- <view class="list">
- <view
- hover-class="navigator-hover"
- v-for="(item, index) in list"
- :key="index"
- @click="goToInfo(item)"
- :class="item.type != 'line' ? 'listItem' : 'lineItem'"
- v-if="((pageData && item.pageType == pageData.orgType) || !item.pageType) && item.auth"
- >
- <view class="listItemLeft" v-if="item.type != 'line'">
- <view class="leftImg">
- <u-icon :name="item.icon" size="36" :color="item.color" ></u-icon>
- </view>
- <text>{{ item.title }}</text>
- </view>
- <view v-if="item.type != 'line'">
- <text class="number">{{ item.number }}</text>
- <text class="banbenhao">{{ item.banbenhao }}</text>
- <u-icon name="arrow-right" size="24" color="#999" ></u-icon>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import { logout } from '@/api/user.js';
- import { checkVersionToLoadUpdate, clzConfirm } from '@/libs/tools';
- import market from "@/js_sdk/dc-market/market.js"
- export default {
- data() {
- const curVer = getApp().globalData.version;
- return {
- list: [
- { type: 'line', auth: true },
- {
- title: '员工信息',
- auth: true,
- url: '/pages/userCenter/personInfo',
- icon: 'account-fill',
- color: '#55aaff'
- },
- {
- title: '修改密码',
- auth: true,
- url: '/pages/userCenter/changePwd',
- icon: 'lock-fill',
- color: '#ffaa7f'
- },
- { type: 'line', auth: true },
- {
- title: '关于我们',
- auth: true,
- url: '/pages/userCenter/aboutUs',
- icon: 'question-circle-fill',
- color: '#55aaff'
- },
- {
- title: '用户协议及隐私保护政策',
- auth: true,
- url: '/pages/login/userAuthYs',
- icon: 'info-circle-fill',
- color: '#00aa00'
- },
- {
- title: '版本检查',
- auth: true,
- banbenhao: curVer.version,
- fun: 'getVersion',
- icon: 'checkmark-circle-fill',
- color: '#ffaa7f'
- },
- { type: 'line', auth: true },
- {
- title: '退出登录',
- auth: true,
- fun: 'quitOutSys',
- icon: 'play-right-fill',
- color: '#ff0000'
- }
- ],
- pageData: null, // 门店信息
- storeData: null, // 单店门店信息
- personIcon: '/static/defaultMe.png' // 默认门店图片
- };
- },
- onLoad() {},
- methods: {
- // 拨打电话
- call() {
- console.log('联系公司');
- },
- // 点击我的页面列表
- goToInfo(item) {
- if (item.url && item.url != '') {
- uni.navigateTo({
- url: item.url
- });
- }
- if (item.fun) {
- this[item.fun]();
- }
- },
- // 退出登录确认弹框
- quitOutSys() {
- const _this = this;
- clzConfirm({
- title: '提示',
- content: '确定退出登录?',
- success: function(res) {
- if (res.confirm || res.index == 0) {
- _this.quitSys();
- }
- }
- });
- },
- // 退出登录,返回登录页
- quitSys() {
- logout().then(res => {
- console.log(res);
- uni.showToast({
- icon: 'none',
- title: res.message
- });
- if (res.status == 200) {
- this.$store.commit("$closeWebsocket")
- this.$store.state.vuex_token = '';
- this.$store.state.vuex_userData = '';
- uni.setStorageSync('setStatusIndexFunc', 0);
- setTimeout(function() {
- uni.reLaunch({
- url: '/pages/login/login'
- });
- }, 1000);
- }
- });
- },
- // 获取最新版本信息
- getVersion() {
- //最新版本
- const newVer = this.$store.state.vuex_versionInfo;
- //进行版本型号的比对 以及下载更新请求
- checkVersionToLoadUpdate(newVer, 1, market);
- }
- }
- };
- </script>
- <style lang="less">
- .container {
- background: #fff;
- font-size: 28rpx;
- box-sizing: border-box;
- height: calc(100vh - var(--window-top) - var(--window-bottom) - 55px);
- overflow: auto;
- color: #666;
- // 头部门店信息
- .store {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 40rpx 30rpx;
- background: #ffffff;
- .storeInfo {
- display: flex;
- align-items: center;
- font-size: 32rpx;
- .storeName {
- view {
- padding: 6upx 0;
- &:first-child {
- font-weight: bold;
- }
- }
- .font28 {
- color: #666;
- }
- }
- .personImg {
- width: 100rpx;
- height: 100rpx;
- margin-right: 20rpx;
- border-radius: 100rpx;
- }
- .storeRightIcon {
- line-height: 58rpx;
- }
- }
- }
- // 我的页面列表
- .lineItem {
- padding: 10upx;
- background-color: #f8f8f8;
- }
- .listItem {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- padding: 20rpx 30rpx;
- border-bottom: 1px solid #efefef;
- align-items: center;
- color: #666;
- .listItemLeft {
- display: flex;
- align-items: center;
- }
- .leftImg {
- flex-grow: 1;
- padding: 10upx;
- }
- .number {
- display: inline-block;
- width: 32rpx;
- border-radius: 50%;
- color: #ffffff;
- font-size: 24rpx;
- background-color: red;
- text-align: center;
- line-height: 32rpx;
- position: relative;
- bottom: 8rpx;
- right: 20rpx;
- }
- .banbenhao {
- position: relative;
- bottom: 8rpx;
- right: 20rpx;
- }
- }
- .listItem:last-child {
- margin-bottom: 40rpx;
- }
- // logo 联系方式
- .logoContent {
- margin: 100upx 0;
- text-align: center;
- .logoImg {
- .logo {
- width: 300rpx;
- height: 105rpx;
- }
- }
- .phone {
- margin-top: 20upx;
- color: #989898;
- .phoneImg {
- position: relative;
- bottom: 8rpx;
- }
- }
- }
- }
- </style>
|