123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <template>
- <view class="mine-container" :style="{height: `${windowHeight}px`}">
- <uni-nav-bar ref="refTitle" dark :fixed="true" shadow background-color="#007AFF" status-bar :title="title" />
- <!--顶部个人信息栏-->
- <view class="header-section">
- <view class="flex padding justify-between">
- <view class="flex align-center">
- <image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix"></image>
- <view @click="handleToInfo" class="user-info">
- <view class="u_title">
- 用户名:{{ name }}
- </view>
- </view>
- </view>
- <view @click="handleToInfo" class="flex align-center">
- <text>个人信息</text>
- <view class="iconfont icon-right"></view>
- </view>
- </view>
- </view>
- <view class="content-section">
- <!-- <view class="mine-actions grid col-4 text-center">
- <view class="action-item" @click="handleJiaoLiuQun">
- <view class="iconfont icon-friendfill text-pink icon"></view>
- <text class="text">交流群</text>
- </view>
- <view class="action-item" @click="handleBuilding">
- <view class="iconfont icon-service text-blue icon"></view>
- <text class="text">在线客服</text>
- </view>
- <view class="action-item" @click="handleBuilding">
- <view class="iconfont icon-community text-mauve icon"></view>
- <text class="text">反馈社区</text>
- </view>
- <view class="action-item" @click="handleBuilding">
- <view class="iconfont icon-dianzan text-green icon"></view>
- <text class="text">点赞我们</text>
- </view>
- </view> -->
- <view class="menu-list">
- <view class="list-cell list-cell-arrow" @click="handleToEditInfo">
- <view class="menu-item-box">
- <view class="iconfont icon-user menu-icon"></view>
- <view>编辑资料</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="handleAbout">
- <view class="menu-item-box">
- <view class="iconfont icon-aixin menu-icon"></view>
- <view>关于我们</view>
- </view>
- </view>
- <!-- <view class="list-cell list-cell-arrow" @click="handleToSetting">
- <view class="menu-item-box">
- <view class="iconfont icon-setting menu-icon"></view>
- <view>应用设置</view>
- </view>
- </view> -->
- <view class="list-cell list-cell-arrow" @click="version">
- <view class="menu-item-box">
- <view class="iconfont icon-version menu-icon"></view>
- <view>检查更新</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="moveReviewe">
- <view class="menu-item-box">
- <view class="iconfont icon-service menu-icon"></view>
- <view>移位单审核人</view>
- </view>
- </view>
- <view class="list-cell list-cell-arrow" @click="handleLogout">
- <view class="menu-item-box">
- <view class="iconfont icon-logout menu-icon"></view>
- <view>退出</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import storage from '@/utils/storage'
- import silenceUpdate from '@/uni_modules/rt-uni-update/js_sdk/silence-update.js' //引入静默更新
- import {
- latestEdition,
- download
- } from '@/api/wms/report.js'
- import request from '@/utils/request'
- export default {
- data() {
- return {
- name: this.$store.state.user.name,
- title: "设置",
- }
- },
- computed: {
- avatar() {
- return this.$store.state.user.avatar
- },
- windowHeight() {
- return uni.getSystemInfoSync().windowHeight - 50
- }
- },
- methods: {
- handleToInfo() {
- this.$tab.navigateTo('/pages/mine/info/index')
- },
- handleToEditInfo() {
- this.$tab.navigateTo('/pages/mine/info/edit')
- },
- handleToSetting() {
- this.$tab.navigateTo('/pages/mine/setting/index')
- },
- handleToLogin() {
- this.$tab.reLaunch('/pages/login')
- },
- handleToAvatar() {
- this.$tab.navigateTo('/pages/mine/avatar/index')
- },
- version() {
- //获取版本号,必须为数字
- let edition_number = ""
- try {
- plus.runtime.getProperty(plus.runtime.appid, (inf) => {
- edition_number = inf.versionCode
- //获取版本号,如果没有缓存的版本号再取app的版本号
- //传参
- let params = {
- edition_number: edition_number
- }
- //查询新版本接口
- latestEdition(params).then(res => {
- if (res.code === 200 && res.data) {
- let baseUrl = uni.getStorageSync("baseUrl");
- res.data.edition_url = res.data.edition_url.replace("${baseUrl}", baseUrl);
- if (res.data.package_type == 1 && res.data.edition_silence == 1) {
- //调用静默更新方法 传入下载地址
- silenceUpdate(res.data)
- } else {
- //跳转更新页面 (注意!!!如果pages.json第一页的代码里有一打开就跳转其他页面的操作,下面这行代码最好写在setTimeout里面设置延时3到5秒再执行)
- uni.navigateTo({
- url: '/uni_modules/rt-uni-update/components/rt-uni-update/rt-uni-update?obj=' +
- JSON.stringify(res.data)
- });
- }
- } else {
- uni.showToast({
- title: '已是最新版本',
- icon: 'none'
- })
- }
- });
- })
- } catch (e) {}
- },
- moveReviewe() {
- uni.navigateTo({
- url: "/pages/menu/stockMove/reviewerEdit"
- });
- },
- handleLogout() {
- this.$modal.confirm('确定注销并退出系统吗?').then(() => {
- this.$store.dispatch('LogOut').then(() => {
- this.$tab.reLaunch('/pages/index')
- })
- })
- },
- handleHelp() {
- this.$tab.navigateTo('/pages/mine/help/index')
- },
- handleAbout() {
- this.$tab.navigateTo('/pages/mine/about/index')
- },
- handleJiaoLiuQun() {
- this.$modal.showToast('QQ群:①133713780、②146013835')
- },
- handleBuilding() {
- this.$modal.showToast('模块建设中~')
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #f5f6f7;
- }
- .mine-container {
- width: 100%;
- height: 100%;
- .header-section {
- padding: 15px 15px 45px 15px;
- background-color: #3c96f3;
- color: white;
- .login-tip {
- font-size: 18px;
- margin-left: 10px;
- }
- .cu-avatar {
- border: 2px solid #eaeaea;
- .icon {
- font-size: 40px;
- }
- }
- .user-info {
- margin-left: 15px;
- .u_title {
- font-size: 18px;
- line-height: 30px;
- }
- }
- }
- .content-section {
- position: relative;
- top: -50px;
- .mine-actions {
- margin: 15px 15px;
- padding: 20px 0px;
- border-radius: 8px;
- background-color: white;
- .action-item {
- .icon {
- font-size: 28px;
- }
- .text {
- display: block;
- font-size: 13px;
- margin: 8px 0px;
- }
- }
- }
- }
- }
- </style>
|