瀏覽代碼

[编辑个人信息][修改]:[编辑个人信息的地址修改]

tags/同保楼3.1.3
meo 6 年之前
父節點
當前提交
ab2ac8c146
共有 2 個文件被更改,包括 18 次插入6 次删除
  1. +17
    -5
      pages/edit/edit.js
  2. +1
    -1
      pages/user/index.wxml

+ 17
- 5
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) {


+ 1
- 1
pages/user/index.wxml 查看文件

@@ -70,7 +70,7 @@
<view class="margin"></view>
<!-- <button bindtap="navigateTo" class="user-out-btn">退出登陆</button> -->
<view bindlongtap='showVersion' class='version'>
<view wx:if="{{flag=='show'}}">版本号:3.1.2</view>
<view wx:if="{{flag=='show'}}">版本号:3.1.3</view>
<view wx:if="{{flag=='hidden'}}"></view>
</view>
</view>


Loading…
取消
儲存