Selaa lähdekoodia

注册校验,更新//n

qukaidi 4 vuotta sitten
vanhempi
commit
72ecb2c177
4 muutettua tiedostoa jossa 61 lisäystä ja 54 poistoa
  1. 3 1
      pages/home/index.vue
  2. 48 50
      pages/login/register_2.vue
  3. 8 3
      pages/login/register_3.vue
  4. 2 0
      pages/me/setting/setting.vue

+ 3 - 1
pages/home/index.vue

@@ -155,7 +155,8 @@
 								// })
 								console.log("已是最新版本")
 							} else if (wgtinfo.version != res.data.forceVersion) {
-								console.log("强制版本更新")
+								console.log("强制版本更新"+res)
+								res.data.msg = res.data.msg.replace(/\\n/g,"\n")
 								uni.showModal({
 									title: "发现新版本",
 									content: res.data.msg,
@@ -177,6 +178,7 @@
 								})
 							} else if (wgtinfo.version == res.data.forceVersion) {
 								console.log("最低版本更新")
+								res.data.msg = res.data.msg.replace(/\\n/g,"\n")
 								uni.showModal({
 									title: "发现新版本",
 									content: res.data.msg,

+ 48 - 50
pages/login/register_2.vue

@@ -203,7 +203,7 @@
 					this.form.store = data.company.words
 				}
 				this.form.company = data.company.words
-				if(data.company.words!="无"){
+				if(data.person.words!="无"){
 					this.form.name = data.person.words
 				}
 				
@@ -239,69 +239,67 @@
 				this.requestAndroidPermission('android.permission.ACCESS_FINE_LOCATION')
 				this.modelshow = true
 			}
-
+		this.judgeIosPermission()
+		this.requestAndroidPermission()
 		},
 		methods: {
 			judgeIosPermission(permisionID) {
 				let result = permision.judgeIosPermission(permisionID)
 				if (!result) {
-					this.getLocation()
+					uni.getLocation({
+					    type: 'wgs84',
+					    success: res=>{
+					        console.log("获取到定位");
+					    },
+						fail:err=>{
+							console.log("没获取到定位")
+						}
+					});
 				} else {
-					this.getLocation()
+					uni.getLocation({
+					    type: 'wgs84',
+					    success: res=>{
+					        console.log("获取到定位");
+					    },
+						fail:err=>{
+							console.log("没获取到定位")
+						}
+					});
 				}
 			},
 			async requestAndroidPermission(permisionID) {
 				let result = await permision.requestAndroidPermission(permisionID)
 				if (result == 1) {
-					this.getLocation()
+					uni.getLocation({
+					    type: 'wgs84',
+					    success: res=>{
+					        console.log("获取到定位");
+					    },
+						fail:err=>{
+							console.log("没获取到定位")
+						}
+					});
 				} else if (result == 0) {
-					this.getLocation()
-				} else {
-					this.getLocation()
-				}
-			},
-			getLocation() {
-				let that = this
-				uni.getLocation({
-					type: 'wgs84',
-					geocode: true,
-					success: function(res) {
-						switch (res.address.province) {
-							case "北京市":
-								{
-									that.city = "直辖市"
-									break;
-								}
-							case "天津市":
-								{
-									that.city = "直辖市"
-									break;
-								}
-							case "上海市":
-								{
-									that.city = "直辖市"
-									break;
-								}
-							case "重庆市":
-								{
-									that.city = "直辖市"
-									break;
-								}
-							default:
-								{
-									that.city = "不是直辖市"
-									break;
-								}
+					uni.getLocation({
+					    type: 'wgs84',
+					    success: res=>{
+					        console.log("获取到定位");
+					    },
+						fail:err=>{
+							console.log("没获取到定位")
 						}
-						if (that.city == "直辖市") {
-							let RegionData = res.address.province + "," + that.city + "," + res.address.district
-							that.defaultRegion = RegionData.split(",");
-						} else {
-							let RegionData = res.address.province + "," + res.address.city + "," + res.address.district
-							that.defaultRegion = RegionData.split(",");
+					});
+				} else {
+					uni.getLocation({
+					    type: 'wgs84',
+					    success: res=>{
+					        console.log("获取到定位");
+					    },
+						fail:err=>{
+							console.log("没获取到定位")
 						}
-					}
-				});
+					});
+				}
 			},
 			nextStep() {
 				this.$refs.uForm.validate(valid => {

+ 8 - 3
pages/login/register_3.vue

@@ -141,6 +141,9 @@
 			})
 		},
 		mounted() {
+			uni.showLoading({
+				title: '加载中...'
+			});
 			this.getAgentArea()
 			this.getTasknum()
 		},
@@ -193,7 +196,7 @@
 				}).catch(err => {
 					console.log(err)
 				}).finally(() => {
-
+					uni.hideLoading()
 				})
 			},
 			getQuerybrand(){
@@ -268,11 +271,13 @@
 				this.$refs.uForm.validate(valid => {
 					if (valid) {
 						if(!this.protocol)return this.$u.toast('请勾选协议');
-						console.log('验证通过');
+						this.setData()
 					} else {
 						console.log('验证失败');
 					}
 				});
+			},
+			setData(){
 				this.brandAgentLvQueryList = this.checkedAgentlist.reduce((res, item) => {
 					res.push({
 						agent_id: item.agent_id,
@@ -327,7 +332,7 @@
 				}).finally(() => {
 					this.loading = false
 				})
-			},
+			}
 		},
 		onReady() {
 			this.$refs.uForm.setRules(this.rules);

+ 2 - 0
pages/me/setting/setting.vue

@@ -132,6 +132,7 @@
 								console.log("已是最新版本")
 							} else if (wgtinfo.version != res.data.forceVersion) {
 								console.log("强制版本更新")
+								res.data.msg = res.data.msg.replace(/\\n/g,"\n")
 								uni.showModal({
 									title: "发现新版本",
 									content: res.data.msg,
@@ -153,6 +154,7 @@
 								})
 							} else if (wgtinfo.version == res.data.forceVersion) {
 								console.log("最低版本更新")
+								res.data.msg = res.data.msg.replace(/\\n/g,"\n")
 								uni.showModal({
 									title: "发现新版本",
 									content: res.data.msg,