切换导航条
此项目
正在载入...
登录
miniprogram
/
match-west-road
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
wumengyu
6 years ago
提交
77d422f8ad5c6dcb298d454ac986db7f8979832a
1 个父辈
c91f9ebd
添加已取消icon,优化个人信息验证,登录接口添加性别参数
显示空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
87 行增加
和
23 行删除
app.js
images/quxiao@2x.png
pages/get-user-info/get-user-info.js
pages/my/edit-info/edit-info.js
pages/my/edit-info/edit-info.wxml
pages/my/edit-info/edit-info.wxss
pages/my/my-wallet/my-wallet.wxml
pages/my/my.js
app.js
查看文件 @
77d422f
...
...
@@ -52,7 +52,8 @@ App({
self
.
post
(
url
,
{
code
:
res
.
code
,
user_nickname
:
user
.
userInfo
.
nickName
,
avatar
:
user
.
userInfo
.
avatarUrl
avatar
:
user
.
userInfo
.
avatarUrl
,
sex
:
user
.
userInfo
.
gender
,
},
{}).
then
((
ret
)
=>
{
console
.
log
(
'获取token'
,
ret
);
wx
.
setStorageSync
(
'token'
,
ret
.
data
.
token
);
...
...
images/quxiao@2x.png
0 → 100644
查看文件 @
77d422f
10.0 KB
pages/get-user-info/get-user-info.js
查看文件 @
77d422f
...
...
@@ -16,7 +16,8 @@ Page({
app
.
post
(
url
,
{
code
:
res
.
code
,
user_nickname
:
e
.
detail
.
userInfo
.
nickName
,
avatar
:
e
.
detail
.
userInfo
.
avatarUrl
avatar
:
e
.
detail
.
userInfo
.
avatarUrl
,
sex
:
e
.
detail
.
userInfo
.
gender
,
},
{}).
then
((
ret
)
=>
{
console
.
log
(
'获取token'
,
ret
);
wx
.
setStorageSync
(
'token'
,
ret
.
token
);
...
...
pages/my/edit-info/edit-info.js
查看文件 @
77d422f
...
...
@@ -17,6 +17,7 @@ Page({
phone_number_params
:
''
,
introduce
:
''
,
is_change
:
false
,
is_choose_phone
:
false
},
//选择性别
sexPickerChange
(
e
)
{
...
...
@@ -30,6 +31,7 @@ Page({
inputPhone
(
e
)
{
this
.
setData
({
phone_number
:
e
.
detail
.
value
,
is_choose_phone
:
true
});
if
(
this
.
data
.
phone_number
.
length
>=
11
)
{
if
(
!
(
/^1
[
0-9
]{10}
$/
.
test
(
this
.
data
.
phone_number
))){
...
...
@@ -44,6 +46,18 @@ Page({
console
.
log
(
'params'
,
this
.
data
.
phone_number_params
);
}
}
if
(
e
.
detail
.
value
===
''
)
{
console
.
log
(
'手机号为空'
,
this
.
data
.
is_wrong_phone
,
this
.
data
.
phone_number
,
this
.
data
.
is_choose_phone
);
this
.
setData
({
is_change
:
false
});
//按钮置灰
}
if
((
this
.
data
.
is_choose_phone
&&
this
.
data
.
phone_number
!==
''
)
&&
this
.
data
.
user
.
country
!==
null
&&
this
.
data
.
user
.
city
!==
null
&&
this
.
data
.
user
.
introduce
!==
null
){
console
.
log
(
2
);
this
.
setData
({
is_change
:
true
});
}
},
//失去焦点
blur
()
{
...
...
@@ -69,7 +83,7 @@ Page({
app
.
post
(
url
,
params
,
{}).
then
((
res
)
=>
{
console
.
log
(
'自动获取手机号'
,
res
);
if
(
+
res
.
code
===
1
)
{
this
.
setData
({
phone_number
:
res
.
data
,
is_wrong_phone
:
false
})
this
.
setData
({
phone_number
:
res
.
data
,
is_wrong_phone
:
false
,
is_choose_phone
:
true
})
}
});
},
...
...
@@ -78,14 +92,36 @@ Page({
this
.
setData
({
country
:
e
.
detail
.
value
,
is_choose_country
:
true
})
});
if
(
e
.
detail
.
value
===
''
)
{
this
.
setData
({
is_change
:
false
});
}
if
((
this
.
data
.
is_choose_country
&&
this
.
data
.
country
!==
''
)
&&
this
.
data
.
user
.
city
!==
null
&&
this
.
data
.
user
.
tel
!==
null
&&
this
.
data
.
user
.
introduce
!==
null
){
console
.
log
(
2
);
this
.
setData
({
is_change
:
true
});
}
},
//输入城市
inputCity
(
e
)
{
this
.
setData
({
city
:
e
.
detail
.
value
,
is_choose_city
:
true
})
});
if
(
e
.
detail
.
value
===
''
)
{
this
.
setData
({
is_change
:
false
});
}
if
((
this
.
data
.
is_choose_city
&&
this
.
data
.
city
!==
''
)
&&
this
.
data
.
user
.
country
!==
null
&&
this
.
data
.
user
.
tel
!==
null
&&
this
.
data
.
user
.
introduce
!==
null
){
console
.
log
(
2
);
this
.
setData
({
is_change
:
true
});
}
},
//简介
inputContent
(
e
)
{
...
...
@@ -105,17 +141,37 @@ Page({
introduce
:
textcontent
,
is_choose_introduce
:
true
});
if
(
e
.
detail
.
value
===
''
)
{
this
.
setData
({
is_change
:
false
});
}
console
.
log
(
'textcontent'
,
textcontent
);
if
(
this
.
data
.
current_sex
!==
undefined
&&
this
.
data
.
country
!==
''
&&
this
.
data
.
city
!==
''
&&
this
.
data
.
phone_number
!==
''
&&
!
this
.
data
.
is_wrong_phone
&&
this
.
data
.
introduce
!==
''
)
{
if
((
this
.
data
.
is_choose_introduce
&&
this
.
data
.
introduce
!==
''
)
&&
this
.
data
.
user
.
city
!==
null
&&
this
.
data
.
user
.
tel
!==
null
&&
this
.
data
.
user
.
country
!==
null
){
console
.
log
(
2
);
this
.
setData
({
is_change
:
true
});
}
else
{
this
.
setData
({
is_change
:
false
});
}
// if((this.data.is_choose_country&&this.data.country !== '')&&
// (this.data.is_choose_city&&this.data.city !== '') &&
// (this.data.is_choose_phone&&this.data.phone_number !== '') &&
// (this.data.is_choose_introduce&&this.data.introduce !== '')
// ) {
// console.log(1);
// this.setData({is_change:true});
// }else if((this.data.is_choose_country&&this.data.country !== '')){
// console.log(2);
// this.setData({is_change:true});
// }
// if(((this.data.is_choose_country&&this.data.country !== '') || this.data.user.country !== null) &&
// ((this.data.is_choose_city&&this.data.city !== '')|| this.data.user.city !== null) &&
// ((this.data.is_choose_phone&&this.data.phone_number !== '')|| this.data.user.tel !== null) &&
// !this.data.is_wrong_phone &&
// ((this.data.is_choose_introduce&&this.data.introduce !== '') || this.data.user.introduce !== null)) {
// console.log('111');
// this.setData({is_change:true});
// }
}
},
//保存
...
...
@@ -125,8 +181,8 @@ Page({
wx
.
showToast
({
title
:
'请填写国家'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
city
===
''
&&
this
.
data
.
user
.
city
===
null
)
{
wx
.
showToast
({
title
:
'请填写城市'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
phone_number
===
''
&&
this
.
data
.
user
.
tel
===
null
)
{
wx
.
showToast
({
title
:
'请填写手机号'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
user
.
tel
===
null
)
{
wx
.
showToast
({
title
:
'请获取手机号'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
is_wrong_phone
){
wx
.
showToast
({
title
:
'手机号格式错误'
,
icon
:
'none'
})
}
else
if
(
this
.
data
.
introduce
===
''
&&
this
.
data
.
user
.
introduce
===
null
)
{
...
...
@@ -139,7 +195,8 @@ Page({
sex
:
sex
||
this
.
data
.
user
.
sex
,
country
:
this
.
data
.
is_choose_country
?
this
.
data
.
country
:
this
.
data
.
user
.
country
,
city
:
this
.
data
.
is_choose_city
?
this
.
data
.
city
:
this
.
data
.
user
.
city
,
tel
:
this
.
data
.
phone_number
!==
''
?
this
.
data
.
phone_number
:
this
.
data
.
user
.
tel
,
// tel:(this.data.is_choose_phone&&this.data.phone_number !== '')?this.data.phone_number:this.data.user.tel,
tel
:
this
.
data
.
user
.
tel
,
introduce
:
this
.
data
.
is_choose_introduce
?
this
.
data
.
introduce
:
this
.
data
.
user
.
introduce
};
app
.
post
(
url
,
params
,
{}).
then
((
res
)
=>
{
...
...
@@ -182,6 +239,9 @@ Page({
*/
onLoad
:
function
(
options
)
{
this
.
setData
({
userInfo
:
app
.
globalData
.
userInfo
});
if
(
this
.
data
.
userInfo
.
tel
!==
null
)
{
this
.
setData
({
is_wrong_phone
:
false
})
}
// console.log('userInfo', this.data.userInfo);
this
.
getDetail
();
...
...
pages/my/edit-info/edit-info.wxml
查看文件 @
77d422f
...
...
@@ -16,26 +16,27 @@
<view class="flex-box">
<view class="title">国家:</view>
<view class="text">
<input type="text" bindinput="inputCountry" value="{{
country ||
user.country}}"/>
<input type="text" bindinput="inputCountry" value="{{
is_choose_country?country:
user.country}}"/>
</view>
</view>
<view class="flex-box">
<view class="title">城市:</view>
<view class="text">
<input type="text" bindinput="inputCity" value="{{
city ||
user.city}}"/>
<input type="text" bindinput="inputCity" value="{{
is_choose_city?city:
user.city}}"/>
</view>
</view>
<view class="flex-box">
<view class="title">手机号:</view>
<view class="phone-box">
<input type="number" bindinput="inputPhone" bindblur="blur" value="{{phone_number || user.tel}}"/>
<text>{{user.tel}}</text>
<!--<input type="number" bindinput="inputPhone" bindblur="blur" value="{{is_choose_phone&&!is_wrong_phone?phone_number:user.tel}}"/>-->
<button open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" class="phone-btn">自动填写</button>
</view>
</view>
<view class="content-box">
<view class="title">个人简介:</view>
<view class="text">
<textarea type="text" bindinput="inputContent" maxlength="50" value="{{i
ntroduce ||
user.introduce}}"></textarea>
<textarea type="text" bindinput="inputContent" maxlength="50" value="{{i
s_choose_introduce?introduce:
user.introduce}}"></textarea>
<view class='word_num'>{{currentnum}}/{{maxlength}}</view>
</view>
</view>
...
...
pages/my/edit-info/edit-info.wxss
查看文件 @
77d422f
...
...
@@ -28,7 +28,7 @@
font-size: 26rpx;
color: #666666;
}
.text input, .phone-box
inpu
t {
.text input, .phone-box
tex
t {
font-size: 26rpx;
color: #666666;
}
...
...
pages/my/my-wallet/my-wallet.wxml
查看文件 @
77d422f
...
...
@@ -6,7 +6,7 @@
<view class="list-item {{item.type === 1?'change-bg':''}} {{item.status === 6?'change-bg-end':''}} {{item.status === 10?'change-bg-cancel':''}}"
wx:for="{{list}}" wx:key="index" data-id="{{item.id}}" bindtap="goDetail">
<image src="../../../images/end-flag@2x.png" wx:if="{{item.status === 6}}" class="flag-img"></image>
<image src="../../../images/
end-flag
@2x.png" wx:if="{{item.status === 10}}" class="flag-img"></image>
<image src="../../../images/
quxiao
@2x.png" wx:if="{{item.status === 10}}" class="flag-img"></image>
<view class="detail {{item.status === 6?'change-color':''}}">
<view class="area">
<text class="addr">{{item.addr}}</text>
...
...
pages/my/my.js
查看文件 @
77d422f
...
...
@@ -187,7 +187,8 @@ Page({
app
.
post
(
url
,
{
code
:
res
.
code
,
user_nickname
:
e
.
detail
.
userInfo
.
nickName
,
avatar
:
e
.
detail
.
userInfo
.
avatarUrl
avatar
:
e
.
detail
.
userInfo
.
avatarUrl
,
sex
:
e
.
detail
.
userInfo
.
gender
,
},
{}).
then
((
ret
)
=>
{
console
.
log
(
'获取token'
,
ret
);
wx
.
setStorageSync
(
'token'
,
ret
.
data
.
token
);
...
...
请
注册
或
登录
后发表评论