Skip to content

Commit

Permalink
Merge pull request #3 from LindsBravill/revert-2-feat/my
Browse files Browse the repository at this point in the history
Revert "feat/my"
  • Loading branch information
LindsBravill committed Sep 22, 2023
2 parents d78d1a7 + d0e17e7 commit efb92d7
Show file tree
Hide file tree
Showing 20 changed files with 17 additions and 368 deletions.
2 changes: 1 addition & 1 deletion custom-tab-bar/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"usingComponents": {
"t-tab-bar": "tdesign-miniprogram/tab-bar/tab-bar",
"t-tab-bar-item": "tdesign-miniprogram/tab-bar-item/tab-bar-item"
}
}
}
29 changes: 0 additions & 29 deletions pages/my/components/custom-top-bar/index.js

This file was deleted.

4 changes: 0 additions & 4 deletions pages/my/components/custom-top-bar/index.json

This file was deleted.

15 changes: 0 additions & 15 deletions pages/my/components/custom-top-bar/index.less

This file was deleted.

4 changes: 0 additions & 4 deletions pages/my/components/custom-top-bar/index.wxml

This file was deleted.

34 changes: 0 additions & 34 deletions pages/my/components/info-card/index.js

This file was deleted.

6 changes: 0 additions & 6 deletions pages/my/components/info-card/index.json

This file was deleted.

73 changes: 0 additions & 73 deletions pages/my/components/info-card/index.less

This file was deleted.

12 changes: 0 additions & 12 deletions pages/my/components/info-card/index.wxml

This file was deleted.

28 changes: 5 additions & 23 deletions pages/my/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
// index.js
const app = getApp();
import {
fetchMyatvs
} from '../../services/fetchMyAtvs';
// logs.js
const util = require('../../utils/util.js')

Page({
data: {
navBarHeight: app.globalData.navBarHeight,
profile: "https://tdesign.gtimg.com/miniprogram/images/avatar1.png",
username: '蔡宣轩',
tags: ['29岁', '设计/艺术从业者'],
myAtvs: []
logs: []
},

// 加载页面数据
async loadData() {
const {
data
} = await fetchMyatvs();
this.setData({
myAtvs: data
})
},

onLoad() {
this.loadData();

}
})
})
12 changes: 1 addition & 11 deletions pages/my/index.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
{
"navigationBarTitleText": "我的",
"usingComponents": {
"t-avatar": "tdesign-miniprogram/avatar/avatar",
"t-avatar-group": "tdesign-miniprogram/avatar-group/avatar-group",
"t-icon": "tdesign-miniprogram/icon/icon",
"custom-top-bar": "./components/custom-top-bar/index",
"t-tabs": "tdesign-miniprogram/tabs/tabs",
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
"t-image": "tdesign-miniprogram/image/image",
"info-card": "./components/info-card/index"
},
"navigationStyle": "custom"
"usingComponents": {}
}
89 changes: 6 additions & 83 deletions pages/my/index.less
Original file line number Diff line number Diff line change
@@ -1,85 +1,8 @@
page {
background: #f5f6f7;
position: relative;
}

.background {
height: 163px;
background-color: #fff;
background-size: cover;
}

custom-top-bar {
width: 100%;
position: fixed;
z-index: 99;
top: 0;
}

.content {
position: absolute;
width: 100%;
margin-top: 5px;
padding-bottom: calc(env(safe-area-inset-bottom) + 112rpx);
}

.myInfo {
width: 343px;
height: 96px;
border-radius: 12px;
background: #ffffff;
margin: 0 auto 16px auto;
.log-list {
display: flex;
flex-direction: row;
align-items: center;
position: relative;

.profile {
margin: 16px;
}

.info {
.username {
color: #000000e6;
font-size: 16px;
font-weight: 600;
font-family: "PingFang SC";
line-height: 24px;
margin-bottom: 8px;
}

.tags {
text {
display: inline-block;
height: 24px;
border-radius: 3px;
background: #f3f3f3;
color: #000000e6;
font-size: 12px;
font-weight: 400;
font-family: "PingFang SC";
text-align: center;
line-height: 24px;
margin-right: 8px;
padding: 0 8px;
}
}
}

.t-icon {
position: absolute;
right: 16px;
}
flex-direction: column;
padding: 40rpx;
}
.log-item {
margin: 10rpx;
}

.myAtvs {
width: 343px;
border-radius: 12px;
overflow: hidden;
background: #ffffff;
margin: 0 auto;

.custom-tabs {
height: 48px;
}
}
26 changes: 3 additions & 23 deletions pages/my/index.wxml
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
<!--my/index.wxml-->
<view class="background" style="background-image: url(../../src/imgs/top-bar/topbar-bc.png);">
<!--logs.wxml-->
<view class="container">
My Page
</view>
<custom-top-bar></custom-top-bar>
<view class="content" style="top: {{navBarHeight}}px;">
<view class="myInfo">
<t-avatar class="profile" image="{{profile}}" size="64px" />
<view class="info">
<view class="username">{{username}}</view>
<view class="tags">
<text wx:for="{{tags}}">{{item}}</text>
</view>
</view>
<t-icon name="edit-1" size="20px" bind:click="onIconTap" />
</view>
<view class="myAtvs">
<t-tabs defaultValue="{{0}}" t-class="custom-tabs">
<t-tab-panel label="待参加" value="0" />
<t-tab-panel label="已完成" value="1" />
<t-tab-panel label="全部活动" value="2" />
</t-tabs>
<info-card wx:for="{{myAtvs}}" info="{{item}}"></info-card>
</view>
</view>
2 changes: 1 addition & 1 deletion services/delay.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default function delay(ms = 500) {
return new Promise(resolve => {
setTimeout(resolve, ms);
})
}
}
Loading

0 comments on commit efb92d7

Please sign in to comment.