From 5277ab3f5bb42ea8bbeccb855efd4724275cb495 Mon Sep 17 00:00:00 2001
From: "@fawn-nine" <1271023382@qq.com>
Date: Tue, 14 Nov 2023 18:08:16 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=83=E5=A4=96=E7=9F=AD=E4=BF=A1=E9=AA=8C?=
=?UTF-8?q?=E8=AF=81=E7=99=BB=E9=99=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/baseUrl.js | 9 ++--
manifest.json | 4 +-
pages/user/login.vue | 116 ++++++++++++++++++++++++++++---------------
3 files changed, 83 insertions(+), 46 deletions(-)
diff --git a/config/baseUrl.js b/config/baseUrl.js
index 9d67d56..21d482f 100644
--- a/config/baseUrl.js
+++ b/config/baseUrl.js
@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
// socketUrl = "ws://localhost:6001/";
// baseUrl = "https://twin-ui.com/demo/";
// baseUrl = "http://59.110.212.44:9200/pb/";
- // baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
- baseUrl = "https://api.nuttyreading.com/"; // 线上正式
+ baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
+ // baseUrl = "https://api.nuttyreading.com/"; // 线上正式
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
// baseUrl = "http://192.168.110.110:9200/pb/";
// baseUrl = "http://192.168.110.38:9200/pb/"; // 吴春磊笔记本1
@@ -45,9 +45,10 @@ const courtConfig = {
}
};
//手机号验证正则表达式
-// const phoneRegular = /^1\d{10}$/;
+// (中国大陆)
+const phoneRegular = /^1\d{10}$/;
// 手机号码验证 支持港澳台 大陆
-const phoneRegular = /^[1][3-8]\d{9}$|^([6|9])\d{7}$|^[0][9]\d{8}$|^[6]([8|6])\d{5}$|^(00){0,1}(65){1}[13689]\d{6,7}$/;
+// const phoneRegular = /^[1][3-8]\d{9}$|^([6|9])\d{7}$|^[0][9]\d{8}$|^[6]([8|6])\d{5}$|^(00){0,1}(65){1}[13689]\d{6,7}$/;
//邮箱验证正则表达式
const mailRegular = /^\w+@\w+(\.[a-zA-Z]{2,3}){1,2}$/;
//密码验证正则表达式
diff --git a/manifest.json b/manifest.json
index f476471..2e47d08 100644
--- a/manifest.json
+++ b/manifest.json
@@ -12,8 +12,8 @@
"src" : "图片路径"
}
],
- "versionName" : "1.2.14",
- "versionCode" : 1214,
+ "versionName" : "1.2.15",
+ "versionCode" : 1215,
"app-plus" : {
"compatible" : {
"ignoreVersion" : true
diff --git a/pages/user/login.vue b/pages/user/login.vue
index da46136..f5957ae 100644
--- a/pages/user/login.vue
+++ b/pages/user/login.vue
@@ -15,26 +15,31 @@
- 手机号
+
+ 手机号
+
+
+
+
-
+
-
-
+ -->
密码
@@ -190,16 +195,8 @@
Content: ''
},
quShow: false,
- quCodeList: [{
- value: '1',
- text: '江'
- },
- {
- value: '2',
- text: '湖'
- }
- ],
- quCode: null,
+ quCodeList: [], // 国家区域码
+ quCode: 86,
};
},
@@ -216,11 +213,43 @@
// #endif
},
//页面显示
- onShow() {},
+ onShow() {
+ this.getCountyCode()
+ },
//方法
methods: {
...mapMutations(['setUserInfo']),
...mapMutations(['setHealthMes']),
+ // 获取国家区域编码
+ getCountyCode() {
+ $http.request({
+ url: "book/baseArea/getAllBaseArea",
+ method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
+ data: {},
+ header: { //默认 无 说明:请求头
+ 'Content-Type': 'application/json'
+ },
+ })
+ .then(res => {
+ // console.log(res,'区域码')
+ if (res.code == 0 && res.baseAreas.length > 0) {
+ // this.quCodeList = res.baseAreas
+ this.quCodeList = res.baseAreas.map(item => {
+ let obj = {
+ 'text': item.title,
+ 'value': item.code,
+ }
+ return obj
+ })
+ // console.log('改变格式后',this.quCodeList)
+ } else {
+ this.quCodeList = []
+ // this.totalPage = 0
+ }
+ }).catch(e => {
+ console.log(e, 'e')
+ });
+ },
quChange(e) {
console.log(e, 'e')
},
@@ -294,12 +323,15 @@
});
return;
}
- if (!this.$base.phoneRegular.test(this.phone)) {
- uni.showToast({
- title: '手机格式不正确',
- icon: 'none'
- });
- return;
+ if (this.quCode == null || this.quCode == 86) { // 如果没选择国家code,默认是中国大陆
+ if (!this.$base.phoneRegular.test(this.phone)) {
+ uni.showToast({
+ title: '手机格式不正确',
+ icon: 'none'
+ });
+ return;
+ }
+ console.log(this.quCode, '选择的区段')
}
if (!this.agree) {
uni.showToast({
@@ -312,6 +344,7 @@
this.$http
.get('book/user/sms/sendcode', {
phone: this.phone,
+ areaCode: this.quCode,
type: 2000
})
.then(res => {
@@ -339,12 +372,14 @@
});
return;
}
- if (!this.$base.phoneRegular.test(this.phone)) {
- uni.showToast({
- title: '手机格式不正确',
- icon: 'none'
- });
- return;
+ if (this.quCode == null || this.quCode == 86) {
+ if (!this.$base.phoneRegular.test(this.phone)) {
+ uni.showToast({
+ title: '手机格式不正确',
+ icon: 'none'
+ });
+ return;
+ }
}
let httpData = {};
if (this.type == 2000) {
@@ -635,10 +670,10 @@