Преглед изворни кода

首页、我的小程序开发

tanxue пре 1 месец
родитељ
комит
c86255e605
3 измењених фајлова са 61 додато и 9 уклоњено
  1. 8 0
      common/styles/global/pages.scss
  2. 17 7
      pages/index/index.vue
  3. 36 2
      pages/my/index.vue

+ 8 - 0
common/styles/global/pages.scss

@@ -88,6 +88,14 @@
 		.shezhi-icon{background-image: url("@/static/images/my/my-setting-icon-sj.png");}
 	}
 	.my-list-box + .my-list-box{margin-top: 20rpx;}
+	// 退出登录 后续删除
+	background: #fff;position: relative;height: calc(100vh - 180rpx);
+	.exit-login-btn {
+	    width: 400rpx;height: 90rpx;line-height: 90rpx;display: block;font-size: 32rpx;
+	    background: linear-gradient(0deg,#436aff 0%, #234ff7 100%);border-radius: 45rpx;
+	    box-shadow: 0px 2rpx 14rpx -4rpx #5772ff;text-align: center;color: #fff;
+		position: absolute;bottom: 60rpx;left: 50%;transform: translateX(-200rpx);
+	}
 }
 
 // 设置

+ 17 - 7
pages/index/index.vue

@@ -157,9 +157,14 @@
 		} = e.detail;
 		switch (index) {
 			case 0:
-				uni.switchTab({
+				/* uni.switchTab({
 					url: '/pages/course/index'
-				});
+				}); */
+				uni.showToast({
+					icon: 'none',
+					title: '开发中,敬请期侍!',
+				})
+				return false
 				break;
 			case 1:
 				uni.switchTab({
@@ -167,19 +172,24 @@
 				});
 				break;
 			case 2:
-				/* uni.showToast({
+				uni.showToast({
 					icon: 'none',
 					title: '开发中,敬请期侍!',
 				})
-				return false */
-				uni.navigateTo({
+				return false
+				/* uni.navigateTo({
 					url: '/pages/lianxi/index'
-				})
+				}) */
 				break;
 			case 3:
-				uni.navigateTo({
+				/* uni.navigateTo({
 					url: '/pages/my/mesList?from=indexPeixun'
+				}) */
+				uni.showToast({
+					icon: 'none',
+					title: '开发中,敬请期侍!',
 				})
+				return false
 				break;
 		}
 	}

+ 36 - 2
pages/my/index.vue

@@ -15,7 +15,7 @@
 		    </view>
 		</view>
 		
-		<view class="my-list-box">
+		<!-- <view class="my-list-box">
 			<view class="list-row" @click="goToPage('xuefen')">
 				<icon class="list-icon xuefen-icon"></icon>
 				<text>学分</text>
@@ -32,6 +32,7 @@
 				<text class="row-content">{{myInfoData.countCert}}个</text>
 			</view>
 		</view>
+		
 		<view class="my-list-box">
 			<view class="list-row" @click="goToPage('cuoti')">
 				<icon class="list-icon cuoti-icon"></icon>
@@ -53,8 +54,10 @@
 				<icon class="list-icon shezhi-icon"></icon>
 				<text>设置</text>
 			</view>
-		</view>
+		</view> -->
 		
+		<!-- 退出登录 后续删除 -->
+		<view @click="quitClick" class="exit-login-btn">退出登录</view>
 		<view>
 			<cameraCommon ref="cameraCommonRef"></cameraCommon>
 		</view>
@@ -164,6 +167,37 @@
 			break;
 		}
 	}
+	
+	// 退出登录 后续删除
+	function quitClick(){
+		uni.showModal({
+				title: '提示',
+				content: '你确定要执行这个操作吗?',
+				success: (res) => {
+				  if (res.confirm) {
+					// 确定
+					quit()
+				  } else if (res.cancel) {
+					// 取消
+				  }
+				}
+			  });
+		
+		 }
+		 
+	function quit (){
+			logout().then(res=>{
+				toast('退出登录成功')
+				uni.navigateTo({
+					url: '/pages/login'
+				});
+				cacheManager.clearAll();
+				
+			}).catch(err => {
+			toast('退出登录失败,请稍后重试')
+		})
+		
+	}
 </script>
 
 <style>