123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <template>
- <!-- <view >
- <button type="primary" @click="ExitLogin">注销</button>
- <button type="primary" style="margin: 1;" @click="ExitApp">退出应用</button>
- <button type="primary" @click="GetUserInfo">获取用户信息和Token数据</button>
- </view> -->
- <view>
- <view style="height: 5px;"></view>
- <view class="uni-navigate-item-my" @click="ExitLogin">
- <text class="uni-navigate-text-my">注销</text>
- <text class="uni-navigate-icon-my uni-icon"></text>
- </view>
- <view style="height: 5px;"></view>
- <view class="uni-navigate-item-my" @click="ExitApp">
- <text class="uni-navigate-text-my">退出应用</text>
- <text class="uni-navigate-icon-my uni-icon"></text>
- </view>
- </view>
- </template>
- <script>
- // TODO 修复Android v3 加载过慢问题
- // #ifdef APP-PLUS
- var domModule = weex.requireModule('dom');
- domModule.addRule('fontFace', {
- 'fontFamily': "uniicons",
- 'src': "url('/static/uni.ttf')"
- });
- // #endif
- export default {
- props: {
- hasLeftWin: {
- type: Boolean
- },
- leftWinActive: {
- type: String
- }
- },
- data() {
- return {
-
- }
- },
- // onBackPress() {
- // return true
- // },
- onShareAppMessage() {
-
- },
- onNavigationBarButtonTap(e) {
-
- },
- watch: {
-
- },
- methods: {
- ExitLogin() {
- uni.showModal({
- //计算删除的数量
- title: '提示',
- content: '是否确认注销登录?? \r\n点击确定按钮后,需要重新登录系统!!', //文章内容
- cancelText: '取消', //取消按钮的文字
- confirmText: '确定', //确定文本的文字
- cancelColor: '#007aff', //取消按钮文本颜色
- confirmColor: '#007aff', //确定按钮文本颜色
- success: function(res) {
- if (res.confirm) {
- let parm = {
- url : '/logout',
- data: {},
- method: 'POST',
- isHaveToken : true
- }
- getApp().RequestData(parm).then(() => {
- uni.removeStorage({
- key: 'userInfo',
- success: function(res) {
- uni.showToast({
- title: '退出登录成功',
- icon: 'success',
- duration: 500
- })
- }
- })
- uni.reLaunch({
- url:"/pages/login/login",
- })
- })
- }
- }
- })
- },
- ExitApp() {
- let app = getApp()
- app.AppExit()
- },
- GetUserInfo() {
- this.popStr = uni.getStorageSync('userInfo').username
- let type = 'center'
- this.type = type
- this.$refs.popup.open(type)
- // console.log(this.popStr)
- }
- }
- }
- </script>
- <style lang="scss">
- @import '../../../common/uni-nvue.css';
- </style>
|