瀏覽代碼

修改用户名输入检测

修改用户名输入检测
yinzhipeng 5 年之前
父節點
當前提交
cbdca90bfc
共有 4 個文件被更改,包括 13 次插入96 次删除
  1. 1 1
      pages/index/index.wxml
  2. 8 0
      pages/register/register.js
  3. 1 1
      pages/search_result/search_result.wxml
  4. 3 94
      project.config.json

+ 1 - 1
pages/index/index.wxml

@@ -44,7 +44,7 @@
     <text class='slow'>慢桩数:{{textData.slowCharg==null?0:textData.slowCharg}}</text>
     <text class='inline' wx:if="{{userInfo.flag}}">当前故障桩:</text><text class='red inline' wx:if="{{userInfo.flag}}">{{textData.breaknum==null?0:textData.breaknum}}</text>
     <text  wx:if="{{!userInfo.flag}}">参考电价:{{textData.chargprice}}元/度</text>
-    <text decode='true'  wx:if="{{!userInfo.flag}}">服务费:{{textData.serviceprice}}元/&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{textData.stopprice}}元/小时</text>
+    <text decode='true'  wx:if="{{!userInfo.flag}}">服务费:{{textData.serviceprice}}元/&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{textData.stopprice}}元/小时</text>
     <view class='navigation' bindtap="getRoute">
       <image src='/images/navigation.png'></image>
     </view>

+ 8 - 0
pages/register/register.js

@@ -166,6 +166,14 @@ Page({
         checkPass: false
       });
       return;
+    } else if (!(/^[a-zA-Z0-9_.\u4e00-\u9fa5]+$/.test(this.data.userName))) {
+      this.setData({
+        errorMsg: '账号只能包含字母、数字、中文、下划线和点'
+      });
+      this.setData({
+        checkPass: false
+      });
+      return;
     }else{
       this.setData({
         errorMsg: ''

+ 1 - 1
pages/search_result/search_result.wxml

@@ -47,7 +47,7 @@
     <text class='inline' wx:if="{{userInfo.flag}}">当前故障桩:</text>
     <text class='red inline' wx:if="{{userInfo.flag}}">{{item.breaknum==null?0:item.breaknum}}</text>
     <text wx:if="{{!userInfo.flag}}">参考电价:{{item.chargprice}}元/度</text>
-    <text decode='true' wx:if="{{!userInfo.flag}}">服务费:{{item.serviceprice}}元/&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{item.stopprice}}元/小时</text>
+    <text decode='true' wx:if="{{!userInfo.flag}}">服务费:{{item.serviceprice}}元/&nbsp;&nbsp;&nbsp;&nbsp;停车费:{{item.stopprice}}元/小时</text>
     <view id="{{item.id}}" class='navigation' bindtap="getRoute">
       <image src='/images/navigation.png'></image>
     </view>

+ 3 - 94
project.config.json

@@ -9,7 +9,7 @@
 		"autoAudits": false
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.4.4",
+	"libVersion": "2.7.7",
 	"appid": "wx6e03e5ada030b1aa",
 	"projectname": "充电桩",
 	"isGameTourist": false,
@@ -31,99 +31,8 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 14,
-			"list": [
-				{
-					"id": -1,
-					"name": "充电中",
-					"pathName": "pages/charging/charging",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "充值",
-					"pathName": "pages/chargemoney/chargemoney",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "登录",
-					"pathName": "pages/login/login",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "注册",
-					"pathName": "pages/register/register",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "订单支付",
-					"pathName": "pages/order/order",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "充电记录",
-					"pathName": "pages/ucenter/charginglog/charginglog",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "责任场站",
-					"pathName": "pages/ucenter/mychargestation/mychargestation",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "提现",
-					"pathName": "pages/outmoney/outmoney",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "我的工单",
-					"pathName": "pages/ucenter/myworksheet/myworksheet",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "工单详情",
-					"pathName": "pages/worksheetinfo/worksheetinfo",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "123",
-					"pathName": "pages/worksheetinfo/accendant",
-					"query": ""
-				},
-				{
-					"id": 11,
-					"name": "扫码",
-					"pathName": "pages/scan_result/scan_result",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "个人中心",
-					"pathName": "pages/ucenter/index/index",
-					"query": ""
-				},
-				{
-					"id": -1,
-					"name": "忘记密码",
-					"pathName": "pages/forget/forget",
-					"query": ""
-				},
-				{
-					"id": 14,
-					"name": "个人信息",
-					"pathName": "pages/ucenter/center/center",
-					"query": ""
-				}
-			]
+			"current": -1,
+			"list": []
 		}
 	}
 }