Bladeren bron

增加退出

ck110 1 maand geleden
bovenliggende
commit
41eb457dc5
4 gewijzigde bestanden met toevoegingen van 52 en 29 verwijderingen
  1. 20 1
      pages/login/down.vue
  2. 2 2
      pages/login/loginFirst.vue
  3. 6 0
      pages/my/my.scss
  4. 24 26
      pages/my/my.vue

+ 20 - 1
pages/login/down.vue

@@ -43,13 +43,32 @@
 		methods: {
 			onBack() {},
 			toDown() {
+				var browser = {
+					versions: function() {
+						var u = navigator.userAgent,
+							app = navigator.appVersion;
+						return { //移动终端浏览器版本信息
+							trident: u.indexOf('Trident') > -1, //IE内核
+							presto: u.indexOf('Presto') > -1, //opera内核
+							webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
+							gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
+							mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
+							ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
+							android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或uc浏览器
+							iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
+							iPad: u.indexOf('iPad') > -1, //是否iPad
+							webApp: u.indexOf('Safari') == -1 //是否web应该程序,没有头部与底部
+						};
+					}(),
+					language: (navigator.browserLanguage || navigator.language).toLowerCase()
+				};
 				if (this.is_show_mask()) {
 					this.show_mask = true;
 				} else {
 					if (browser.versions.mobile && browser.versions.ios) {
 						location.href = "http://e.yujianmate.com/web/";
 					} else {
-						location.href = "http://e.yujianmate.com/app/v100.2.apk";
+						location.href = "http://e.yujianmate.com/app/v100.5.apk";
 					}
 				}
 			},

+ 2 - 2
pages/login/loginFirst.vue

@@ -3,7 +3,7 @@
 		<view class="list_info">
 			<view class="name">给自己取个名字吧:</view>
 			<view class="item">
-				<input type="text" class="input" v-model="nickname" placeholder="请输入昵称" />
+				<input type="text" class="input" v-model="nickname" maxlength="10" placeholder="请输入2~10位昵称" />
 			</view>
 			<view class="name">请问你的性别是:</view>
 			<view class="itemSex">
@@ -123,7 +123,7 @@
 			},
 			onFinish() {
 				let that = this;
-				if (this.nickname.length == '') {
+				if (this.nickname.length < 2) {
 					that.$refs['ToastW3'].showToast({
 						title: "请给自己取个昵称",
 						animation: 0

+ 6 - 0
pages/my/my.scss

@@ -149,6 +149,12 @@ page {
 		}
 	}
 }
+.btn_submit {
+	width: 660rpx;height: 96rpx;margin:0 auto;
+	border: 2rpx solid #404040;
+	border-radius: 28rpx;font-weight: bold;font-size: 32rpx;color: #FF2A95;
+	display: flex;flex-direction: row;justify-content: center;align-items: center;
+}
 .blankHeight {
 	height:100rpx;
 }

+ 24 - 26
pages/my/my.vue

@@ -69,8 +69,10 @@
 
 			</view>
 
+			<view class="btn_submit" @click="onLogout()">退出登录</view>
 
 			<view class="blankHeight"></view>
+			<view class="blankHeight"></view>
 		</view>
 
 
@@ -156,40 +158,36 @@
 
 
 			},
-			EditNickname() {
+			onLogout() {
 				let that = this;
 				this.$refs['DialogBox'].confirm({
-					title: '更改昵称',
-					placeholder: '请输入修改的昵称',
-					value: that.myinfo.nickname,
-					DialogType: 'input',
+					title: '提示',
+					content: '确定退出吗?',
+					DialogType: 'inquiry',
+					btn1: '取消',
+					btn2: '退出',
 					animation: 0
 				}).then((res) => {
-					if (res.value.length < 1) {
-						uni.showToast({
-							title: "请输入有效的昵称",
-							icon: 'none'
-						});
-						return;
-					}
-					that.myinfo.nickname = res.value;
-					let obj2 = {
-						nickname: res.value
-					}
-					const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
 					uni.request({
-						url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
-						data: postData,
-						method: 'POST',
+						url: that.$apiHost + '/My/logout',
+						data: {
+							uuid: getApp().globalData.uuid,
+							skey: getApp().globalData.skey
+						},
 						header: {
-							'content-type': 'application/json', //自定义请求头信息
-							'Access-Control-Allow-Origin': '*'
+							"content-type": "application/json", //自定义请求头信息
 						},
 						success: (res) => {
-							uni.showToast({
-								title: res.data.str,
-								icon: 'none'
-							});
+							console.log("----:", res.data);
+							uni.redirectTo({
+								url: '/pages/login/login'
+							})
+						},
+						complete: (com) => {
+							// uni.hideLoading();
+						},
+						fail: (e) => {
+							console.log("----e:", e);
 						}
 					});
 				})