我的动态

master
许宏杰 3 years ago
parent 2884169ee4
commit e46f5c1c82

@ -13,6 +13,9 @@ App({
// 发送 res.code 到后台换取 openId, sessionKey, unionId
}
})
//自定义nav属性参数
this.setNavBarInfo()
},
globalData: {
userInfo: null,
@ -27,6 +30,7 @@ App({
* @description 设置导航栏信息
*/
setNavBarInfo() {
console.log('asasas')
// 获取系统信息
const systemInfo = wx.getSystemInfoSync();
// 胶囊按钮位置信息

@ -1,4 +1,4 @@
<view class="nav {{scrollCss>10? 'navstyl' : 'unnavstyl'}}" style="height:{{navBarHeight}}px;background: {{titlebg}};">
<view class="nav {{scrollCss>10? 'navstyl' : 'unnavstyl'}}" style="height:{{navBarHeight}}px; background: {{titlebg}};">
<view class="nav-main" style="height:{{menuHeight}}px;bottom:{{menuBotton}}px;left:{{menuRight}}px;right:{{menuRight}}px">
<!-- 胶囊区域 -->
<view class="capsule-box" style="height:{{menuHeight}}px;width:{{menuWidth}}px"></view>

@ -34,7 +34,7 @@
.nav-main .left{
font-size: 35rpx;
color: #000000;
margin-left: 20rpx;
margin-left: 0rpx;
}
/* 胶囊 */
.nav-main .capsule-box {

@ -1,4 +1,6 @@
// pages/dynamic/index.js
let app = getApp()
Page({
/**
@ -12,9 +14,34 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getList()
},
goConcernPath(){
wx.navigateTo({
url: '/pages/Concern/index',
})
},
goSilkPath(){
wx.navigateTo({
url: '/pages/Silk/index',
})
},
getList() {
app.fetch(`9017/jsonData/shequ.json`, {}, false, 'GET').then(res => {
this.setData({
list: res.data.list
})
})
},
goInfo(e) {
let data =JSON.stringify(e.currentTarget.dataset.item)
wx.navigateTo({
url: `/pages/shequinfo/index?data=${data}`,
})
},
goBack(){
wx.navigateBack()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

@ -1,4 +1,6 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的动态"
"usingComponents": {
"my-navBar":"/navBar/index"
},
"navigationStyle":"custom"
}

@ -1,2 +1,68 @@
<!--pages/dynamic/index.wxml-->
<text>pages/dynamic/index.wxml</text>
<view class="dongtai-container">
<my-navBar scrollCss="{{scrollTop}}" textColor="{{titleColor}}" titlebg="{{'transparent'}}">
<view class="back" slot="left" bindtap="goBack">
<van-icon name="arrow-left" style="font-size: 44rpx; color: #fff;" />
</view>
</my-navBar>
<view class="top-messag">
<view class="users">
<view class="top-user">
<view class="user-icons">
<image src="http://img.xizhihk.com/MTYyNzQzODE3NzcwOSM3NTMjcG5n.png" mode="aspectFill"></image>
</view>
<view class="user-data"></view>
</view>
<view class="bottom-num">
<view class="user-name">
小船摇啊摇
</view>
<view class="chishu">露营1次</view>
<view class="location-ip">IP属地江苏</view>
</view>
</view>
<view class="mine-data-num">
<view class="mine-data-item" bindtap="goConcernPath">
<view class="item-value">3</view>
<view class="item-lable">关注</view>
</view>
<view class="mine-data-item charu" bindtap="goSilkPath">
<view class="item-value">3</view>
<view class="item-lable">粉丝</view>
</view>
<view class="mine-data-item charu">
<view class="item-value">0</view>
<view class="item-lable">获赞</view>
</view>
</view>
</view>
<view class="list">
<view class="picture" >
<block wx:for="{{ list }}" wx:key="index">
<view class="item" bindtap="goInfo" data-item="{{item}}">
<view>
<image lazy-load mode="widthFix" src="{{ item.post.images[0].url}}" />
</view>
<view class="text-center">{{ item.post.title}}</view>
<view class="user-boxs">
<view class="user-icon">
<image src="{{item.user.portrait}}" mode="aspectFill"></image>
</view>
<view class="user-text">{{item.user.nick}}</view>
<view class="user-btn">
<view class="btn-icon">
<image src="http://www.jichuanglanhai.com/demo/js-yingdi/images/icon_heart@2x.png" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
<view class="null-wrap"></view>
</block>
</view>
</view>
</view>

@ -1 +1,177 @@
/* pages/dynamic/index.wxss */
/* pages/dynamic/index.wxss */
.top-messag {
height: 506rpx;
background: url('http://img.xizhihk.com/MTY2MTE3ODkzOTYwNCMxOTgjanBn.jpg');
background-size: 100% 100%;
box-sizing: border-box;
padding-top: 192rpx;
position: relative;
}
.users {
display: flex;
align-content: center;
}
.user-icons{
margin-left: 29rpx;
height: 118rpx;
width: 118rpx;
border-radius: 50%;
}
.user-icons image {
height: 100%;
width: 100%;
display: block;
border-radius: 50%;
}
.bottom-num {
flex: 1;
margin-left: 22rpx;
}
.user-name {
font-size: 30rpx;
font-weight: 500;
color: #FFFFFF;
font-family: "Alibaba-PuHuiTi-Medium.otf";
}
.chishu{
margin: 6rpx 0;
font-size: 22rpx;
color: #ffff;
font-family: "Alibaba-PuHuiTi-Regular.otf";
}
.location-ip{
font-size: 25rpx;
font-weight: 400;
color: #FFFFFF;
opacity: 0.7;
font-family: "Alibaba-PuHuiTi-Regular.otf";
}
.mine-data-num{
display: flex;
box-sizing: border-box;
padding-top: 50rpx;
/* padding-left: 29rpx; */
}
.mine-data-item{
width: 20%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.item-value{
font-size: 38rpx;
font-family: 'xiaowei';
font-weight: 400;
color: #FFFFFF;
}
.item-lable{
margin-top: 10rpx;
font-size: 29rpx;
font-family: "Alibaba-PuHuiTi-Medium.otf";
font-weight: 500;
color: #FFFFFF;
}
.charu{
position: relative;
}
.charu::before{
position: absolute;
content: '';
left: 0;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 60rpx;
border-left: 2rpx dashed #ccc;
border-radius: 2px;
}
.list{
position: absolute;
width: 100%;
top: 495rpx;
background-color: #fff;
border-radius: 10rpx 10rpx 0 0;
height: 100rpx;
}
/* 瀑布流布局 */
.picture{
column-gap: 3rpx;
column-count: 2;
margin: 0 10rpx;
margin-top: 30rpx;
margin-bottom: 50rpx;
}
.item {
width: calc(100% - 30rpx);
break-inside: avoid;
box-shadow: 0 5px 15px 0 rgba(0,0,0,0.1);
border-radius: 10rpx;
margin: 0 15rpx;
}
.item image {
width: 100%;
border-radius: 10rpx 10rpx 0 0;
}
.null-wrap{
height: 30rpx;
}
.data-img{
width: 300rpx;
height: 300rpx;
}
.text-center{
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
box-sizing: border-box;
padding: 19rpx 0 0 19rpx;
font-size: 26rpx;
font-family: "Alibaba-PuHuiTi-Medium.otf";
font-weight: 500;
color: #273329;
}
.user-boxs{
box-sizing: border-box;
padding: 19rpx 0 19rpx 19rpx;
display: flex;
align-items: center;
}
.user-icon{
width: 39rpx;
height: 39rpx;
border-radius: 50%;
}
.user-icon image{
height: 100%;
width: 100%;
display: block;
border-radius: 50%;
}
.user-text{
flex: 1;
box-sizing: border-box;
padding-left: 11rpx;
font-size: 22rpx;
font-family: "Alibaba-PuHuiTi-Regular.otf";
font-weight: 400;
color: #9C9D9D;
}
.user-btn{
margin-right: 18rpx;
}
.btn-icon{
width: 23rpx;
height: 23rpx;
}
.btn-icon image{
height: 100%;
width: 100%;
display: block;
}

@ -19,7 +19,7 @@
</view>
<view class="user-item">
<view class="item-data" bindtap="godynamicPath">
<view class="data-value">0</view>
<view class="data-value">20</view>
<view class="data-lable">动态</view>
</view>

@ -78,6 +78,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/dynamic/index",
"query": "",
"launchMode": "default",
"scene": null
}
]
}

Loading…
Cancel
Save