123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316 |
- <template>
- <view class="content">
- <view class="content1">
- <view class='flex flex-space-between' @click="switchPicture">
- <view>
- <text>头像</text>
- </view>
- <view style='align-items: center;' class="flex">
- <view class="pictures">
- <image :src="headUrl" class="picture"></image>
- </view>
- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- </view>
- <u-line color="#EEEEEE" class="line"></u-line>
- <view class='flex flex-space-between'>
- <view>
- <text>姓名</text>
- </view>
- <view style='align-items: center;' class="flex" @click="editName">
- <view class="username">
- {{firstAuthentication.authenticationStatus=='已认证'?firstAuthentication.driverName:firstAuthentication.authenticationStatus=='已过期'?'已过期':'未认证'}}
- </view>
- <!-- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image> -->
- </view>
- </view>
- </view>
- <view class="content2">
- <!--
- <view class='flex flex-space-between' @click='UpdataAccount'>
- <view>
- <text>修改账号</text>
- </view>
- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
- </view> -->
- <!-- <u-line color="#EEEEEE" class="line"></u-line> -->
- <view class='flex flex-space-between' @click='UpdataPassword'>
- <view>
- <text>修改密码</text>
- </view>
- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- <u-line color="#EEEEEE" class="line"></u-line>
- <view class='flex flex-space-between' @click='fankui'>
- <view>
- <text>意见反馈</text>
- </view>
- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- <u-line color="#EEEEEE" class="line"></u-line>
- <view class='flex flex-space-between' @click='clearStorage'>
- <view>
- <text>注销账号</text>
- </view>
- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image>
- </view>
- </view>
- <view class='exitloginwrap'>
- <button @click='logout()' class='exitlogin'>退出登录</button>
- </view>
- <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
- :showCancelButton='true' confirmColor='#F5BA3C' @confirm="logOut" @close="cancelClick"
- @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- var _this
- import {
- mapState
- } from 'vuex';
- // import APPUpdate, {
- // getCurrentNo
- // } from '@/uni_modules/zhouWei-APPUpdate/js_sdk/appUpdate';
- // import * as config from '@/config/index.js'
- export default {
- data() {
- return {
- alertTitle: '',
- isShowAlert: false,
- alertContent: '您确定要退出吗?',
- headUrl: "../../static/images/myimg/YongHu@3x.png",
- username: "",
- gridList: [{
- num: 0,
- name: '退出登录',
- // icon:'cuIcon-exit',
- src: '../../static/images/sign/return@3x.png',
- tips: 0,
- url: '',
- show: true
- }, ],
- version: "1.1.0" //版本号
- }
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- onShow() {
- this.getList()
- this.firstAuthentication = uni.getStorageSync("firstAuthentication")
- // // #ifdef APP-PLUS
- // this.version = plus.runtime.version
- // this.checkVersion()
- // // #endif
- },
- onLoad() {
- _this = this
- },
- methods: {
- // 检查APP是否有新版本
- // onAPPUpdate() {
- // // true 没有新版本的时候有提示,默认:false
- // if (this.version == "发现新版本,立即更新") {
- // APPUpdate(true);
- // }
- // },
- // checkVersion() { //检查版本
- // const baseUrlNew = config.def().baseUrlNew
- // uni.request({
- // url: baseUrlNew + '/appVersion/selectInfo',
- // data: {
- // appid: plus.runtime.appid,
- // version: plus.runtime.version,
- // imei: "1",
- // type: 'sj'
- // },
- // method: 'GET',
- // success: (res) => {
- // if (this.version == res.data.data.version) {
- // this.version = "当前为最新版" + this.version
- // } else {
- // this.version = "发现新版本,立即更新"
- // }
- // }
- // })
- // },
- editName() {
- uni.showToast({
- icon: 'none',
- title: '可在司机认证中修改'
- })
- },
- UpdataAccount() {
- uni.navigateTo({
- url: `/pages/mine/settings/editPhone`
- })
- },
- UpdataPassword() {
- uni.navigateTo({
- url: `/pages/mine/settings/editPassword?phone=${this.userInfo.phone}`
- })
- },
- clearStorage() {
- let that = this
- uni.clearStorageSync();
- this.$request.baseRequest('post', '/auth/api/logout').then(res => {
- if (res.code == 200) {
- that.$store.commit('logout')
- // that.$api.logout()
- uni.navigateTo({
- url: `/pages/public/login`
- })
- }
- })
- },
- cancelClick() {
- this.isShowAlert = false
- },
- logOut() {
- uni.clearStorageSync();
- this.$request.baseRequest('post', '/auth/api/logout', {}).then(res => {
- uni.removeStorage({
- key: 'userInfo'
- })
- this.isShowAlert = false
- this.$store.commit('logout')
- uni.switchTab({
- url: `/pages/goodSource/index`
- })
- })
- .catch(res => {
- uni.$u.toast(res.message);
- });
- },
- getList() {
- this.headUrl = this.userInfo.avatarUrl
- if (this.headUrl == null || this.headUrl == "") {
- this.headUrl = "../../static/images/myimg/YongHu@3x.png"
- }
- this.username = this.userInfo.userName
- },
- switchPicture() {
- uni.navigateTo({
- url: `/pages/mine/settings/editAvatar`
- })
- },
- exitlogin() {
- },
- fankui() {
- uni.navigateTo({
- url: `/pages/mine/fankui`
- })
- },
- logout() {
- // const that = this
- this.isShowAlert = true
- // uni.showModal({
- // title: '询问',
- // content: '您确定要退出吗?',
- // cancelText: '取消',
- // confirmText: '确定',
- // success: (e) => {
- // if (e.confirm) {
- // uni.hideTabBarRedDot({
- // index: 3
- // })
- // uni.clearStorageSync();
- // that.$store.commit('logout')
- // that.$api.logout()
- // uni.navigateTo({
- // url: `/pages/public/login`
- // })
- // }
- // }
- // })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .content {
- height: calc(100vh);
- color: #333333;
- }
- .content1,
- .content2 {
- background: white;
- padding: 20rpx 40rpx;
- }
- .content2 {
- margin-top: 10rpx;
- .flex {
- height: 70rpx;
- }
- }
- .pictures {
- justify-content: flex-end;
- width: 35px;
- height: 35px;
- background-color: #E0FAF6;
- border-radius: 18px;
- }
- .picture {
- width: 35px;
- height: 35px;
- border-radius: 18px;
- }
- .arrow {
- margin-left: 15px;
- width: 8px;
- height: 12px;
- // justify-content: flex-end
- }
- .username {
- color: #6D6D72;
- }
- .sign {
- width: 18px;
- height: 18px;
- top: 4px;
- margin-right: 6px;
- }
- .exitloginwrap {
- position: fixed;
- bottom: 0;
- left: 0;
- width: 100%;
- padding-bottom: 20px;
- }
- .exitlogin {
- width: 90%;
- background: #fff;
- border-radius: 30px;
- color: #FB1E1E;
- font-size: 17px;
- }
- .exitlogin:after {
- border: none;
- }
- .line {
- margin: 20rpx 0 !important;
- }
- </style>
|