个人中心

This commit is contained in:
limqhz
2022-12-13 16:53:09 +08:00
parent 0efe64d1bb
commit c0c88244c3
39 changed files with 763 additions and 60 deletions

View File

@@ -0,0 +1,10 @@
Page({
data: {
activeValues: [],
},
handleChange(e) {
this.setData({
activeValues: e.detail.value,
});
},
});

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"t-collapse": "/components/collapse/collapse",
"t-collapse-panel": "/components/collapse/collapse-panel"
}
}

View File

@@ -0,0 +1,11 @@
<wxs module="_"> module.exports.contains = function(arr, target) { return arr.indexOf(target) > -1; } </wxs>
<t-collapse value="{{activeValues}}" bind:change="handleChange">
<t-collapse-panel
header="关于我们"
header-right-content="{{_.contains(activeValues, 0) ? '收起' : '展开'}}"
value="{{0}}"
expandIcon
>
我们很强真肉蛋
</t-collapse-panel>
</t-collapse>

View File

View File

@@ -6,61 +6,41 @@ Page({
*/
data: {
aIconList: ['check-rectangle','star','notification','info-circle-filled'],
hasUserAttar: false,
userInfo: {},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
fetchWXAttar(){
wx.getUserProfile({
desc: '展示用户信息', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
console.log(res)
this.setData({
userInfo: res.userInfo,
hasUserAttar: true
})
},
fail: (e) => {
console.log(e);
}
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
viewMyMessage(){
wx.navigateTo({
url: '/pages/myself/notify/index'
});
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
viewQuestion(){
wx.navigateTo({
url: '/pages/myself/question/index'
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
viewAboutUs(){
wx.navigateTo({
url: '/pages/myself/about/index'
});
}
})

View File

@@ -1,5 +1,18 @@
<!--pages/myself/index.wxml-->
<text>关于我的</text>
<t-cell wx:if="{{hasUserAttar}}" title="{{userInfo.nickName}}">
<view class="avatar" slot="left-icon">
<open-data type="userAvatarUrl" />
</view>
</t-cell>
<t-cell wx:else title="{{'用户名'}}" description="点击授权头像信息" bind:tap="fetchWXAttar">
<view class="avatar" slot="left-icon">
<open-data type="userAvatarUrl" />
</view>
</t-cell>
<t-cell title="个人信息" hover arrow />
<t-cell title="我的消息" hover arrow bind:tap="viewMyMessage"/>
<t-cell title="常见问题" hover arrow bind:tap="viewQuestion"/>
<t-cell title="关于我们" hover arrow bind:tap="viewAboutUs"/>
<view>
<foot-tab iconList="{{aIconList}}"/>
</view>

View File

@@ -1 +1,7 @@
/* pages/myself/index.wxss */
/* pages/myself/index.wxss */
.avatar {
width: 200rpx;
height: 200rpx;
border-radius: 50%;
overflow: hidden;
}

View File

@@ -0,0 +1,10 @@
Page({
data: {
activeValues: [],
},
handleChange(e) {
this.setData({
activeValues: e.detail.value,
});
},
});

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"t-collapse": "/components/collapse/collapse",
"t-collapse-panel": "/components/collapse/collapse-panel"
}
}

View File

@@ -0,0 +1,11 @@
<wxs module="_"> module.exports.contains = function(arr, target) { return arr.indexOf(target) > -1; } </wxs>
<t-collapse value="{{activeValues}}" bind:change="handleChange">
<t-collapse-panel
header="今天任务到期了"
header-right-content="{{_.contains(activeValues, 0) ? '收起' : '展开'}}"
value="{{0}}"
expandIcon
>
这个凑数的,到时候改成已读未读的消息
</t-collapse-panel>
</t-collapse>

View File

View File

@@ -0,0 +1,11 @@
Page({
data: {
activeValues: [],
},
handleChange(e) {
console.log(this.data.activeValues)
this.setData({
activeValues: e.detail.value,
});
},
});

View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"t-collapse": "/components/collapse/collapse",
"t-collapse-panel": "/components/collapse/collapse-panel"
}
}

View File

@@ -0,0 +1,11 @@
<wxs module="_"> module.exports.contains = function(arr, target) { return arr.indexOf(target) > -1; } </wxs>
<t-collapse value="{{activeValues}}" bind:change="handleChange">
<t-collapse-panel
header="如何注册"
header-right-content="{{_.contains(activeValues, 0) ? '收起' : '展开'}}"
value="{{0}}"
expandIcon
>
你不要注册了,不给你注册,呸!
</t-collapse-panel>
</t-collapse>

View File