-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
231 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ App({ | |
}) | ||
}, | ||
globalData: { | ||
userInfo: null | ||
userInfo: null, | ||
userAvatarUrl: null, | ||
userName: null | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// pages/user/comments.js | ||
Page({ | ||
|
||
/** | ||
* 页面的初始数据 | ||
*/ | ||
data: { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面加载 | ||
*/ | ||
onLoad(options) { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面初次渲染完成 | ||
*/ | ||
onReady() { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面显示 | ||
*/ | ||
onShow() { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面隐藏 | ||
*/ | ||
onHide() { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面卸载 | ||
*/ | ||
onUnload() { | ||
|
||
}, | ||
|
||
/** | ||
* 页面相关事件处理函数--监听用户下拉动作 | ||
*/ | ||
onPullDownRefresh() { | ||
|
||
}, | ||
|
||
/** | ||
* 页面上拉触底事件的处理函数 | ||
*/ | ||
onReachBottom() { | ||
|
||
}, | ||
|
||
/** | ||
* 用户点击右上角分享 | ||
*/ | ||
onShareAppMessage() { | ||
|
||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"usingComponents": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!--pages/user/comments.wxml--> | ||
<text>pages/user/comments.wxml</text> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* pages/user/comments.wxss */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// pages/user/userChange.js | ||
const app = getApp(); | ||
Page({ | ||
|
||
/** | ||
* 页面的初始数据 | ||
*/ | ||
data: { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面加载 | ||
*/ | ||
onLoad(options) { | ||
console.log("接受shoufengqin页面传递过来的参数:",options) | ||
this.setData({ | ||
avatarUrl: options.avatarUrl, | ||
nickName: options.nickName | ||
}) | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面初次渲染完成 | ||
*/ | ||
onReady() { | ||
|
||
}, | ||
|
||
/** | ||
* 生命周期函数--监听页面显示 | ||
*/ | ||
onShow() { | ||
|
||
}, | ||
|
||
getName(e) { | ||
this.setData({ | ||
nickName: e.detail.value | ||
}) | ||
}, | ||
|
||
chooseImage() { | ||
wx.chooseMedia({ | ||
count: 1, | ||
mediaType: ['image'], | ||
sizeType: ['compressed'], //可以指定是原图还是压缩图,这里用压缩 | ||
sourceType: ['album', 'camera'], //从相册选择 | ||
success: (res) => { | ||
console.log("选择图片成功", res) | ||
this.setData({ | ||
avatarUrl: res.tempFiles[0].tempFilePath | ||
}) | ||
} | ||
}) | ||
}, | ||
|
||
/** */ | ||
submit(){ | ||
/* 设置globalData属性,保存用户属性*/ | ||
app.globalData.userAvatarUrl = this.data.avatarUrl; | ||
app.globalData.userName = this.data.nickName; | ||
|
||
wx.switchTab({ | ||
url: '/pages/user/user', | ||
})//移动到user界面 | ||
wx.showToast({ | ||
title: '成功修改', | ||
icon: 'success', | ||
duration: 2000 | ||
}) | ||
}, | ||
/** | ||
* 用户点击右上角分享 | ||
*/ | ||
onShareAppMessage() { | ||
|
||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"usingComponents": {}, | ||
"navigationBarTitleText": "修改资料" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!--pages/user/userChange.wxml--> | ||
<view class="item"> | ||
<view class="tip">编辑姓名</view> | ||
<input value="{{nickName}}" bindinput="getName" /> | ||
</view> | ||
<view class="line"></view> | ||
|
||
<view class="item" bindtap="chooseImage"> | ||
<view class="tip">点击修改头像</view> | ||
<image src="{{avatarUrl}}" /> | ||
</view> | ||
<button class="btn" bindtap="submit">提交修改</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* pages/user/userChange.wxss */ | ||
.item { | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin: 15rpx; | ||
border-bottom: 1rpx solid gray; | ||
padding-bottom: 20rpx; | ||
} | ||
|
||
.tip { | ||
font-size: 44rpx; | ||
margin: 20rpx; | ||
color: red; | ||
} | ||
|
||
.item image { | ||
width: 200rpx; | ||
height: 200rpx; | ||
border-radius: 10rpx; | ||
margin: 10rpx 30rpx; | ||
|
||
} | ||
|
||
.item input { | ||
flex: 1; | ||
border: 1px solid gray; | ||
border-radius: 20rpx; | ||
padding: 5rpx 15rpx; | ||
} | ||
|
||
.btn { | ||
color: white; | ||
margin-top: 70rpx; | ||
background-color: #2E8B57; | ||
width: 600rpx; | ||
border-radius: 50rpx; | ||
} |