wkyy 3 年之前
父節點
當前提交
87903cbe7d
共有 3 個文件被更改,包括 272 次插入172 次删除
  1. 172 142
      pages.json
  2. 99 29
      pages/login/login.vue
  3. 1 1
      pages/user/message.vue

+ 172 - 142
pages.json

@@ -1,240 +1,270 @@
-{
-	"easycom": {
-			"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
-		},
-	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages	
-		{
-			"name":"充电中",
-			"path": "pages/index/index",
-			"style": {
-			
-			}
-		},
-		{
-			"name":"h5导航到某地",
-			"path": "pages/navigation/index",
-			"style": {
-			
-			}
-		}
-		
-        ,{
-            "path" : "pages/login/login",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/login/login",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/chargingPileDetails/chargingPileDetails",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/fastRecharge/fastRecharge",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        },
-		{
-			"name":"欢迎页",
+{
+	"easycom": {
+		"^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
+	},
+	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages	
+		{
+			"name": "充电中",
+			"path": "pages/index/index",
+			"style": {
+
+			}
+		},
+		{
+			"name": "h5导航到某地",
+			"path": "pages/navigation/index",
+			"style": {
+
+			}
+		}, 
+		{
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		}, 
+		{
+			"path": "pages/chargingPileDetails/chargingPileDetails",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		}, 
+		{
+			"path": "pages/fastRecharge/fastRecharge",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
+			"name": "欢迎页",
 			"path": "pages/login/welcome",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"我的",
+			"name": "主页",
+			"path": "pages/index/index",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name": "我的",
 			"path": "pages/user/index",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"我的余额",
+			"name": "车量管理",
+			"path": "pages/user/car/index",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name": "车量信息",
+			"path": "pages/user/car/carAdd",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name": "添加车牌",
+			"path": "pages/user/car/carDet",
+			"style": {
+				//"navigationStyle": "custom" // 隐藏系统导航栏
+			}
+		},
+		{
+			"name": "我的余额",
 			"path": "pages/user/finance/balance",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"充值",
+			"name": "充值",
 			"path": "pages/user/finance/recharge",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"充值详情",
+			"name": "充值详情",
 			"path": "pages/user/finance/rechargeDet",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"充值记录",
+			"name": "充值记录",
 			"path": "pages/user/finance/rechargeList",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"充值结果",
+			"name": "充值结果",
 			"path": "pages/user/finance/rechargeRes",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"退款记录",
+			"name": "退款记录",
 			"path": "pages/user/finance/refundList",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"退款详情",
+			"name": "退款详情",
 			"path": "pages/user/finance/refundDet",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"退款申请",
+			"name": "退款申请",
 			"path": "pages/user/finance/refundApp",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"关于我们",
+			"name": "关于我们",
 			"path": "pages/user/about",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"操作指南",
+			"name": "操作指南",
 			"path": "pages/user/help",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"注销账号",
+			"name": "注销账号",
 			"path": "pages/user/logout",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"设置",
+			"name": "设置",
 			"path": "pages/user/setting",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"修改手机号",
+			"name": "修改手机号",
 			"path": "pages/user/phone",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"name":"意见反馈",
+			"name": "意见反馈",
 			"path": "pages/user/message",
 			"style": {
 				//"navigationStyle": "custom" // 隐藏系统导航栏
 			}
+		}, {
+			"path": "pages/article/article",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
+			"path": "pages/article/newsNotice",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
+			"path": "pages/article/articleDetails",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/search/search",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/searchPile/searchPile",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
+			"path": "pages/searchPile/stationAndPile/stationDetails",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
+		},
+		{
+			"path": "pages/searchPile/searchPileList",
+			"style": {
+				"navigationBarTitleText": "",
+				"enablePullDownRefresh": false
+			}
+
 		}
-        ,{
-            "path" : "pages/article/article",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        },
-		{
-		    "path" : "pages/article/newsNotice",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		},
-		{
-		    "path" : "pages/article/articleDetails",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		}
-        ,{
-            "path" : "pages/search/search",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-        ,{
-            "path" : "pages/searchPile/searchPile",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "",
-                "enablePullDownRefresh": false
-            }
-            
-        },
-		{
-		    "path" : "pages/searchPile/stationAndPile/stationDetails",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		},
-		{
-		    "path" : "pages/searchPile/searchPileList",
-		    "style" :                                                                                    
-		    {
-		        "navigationBarTitleText": "",
-		        "enablePullDownRefresh": false
-		    }
-		    
-		}
-    ],
+	],
 	"globalStyle": {
-			"navigationStyle": "custom", // 隐藏系统导航栏
-			"navigationBarTitleText": "智能充电系统",
-			"enablePullDownRefresh": false
-			
+		"navigationStyle": "custom", // 隐藏系统导航栏
+		"navigationBarTitleText": "智能充电系统",
+		"enablePullDownRefresh": false
+
 	}
-  
+	// "tabBar": {
+	// 	"color": "#b3a8a8",
+	// 	"selectedColor": "#ff5e5e",
+	// 	"backgroundColor": "#FFFFFF",
+	// 	"borderStyle": "white",
+	// 	"list": [{
+	// 			"pagePath": "pages/index/index",
+	// 			"iconPath": "home-3-line",
+	// 			"selectedIconPath": "home-3-fill",
+	// 			"text": "主页"
+	// 		},
+	// 		{
+	// 			"pagePath": "pages/searchPile/searchPile",
+	// 			"iconPath": "road-map-line",
+	// 			"selectedIconPath": "road-map-line",
+	// 			"text": "找桩"
+	// 		},
+	// 		{
+	// 			"pagePath": "pages/user/index",
+	// 			"iconPath": "user-5-line",
+	// 			"selectedIconPath": "user-5-line",
+	// 			"text": "我的"
+	// 		}
+	// 	]
+	// },
+
 }

+ 99 - 29
pages/login/login.vue

@@ -10,55 +10,125 @@
 				<view class="login-form-item">
 					<view class="title">手机号</view>
 					<view class="input">
-						<u-input v-model="tel" type="number" placeholder="请输入手机号" placeholder-style="font-size:16px;color:#ccc;"/>
+						<u-input v-model="form.telephone" type="number" placeholder="请输入手机号" placeholder-style="font-size:16px;color:#ccc;"/>
 					</view>
 					<view class="tips">未注册的手机号验证后将自动注册</view>
 				</view>
 				<view class="login-form-item">
 					<view class="title">验证码</view>
 					<view class="input">
-						<view class="code">获取验证码</view>
-						<u-input v-model="tel" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
+						<u-input v-model="form.verifyCode" type="number" placeholder="请输入验证码" placeholder-style="font-size:16px;color:#ccc;"/>
+						<view class="code" @click="getCode">{{codeTips}}</view>
 					</view>
 					<u-checkbox-group>
 						<u-checkbox class="tips" v-model="value" shape="circle" @change="checkboxChange()">
-							<view v-if="!value">我已阅读并同意<span>《会员协议》</span>和<span>《隐私协议》</span></view>
+							<view v-if="!form.telephone && !value">我已阅读并同意<span>《会员协议》</span>和<span>《隐私协议》</span></view>
 							<view v-else>我已阅读并同意<span style="color: #000000;">《会员协议》</span>和<span style="color: #000000;">《隐私协议》</span></view>
 						</u-checkbox>
 					</u-checkbox-group>
 				</view>
-			</view>
-			
-			<u-button :style="[inputStyle]" class="login-btn" type="success" shape="circle">登录</u-button>
-		</view>
-		
+			</view>		
+			<u-button :style="[inputStyle]" class="login-btn" type="success" shape="circle" @click="login">登录</u-button>
+			<u-verification-code :seconds="sendMsgSecond" ref="uCode" @change="codeChange" @end="end" @start="start" change-text="已发送(XS)">
+			</u-verification-code>
+		</view>	
 	</view>
 </template>
 
 <script>
-export default {
-	data() {
-		return {
-			tel: '',
-			value: false,
-		}
-	},
-	computed: {
-		inputStyle() {
-			let style = {};
-			if(this.tel) {
-				style.color = "#fff";
-				style.backgroundColor = this.$u.color['success'];
+	import * as loginApi from '@/apis/login.js'
+	import {
+		checkPhone
+	} from '@/utils'
+	
+	export default {
+		data() {
+			return {
+				form: {
+					telephone: '',
+					verifyCode: '',
+				},
+				isSendMsgIng: false,
+				sendMsgSecond: 60,
+				codeTips: '',
+				value: false,
+			}
+		},
+		computed: {
+			inputStyle() {
+				let style = {};
+				if(this.form.telephone) {
+					style.color = "#fff";
+					style.backgroundColor = this.$u.color['success'];
+				}
+				return style;
 			}
-			return style;
-		}
-	},
-	methods: {
-		checkboxChange() {
-			this.value = !this.value;
 		},
+		methods: {
+			codeChange(text) {
+				this.codeTips = text;
+			},
+			start() {
+				if (!this.isSendMsgIng) {
+					uni.showLoading({
+						title: "加载中",
+						mask: true,
+					})
+					loginApi.getVerifyCode(this.form.telephone).then((response) => {
+						uni.hideLoading();
+						this.carhelp.set("getvcodetime", new Date().getTime());
+			
+						if (!"") {
+							//倒计时
+							uni.showToast({
+								title: "发送成功"
+							})
+						} else {
+							uni.showToast({
+								title: "您的验证码已经发送[5分钟有效],请勿重复点击"
+							})
+						}
+					}).catch(error => {
+						uni.showToast({
+							title: error,
+							icon: "none"
+						})
+					})
+				}
+			},
+			//倒计时
+			end() {
+				this.sendMsgSecond = 60;
+				this.isSendMsgIng = false;
+			},
+			// 获取验证码
+			getCode() {
+				if (this.$refs.uCode.canGetCode) {} else {
+					uni.showToast({
+						title: '倒计时结束后再发送',
+						icon: "none"
+					})
+					return
+				}
+			
+				var checkPhoneResult = checkPhone(this.form.telephone);
+			
+				if (false && checkPhoneResult !== true) {
+					uni.showToast({
+						title: checkPhoneResult,
+					})
+					return;
+				}
+				this.$refs.uCode.start();
+			},
+			checkboxChange() {
+				this.value = !this.value;
+			},
+			login() {
+				
+			}
+		}
 	}
-};
 </script>
 
 <style>

+ 1 - 1
pages/user/message.vue

@@ -39,7 +39,7 @@
 		},
 		methods: {
 			submit() {
-				uni.redirectTo({
+				uni.switchTab({
 					url: '/pages/user/index'
 				})
 			}