| | |
| | | computed: _objectSpread({}, (0, _vuex.mapState)(['navHeight', 'statusbarHeight', 'userInfo', 'token', 'openid'])), |
| | | data: function data() { |
| | | return { |
| | | value: false, |
| | | isLogin: false |
| | | changing: false, |
| | | changing1: false, |
| | | autoReceiveStatus: false, |
| | | isLogin: false, |
| | | useIdentity: 0 |
| | | }; |
| | | }, |
| | | onShow: function onShow(options) { |
| | | this.isLogin = false; |
| | | this.autoReceiveStatus = false; |
| | | this.useIdentity = 0; |
| | | if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') { |
| | | this.isLogin = true; |
| | | this.getUserInfo(); |
| | | this.autoReceiveStatus = this.userInfo.autoReceiveStatus === 1; |
| | | this.useIdentity = this.userInfo.useIdentity; |
| | | } |
| | | }, |
| | | methods: { |
| | | getUserInfo: function getUserInfo() { |
| | | var that = this; |
| | | this.$u.api.getMemberInfo({}).then(function (res) { |
| | | if (res.code === 200) { |
| | | if (res && res.code === 200) { |
| | | that.$store.commit('setUserInfo', res.data); |
| | | that.$isResolve(); |
| | | } else { |
| | |
| | | } |
| | | }); |
| | | }, |
| | | jumpTX: function jumpTX() { |
| | | jumpService: function jumpService(flag) { |
| | | uni.navigateTo({ |
| | | url: '/pages/withdrawal/withdrawal' |
| | | }); |
| | |
| | | url: '/pages/login/login' |
| | | }); |
| | | break; |
| | | case 6: |
| | | uni.navigateTo({ |
| | | url: '/pages/withdrawal/withdrawal' |
| | | }); |
| | | break; |
| | | } |
| | | }, |
| | | logOffDo: function logOffDo() { |
| | | var that = this; |
| | | this.$u.api.logOff({}).then(function (res) { |
| | | //退出登录成功 |
| | | that.isLogin = false; |
| | | that.$store.commit("empty"); |
| | | }); |
| | | }, |
| | | editUseIdentity: function editUseIdentity() { |
| | | if (this.changing1) { |
| | | return; |
| | | } |
| | | this.changing1 = true; |
| | | var that = this; |
| | | var param = { |
| | | useIdentity: this.userInfo.useIdentity == 1 ? 0 : 1 |
| | | }; |
| | | that.$u.api.editUseIdentity(param).then(function (res) { |
| | | console.log(222, res); |
| | | if (res.code === 200) { |
| | | that.userInfo.useIdentity = param.useIdentity; |
| | | } |
| | | }).finally(function () { |
| | | that.changing1 = false; |
| | | }); |
| | | }, |
| | | updateMemberInfo: function updateMemberInfo() { |
| | | if (this.changing) { |
| | | return; |
| | | } |
| | | this.changing = true; |
| | | var that = this; |
| | | var param = { |
| | | autoReceiveStatus: that.autoReceiveStatus ? 1 : 0 |
| | | }; |
| | | this.$u.api.editMemberInfo(param).then(function (res) { |
| | | if (res.code === 200) { |
| | | that.userInfo.autoReceiveStatus = param.autoReceiveStatus; |
| | | } |
| | | }).finally(function () { |
| | | that.changing = false; |
| | | }); |
| | | } |
| | | } |
| | | }; |