Bladeren bron

扫码登录

achao 2 jaren geleden
bovenliggende
commit
cf94bfa841
4 gewijzigde bestanden met toevoegingen van 70 en 23 verwijderingen
  1. 2 3
      pages.json
  2. 64 18
      pages/mine/confirm.vue
  3. 4 2
      pages/mine/index.vue
  4. BIN
      static/sm.png

+ 2 - 3
pages.json

@@ -519,7 +519,7 @@
 				"app-plus": {
 					"titleNView": {
 						"buttons": [{
-							"type":"menu"
+							"type": "menu"
 							// "text": "\f0112",
 							// "fontSrc": "/static/gengduo/iconfont.ttf",
 							// "fontSize": "20"
@@ -578,8 +578,7 @@
 		}, {
 			"path": "pages/mine/confirm",
 			"style": {
-				"navigationBarTitleText": "scss",
-				"enablePullDownRefresh": false
+				"navigationStyle": "custom"
 			}
 
 		}

+ 64 - 18
pages/mine/confirm.vue

@@ -1,12 +1,19 @@
 <template>
 	<view>
-		<view class="username">{{username}}</view>
-		<view v-if="msg==''">
-			<button @click="mobileOkPcLogin()">确认登录</button>
-		</view>
-		<view class="msg" v-else>
-			{{msg}}
+		<!-- <view class="username">{{username}}</view> -->
+		<view class="content1">
+			<image src="../../static/sm.png" mode="widthFix" class="img"></image>
+			<view class="row1">
+				即将通过扫码
+			</view>
+			<view class="row2">
+				登录畅运通网站
+			</view>
+			<button @click="mobileOkPcLogin()" class="row3 btn">确认登录</button>
+			<button @click="mobileOkPcLogin()" class="row4 btn">取消登录</button>
 		</view>
+		<u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
+			confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
 	</view>
 </template>
 
@@ -18,8 +25,9 @@
 		data() {
 			return {
 				token: '',
-				msg: '',
 				phone: '',
+				alertTitle: '登录成功!',
+				isShowAlert: false
 			}
 		},
 		computed: {
@@ -30,6 +38,15 @@
 			console.log(option);
 		},
 		methods: {
+			confirmClick() {
+				this.isShowAlert = false
+				uni.switchTab({
+					url: '/pages/mine/index'
+				});
+			},
+			cancelClick() {
+				this.isShowAlert = false
+			},
 			mobileOkPcLogin() {
 				this.$request.baseRequest('post', '/login/loginCode', {
 						phone: this.userInfo.phone,
@@ -37,8 +54,7 @@
 					}).then(res => {
 						console.log(1111111111111111111)
 						console.log(res)
-						this.msg = res.message;
-						console.log(this.msg);
+						this.isShowAlert = true
 					})
 					.catch(res => {
 						uni.$u.toast(res.message);
@@ -49,16 +65,46 @@
 	}
 </script>
 
-<style>
-	.username {
-		text-align: center;
-		font-size: 32rpx;
-		line-height: 50rpx;
+<style scoped lang="scss">
+	.content1 {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		flex-direction: column;
+		padding-top: 300rpx;
+	}
+
+	.img {
+		width: 50%;
+	}
+
+	.row1 {
+		font-size: 14rpx;
+		color: #AFB3BF;
+		margin: 40rpx 0 10rpx 0;
+	}
+
+	.row2 {
+		font-size: 46rpx;
+		font-weight: 500;
+		color: #333333;
+	}
+
+	.row3 {
+		margin-top: 300rpx;
+
+		background: #2772FB;
+		color: white;
+	}
+
+	.row4 {
+		margin-top: 60rpx;
+		background: #F1F3F6;
+		color: #AFB3BF;
 	}
 
-	.msg {
-		text-align: center;
-		font-size: 30rpx;
-		margin-top: 10rpx;
+	.btn {
+		border-radius: 50rpx;
+		width: 90%;
 	}
 </style>

+ 4 - 2
pages/mine/index.vue

@@ -104,7 +104,7 @@
 						<u-icon name="arrow-right" color="#7E7E7E" size="10"></u-icon>
 					</view>
 				</view>
-				
+
 				<!-- 		<view class="flex flex-space-between content1-item"
 					@click="goDetailPage('/pages/mine/driverEvaluation')">
 					<view class='flex items-center'>
@@ -192,7 +192,7 @@
 						} else {
 							this.cargoCall = "女士"
 						}
-					}else{
+					} else {
 						this.userName = this.userInfo.userName
 					}
 				})
@@ -238,6 +238,8 @@
 				this.$request.baseRequest('get', '/login/loginInfo', {
 					token: this.token
 				}).then(res => {
+					console.log('111111111111111111111')
+					console.log(res)
 					let resultData = res;
 					console.log(resultData);
 					uni.navigateTo({

BIN
static/sm.png