朋友圈列表,首页

This commit is contained in:
wenc000 2020-07-04 13:03:39 +08:00
parent 0bac46e527
commit 03a2cd035f
11 changed files with 152 additions and 78 deletions

1
app.js
View File

@ -12,6 +12,7 @@ App({
volunteerUrl: 'http://192.168.0.111:8888/volunteer',
liveUrl: 'http://192.168.0.113:8084/live',
liveRecordUrl: 'http://192.168.0.113:8085',
socialUrl: 'http://192.168.0.113:7002/social',
restAjax: restAjax,
dialog: dialog,
onLaunch: function () {

View File

@ -13,7 +13,8 @@ Page({
autoplay: true,
current: 0
},
library: null
library: null,
libraryPersonList: []
},
prevImg: function () {
var swiper = this.data.swiper;
@ -24,7 +25,6 @@ Page({
})
},
nextImg: function() {
console.log(2);
var swiper = this.data.swiper;
var current = swiper.current;
swiper.current = current < (swiper.imgUrl.length - 1) ? current + 1 : 0;
@ -44,7 +44,7 @@ Page({
self.setData({
library: data,
'swiper.imgUrl': imageArray
})
});
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
@ -52,11 +52,25 @@ Page({
wx.hideLoading();
})
},
doGetLibraryPerson: function(libraryId) {
var self = this;
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibraryperson/listintangiblelibrarypersonrelease', [self.data.libraryUrl]), {
id: libraryId
}, null, function(code, data) {
self.setData({
libraryPersonList: data
})
}, function(code, data) {
app.dialog.msg(data.msg);
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.doGetLibrary(options.libraryId);
var libraryId = options.libraryId
this.doGetLibrary(libraryId);
this.doGetLibraryPerson(libraryId)
},
/**

View File

@ -65,30 +65,32 @@
</view>
<view class="part">
<view class="part-title">相关传承人</view>
<view class="row">
<view class="info">
<text>编  号:</text>
{{library.libraryNumber}}
<view class="library-person" wx:for="{{libraryPersonList}}" wx:for-item="item" wx:for-index="index" wx:key="libraryPersonList">
<view class="row">
<view class="info">
<text>编  号:</text>
{{item.libraryPersonNumber}}
</view>
<view class="info">
<text>姓  名:</text>
{{item.libraryPersonName}}
</view>
</view>
<view class="info">
<text>姓  名:</text>
{{library.libraryAuthor}}
<view class="row">
<view class="info">
<text>性  别:</text>
{{item.libraryPersonSex == 1 ? '男' : '女'}}
</view>
<view class="info">
<text>出生日期:</text>
{{item.libraryPersonBirthday }}
</view>
</view>
</view>
<view class="row">
<view class="info">
<text>性  别:</text>
</view>
<view class="info">
<text>出生日期:</text>
1989年5月23日
</view>
</view>
<view class="row">
<view class="info">
<text>民  族:</text>
藏族
<view class="row">
<view class="info">
<text>民  族:</text>
{{item.libraryPersonNationDictionaryName}}
</view>
</view>
</view>
</view>

View File

@ -44,7 +44,6 @@
right: 0;
border-radius:31rpx 31rpx 0px 0px;
background: #fff;
margin-bottom: 120rpx;
}
.culture-title{
padding: 30rpx;
@ -108,4 +107,10 @@
align-items: center;
font-size: 30rpx;
color: #fff;
}
.library-person {
border-bottom: 1px solid #FBFBFB;
}
.library-person:last-child {
border-bottom: none;
}

View File

@ -1,18 +1,63 @@
// pages/friendCircle/friendCircle.js
var app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
usercenterUrl: app.usercenterUrl,
socialUrl: app.socialUrl,
momentsList: [],
currentPage: 1,
rows: 20
},
doGetMomentsList: function(page) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{socialUrl}/app/moments/listpagemomentsofpublicrelease', [self.data.socialUrl]), {
page: page,
rows: self.data.rows
}, null, function(code, data) {
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
for(var i = 0, item; item = data.rows[i++];) {
if(item.type === 'photo') {
var photos = item.photos.split(',');
var photoArray = [];
for(var j = 0, jItem; jItem = photos[j++];) {
if(jItem.length != 0) {
photoArray.push(jItem);
}
}
item.photoArray = photoArray;
}
}
var momentsArray;
if(page <= 1) {
momentsArray = data.rows;
} else {
momentsArray = self.data.news.newsList;
momentsArray = momentsArray.concat(data.rows);
}
self.setData({
currentPage: page,
momentsList: momentsArray
})
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.doGetMomentsList(1);
},
/**
@ -47,14 +92,14 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.doGetMomentsList(1);
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.doGetMomentsList(this.data.currentPage + 1);
},
/**

View File

@ -1,3 +1,6 @@
{
"usingComponents": {}
"usingComponents": {},
"enablePullDownRefresh": true,
"backgroundTextStyle": "dark",
"onReachBottomDistance": 50
}

View File

@ -1,59 +1,51 @@
<view class="friend-circle">
<view class="friend-circle-box">
<view class="friend-circle" wx:for="{{momentsList}}" wx:for-item="item" wx:for-index="index" wx:key="momentsList">
<view class="friend-circle-box" wx:if="{{item.type === 'text'}}">
<view class="avatar">
<image src="../../images/avatar.png"></image>
<image src="{{usercenterUrl}}/app/user/downloadavatar/{{item.creator}}"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="date">2020-01-01 00:00:00</view>
<view class="name">{{item.creatorName}}</view>
<view class="text">{{item.content}}</view>
<view class="date">{{item.gmtCreate}}</view>
</view>
</view>
<view class="friend-circle-box">
<view class="friend-circle-box" wx:if="{{item.type === 'photo' && item.photoArray.length === 1}}">
<view class="avatar">
<image src="../../images/avatar.png"></image>
<image src="{{usercenterUrl}}/app/user/downloadavatar/{{item.creator}}"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="name">{{item.creatorName}}</view>
<view class="text">{{item.content}}</view>
<view class="photo-one">
<image src="../../images/center-bg.png"></image>
<image src="{{socialUrl}}/route/file/downloadfile/true/{{item.photoArray[0]}}"></image>
</view>
<view class="date">2020-01-01 00:00:00</view>
<view class="date">{{item.gmtCreate}}</view>
</view>
</view>
<view class="friend-circle-box">
<view class="friend-circle-box" wx:if="{{item.type === 'photo' && item.photoArray.length > 1}}">
<view class="avatar">
<image src="../../images/avatar.png"></image>
<image src="{{usercenterUrl}}/app/user/downloadavatar/{{item.creator}}"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="name">{{item.creatorName}}</view>
<view class="text">{{item.content}}</view>
<view class="photo-more">
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="../../images/center-bg.png"></image>
<image src="{{socialUrl}}/route/file/downloadfile/true/{{photo}}" wx:for="{{item.photoArray}}" wx:for-item="photo" wx:for-index="photoIndex" wx:key="photoArray"></image>
</view>
<view class="date">2020-01-01 00:00:00</view>
<view class="date">{{item.gmtCreate}}</view>
</view>
</view>
<view class="friend-circle-box">
<view class="friend-circle-box" wx:if="{{item.type === 'video'}}">
<view class="avatar">
<image src="../../images/avatar.png"></image>
<image src="{{usercenterUrl}}/app/user/downloadavatar/{{item.creator}}"></image>
</view>
<view class="content">
<view class="name">张三</view>
<view class="text">内容内容内容内容内容</view>
<view class="name">{{item.creatorName}}</view>
<view class="text">{{item.content}}</view>
<view class="video">
<video src="http://wxsnsdy.tc.qq.com/105/20210/snsdyvideodownload?filekey=30280201010421301f0201690402534804102ca905ce620b1241b726bc41dcff44e00204012882540400&bizid=1023&hy=SH&fileparam=302c020101042530230204136ffd93020457e3c4ff02024ef202031e8d7f02030f42400204045a320a0201000400"></video>
<video src="{{socialUrl}}/route/file/downloadfile/true/{{item.video}}"></video>
</view>
<view class="date">2020-01-01 00:00:00</view>
<view class="date">{{item.gmtCreate}}</view>
</view>
</view>
</view>

View File

@ -1,19 +1,23 @@
.friend-circle{
padding: 30rpx;
padding: 15rpx 30rpx;
border-bottom: 1px solid #DEDEDE;
}
.friend-circle:last-child {
border-bottom: none;
}
.friend-circle-box{
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
border-bottom: 1px solid #DEDEDE;
padding-bottom: 10rpx;
}
.avatar{
width: 8%;
}
.avatar image{
width: 100%;
height: 50rpx;
border-radius: 50rpx;
}
.content{
width: 90%;
@ -32,7 +36,7 @@
color: #949494;
}
.photo-one image{
width: 80%;
width: 100%;
}
.photo-more image{
width: 32%;
@ -44,5 +48,5 @@
margin-right: 0;
}
.video video{
width: 80%;
width: 100%;
}

View File

@ -15,6 +15,16 @@ Page({
url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
})
},
goLive: function() {
wx.navigateTo({
url: '../broadcast/broadcast',
})
},
goFriendCircle: function() {
wx.navigateTo({
url: '../friendCircle/friendCircle',
})
},
doGetLibraryList: function(page) {
var self = this;
app.dialog.loading('正在加载');

View File

@ -3,11 +3,11 @@
<image src="../../images/select-tab.png"></image>
<view class="select-title">非物质文化遗产数据库</view>
</view>
<view class="select-box">
<view class="select-box" bindtap="goLive">
<image src="../../images/select-tab.png"></image>
<view class="select-title">文化直播</view>
</view>
<view class="select-box">
<view class="select-box" bindtap="goFriendCircle">
<image src="../../images/select-tab.png"></image>
<view class="select-title">文化分享</view>
</view>

View File

@ -7,7 +7,7 @@ Page({
randomName: '',
showPhone: true,
gotCode: false,
restTime: 10,
restTime: 120,
timer: '',
indicatorDots: true,
autoplay: true,
@ -212,7 +212,6 @@ Page({
})
self.data.timer = setInterval(function () {
var cur = self.data.restTime - 1
console.log(cur)
if (cur == 0) {
clearInterval(self.data.timer)
self.setData({
@ -228,7 +227,6 @@ Page({
}
},
function (code, data) {
console.log(data)
wx.showToast({
title: data.msg,
icon: 'none',
@ -247,7 +245,7 @@ Page({
token: self.data.token
}
}, function (code, data) {
console.log(data)
wx.showTabBar();
wx.setStorageSync('token', data.data);
wx.setStorageSync('isRandomUsername', 0)
clearInterval(self.data.timer)
@ -255,7 +253,7 @@ Page({
showPhone: false,
restTime: 120
})
self.getUserInfo()
self.getUserInfo();
}, function (code, data) {
console.log(data)
})
@ -314,7 +312,7 @@ Page({
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**