123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248 |
- <template>
- <view class="mine">
- <view class="top">
- <view class="topBox">
- <image src="/static/img/pic_def_ava@2x.png" mode="" class="touxiang"></image>
- <view class="name">{{ currentUser.supplierName }}</view>
- </view>
- <!-- <image :src="currentUser.avatar"></image> -->
-
- </view>
- <view class="cont" style="margin-top: -50rpx;">
- <view class="contBox">
- <!-- <view class="line" >
- <view class="lineName">
- <image src="/static/img/my_icon_history@2x.png" mode="" class="lineIcon"></image>
- 语音播报提醒
- </view>
- <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
- </view> -->
- <view class="line" @click="goUp">
- <view class="lineName">
- <image src="/static/img/my_icon_psw@2x.png" mode="" class="lineIcon"></image>
- 修改密码
- </view>
- <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
- </view>
- <view class="line" @click="goBrand">
- <view class="lineName">
- <image src="/static/img/my_icon_jiuc@2x.png" mode="" class="lineIcon"></image>
- 经营品牌</view>
- <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
- </view>
- </view>
-
- <!-- <view class="contBox" style="margin-top: 20rpx;">
- <view class="line">
- <view class="lineName">当前版本</view>
- <view class="version">version1.0.0</view>
- </view>
- <view class="line" @click="claerHc">
- <view class="lineName">清除缓存</view>
- <image src="/static/img/icon_arrow.png" mode="" class="jtImg"></image>
- </view>
- </view> -->
-
-
- </view>
- <view class="bottom">
-
- <view class="logout" @click="logout">退出</view>
- </view>
- </view>
- </template>
- <script>
- const GoEasy = uni.$GoEasy;
- export default {
- data() {
- return {
- currentUser: null,
- token:'',
- }
- },
- onShow() {
- this.currentUser = uni.getStorageSync("loginInfo")
- var token= uni.getStorageSync("accessToken")
- this.token=token
- if(token){
- this.imLoginUrl()
- }else{
- uni.navigateTo({
- url: './login'
- })
- }
- },
- methods: {
- imLoginUrl(){
- this.$http2('imSys/imLoginUrl', {
- token:this.token,
- type:1
- },'POST').then(res => {
- console.log(res)
- if(res.code!=0){
- // uni.clearStorageSync();
- this.logout()
- }
- })
- },
- claerHc(){
- uni.showToast({
- icon: 'none',
- title: '清除成功',
- duration: 3000
- });
- },
- goUp(){
- uni.navigateTo({
- url:'editPass'
- })
- },
- goBrand(){
- uni.navigateTo({
- url:'brand'
- })
- },
- saveWebState(){
- var standalone = window.navigator.standalone
- var userAgent = window.navigator.userAgent.toLowerCase()
- var safari = /safari/.test(userAgent)
- var ios = /iphone|ipod|ipad|mac/.test(userAgent)
- var android = /android/.test(userAgent)
- if (ios) {
- if ( true) {//!standalone&& !safari
- window.webkit.messageHandlers.saveWebState.postMessage(2)
- }
- } else if (android) {
- window.android.saveWebState(2)
- }
- },
- logout() {
- // uni.clearStorageSync();
- GoEasy.disconnect({
- onSuccess: function(){
- console.log("GoEasy disconnect successfully.")
- uni.removeStorageSync('accessToken');
- uni.removeStorageSync('loginInfo')
- uni.navigateTo({
- url: './login'
- })
- },
- onFailed: function(error){
- uni.removeStorageSync('accessToken');
- uni.removeStorageSync('loginInfo')
- uni.navigateTo({
- url: './login'
- })
- console.log("Failed to disconnect GoEasy, code:"+error.code+ ",error:"+error.content);
- }
- });
- this.saveWebState()
- /* if(GoEasy.getConnectionStatus() === 'disconnected') {
- return
- }
- uni.showLoading({
- title: '注销中',
- mask: true,
- });
- GoEasy.disconnect({
- onSuccess: function () {
- uni.hideLoading();
- console.log('注销成功')
- uni.$currentUser = null;
-
- },
- onFailed: function (error) {
- uni.hideLoading();
- uni.showToast({
- icon: 'none',
- title: '注销超时,请检查网络!(务必确保注销成功才允许客户退出应用,否则有可能会收到上个用户的消息。)',
- duration: 6000
- });
- console.log('注销失败', error);
- }
- }); */
- }
- }
- }
- </script>
- <style scoped>
- .topBox{
- display: flex;
- color: #FFFFFF;
- font-weight: 500;
- font-size: 34rpx;
- color: #FFFFFF;
- padding-left: 25rpx;
- padding-top: 70rpx;
- }
- .cont{
- padding: 0 24rpx;
- }
- .lineIcon{
- width: 40rpx;height: 40rpx;margin-right: 10rpx;
- }
- .lineName{
- display: flex;line-height: 42rpx;
- }
- .contBox{
- background: #FFFFFF;
- border-radius: 10rpx;
- }
- .mine {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- background: #F7F7F7;
- }
- .top {
- height: 240rpx;
- background: #46B1F8;
- /* display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center; */
- }
- .top .touxiang {
- width: 82rpx;
- height: 82rpx;
- /* border-radius: 156rpx; */
- }
- .top .name {
- line-height: 82rpx;
- padding-left: 16rpx;
- }
- .bottom {
- text-align: center;
- line-height: 200rpx;
- margin-top: 100rpx;
- }
- .logout {
- width: 702rpx;
- height: 88rpx;
- background: #FFFFFF;
- border-radius: 10rpx;
- margin: 0 auto;
- text-align: center;
- line-height: 88rpx;
- font-size: 28rpx;
- color: #F03B3B;
- }
- .line{
- display: flex;justify-content: space-between;
- padding: 30rpx 20rpx;
- border-bottom: 1px solid #eee;
- color: #333333;
- }
- .jtImg{
- width: 20rpx;height: 20rpx;margin-top: 6rpx;
- }
- </style>
|