展示微信头像,增加背景图片

smart_class
educoder_weapp 6 years ago
parent c7b1177c8d
commit 083406bb74

@ -19,6 +19,16 @@ App({
login().then((user) => { login().then((user) => {
console.log(user); console.log(user);
console.log(AV.User.current()); console.log(AV.User.current());
if(!user.get("name_setted")){
wx.navigateTo({
url: '../user/user',
});
wx.showToast({
title: '请修改你的姓名',
duration: 5000,
icon:"none"
})
}
}); });
wx.cloud.init({ wx.cloud.init({
env: 'test-tkkvk' env: 'test-tkkvk'

@ -1,8 +1,8 @@
{ {
"pages": [ "pages": [
"pages/classes/classes", "pages/classes/classes",
"pages/changeuser/changeuser",
"pages/setting/setting", "pages/setting/setting",
"pages/changeuser/changeuser",
"pages/user/user", "pages/user/user",
"pages/addclass/addclass", "pages/addclass/addclass",
"pages/classdetail/classdetail", "pages/classdetail/classdetail",
@ -12,10 +12,11 @@
"pages/createclass/createclass" "pages/createclass/createclass"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "dark",
"navigationBarBackgroundColor": "#f2f2f2",
"navigationBarTitleText": "积分教室", "navigationBarTitleText": "积分教室",
"navigationBarTextStyle": "black" "navigationBarTextStyle": "black",
"backgroundColor": "#f2f2f2",
"navigationBarBackgroundColor": "#fbfbfb"
}, },
"tabBar": { "tabBar": {
"selectedColor": "#00C7B7", "selectedColor": "#00C7B7",

File diff suppressed because one or more lines are too long

@ -19,5 +19,5 @@ classes: 课程列表 type: Array
</block> </block>
</view> </view>
</view> </view>
<myicon class="add-class" type="add" color="#2040ef" size="56" bindtap="add_class"></myicon> <myicon class="add-class" type="add" color="#00C7B7" size="56" bindtap="add_class"></myicon>

@ -1,7 +1,7 @@
<view class="form-wrap"> <view class="setting">
<view class="user-view"> <view class="user-view bg_user">
<image src="../../images/avatar.png" class="user" mode="aspectFit"></image> <open-data type="userAvatarUrl" class="avatar" default-avatar="../../images/avatar.png"></open-data>
<text class="user" bindtap="enter_usersetting">{{current_user.name}} | {{current_user.username}}</text> <text class="user-text" bindtap="enter_usersetting">{{current_user.name}} | {{current_user.username}}</text>
</view> </view>
<view class="nav-list"> <view class="nav-list">
<navigator url="../user/user" class="nav user" bindlongpress="enter_changeuser">登陆信息修改</navigator> <navigator url="../user/user" class="nav user" bindlongpress="enter_changeuser">登陆信息修改</navigator>

@ -1,27 +1,33 @@
@import"../../images/base64/bg_user.wxss";
.nav { .nav {
background: white; background: white;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
padding: 0 12px; padding: 0 14px;
height: 46px; height: 46px;
line-height: 46px; line-height: 46px;
} }
.user-view{
display: flex;
flex-direction: column;
}
.user{ .user-text{
align-self: center;
}
text.user{
font-size: 16px; font-size: 16px;
margin-top: 5px; color: white;
margin-bottom: 8px; align-self: center;
} }
image.user{ .avatar{
margin-top: 10rpx; width: 136rpx;
height: 120rpx; height: 136rpx;
width: 120rpx; margin-top: 88rpx;
margin-bottom: 24rpx;
border-radius: 50%;
align-self: center;
overflow: hidden;
} }
.user-view{
display: flex;
flex-direction: column;
width: 750rpx;
height: 341rpx;
margin-bottom: 6rpx;
}

@ -47,7 +47,13 @@ Page({
}); });
const { name, username, password } = this.data; const { name, username, password } = this.data;
const user = User.current(); const user = User.current();
if (name) user.set({name}); if (name) {
user.set({name});
console.log("name:"+name);
if(name!="未命名"){
user.set("name_setted", true);
}
}
if (username) user.set({ username }); if (username) user.set({ username });
if (password){ if (password){
user.set({ password }); user.set({ password });

Loading…
Cancel
Save