diff --git a/pages/edit/edit.js b/pages/edit/edit.js
index 97601ec..453f30b 100644
--- a/pages/edit/edit.js
+++ b/pages/edit/edit.js
@@ -2,7 +2,6 @@ const util = require("../../utils/util.js");
const Http = require("../../utils/HttpBasics");
const config = require("../../config/config");
Page({
-
/**
* 页面的初始数据
*/
@@ -49,8 +48,10 @@ Page({
let that = this;
wx.chooseLocation({
success: function (res) {
+ console.log(res)
that.setData({
address: res.name + '(' + res.address + ')',
+ addressStr: JSON.stringify(res)
})
},
fail: function (error) {
@@ -73,8 +74,8 @@ Page({
} else {
var sex = that.data.sex;
}
- if (that.data.address) {
- var address = that.data.address;
+ if (that.data.addressStr) {
+ var address = that.data.addressStr;
}
else {
var address = null;
@@ -93,6 +94,10 @@ Page({
} else {
var birthdate = null;
}
+ console.log(username)
+ console.log(address)
+ console.log(sex)
+ console.log(birthdate)
if (username == null || address == null || sex == 0 || birthdate == null) {
wx.showModal({
title: '提示',
@@ -146,10 +151,17 @@ Page({
url: config.api.getScore,
data: {}
}).then(res => {
- console.log(res);
- if (res.data.address) {
+ console.log(res.data.address);
+ var reg = RegExp(/address/);
+ if (res.data.address.match(reg)) {
+ that.setData({
+ address: JSON.parse(res.data.address).address + JSON.parse(res.data.address).name,
+ addressStr: JSON.parse(res.data.address).address + JSON.parse(res.data.address).name
+ })
+ }else{
that.setData({
address: res.data.address,
+ addressStr: res.data.address
})
}
if (res.data.name) {
diff --git a/pages/user/index.wxml b/pages/user/index.wxml
index 78057c7..66009e2 100644
--- a/pages/user/index.wxml
+++ b/pages/user/index.wxml
@@ -70,7 +70,7 @@
- 版本号:3.1.2
+ 版本号:3.1.3