From 03a2cd035fb6cf206dc768f4ebdb54bb838553b3 Mon Sep 17 00:00:00 2001 From: wenc000 <450292408@qq.com> Date: Sat, 4 Jul 2020 13:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8B=E5=8F=8B=E5=9C=88=E5=88=97=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + pages/cultureDetail/cultureDetail.js | 22 ++++++++-- pages/cultureDetail/cultureDetail.wxml | 46 +++++++++++---------- pages/cultureDetail/cultureDetail.wxss | 7 +++- pages/friendCircle/friendCircle.js | 55 ++++++++++++++++++++++--- pages/friendCircle/friendCircle.json | 5 ++- pages/friendCircle/friendCircle.wxml | 56 +++++++++++--------------- pages/friendCircle/friendCircle.wxss | 14 ++++--- pages/heritage/heritage.js | 10 +++++ pages/heritage/heritage.wxml | 4 +- pages/index/index.js | 10 ++--- 11 files changed, 152 insertions(+), 78 deletions(-) diff --git a/app.js b/app.js index 963a639..d9543e8 100644 --- a/app.js +++ b/app.js @@ -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 () { diff --git a/pages/cultureDetail/cultureDetail.js b/pages/cultureDetail/cultureDetail.js index e32b2f2..66e8c34 100644 --- a/pages/cultureDetail/cultureDetail.js +++ b/pages/cultureDetail/cultureDetail.js @@ -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) }, /** diff --git a/pages/cultureDetail/cultureDetail.wxml b/pages/cultureDetail/cultureDetail.wxml index 8dae8cb..b42ef5f 100644 --- a/pages/cultureDetail/cultureDetail.wxml +++ b/pages/cultureDetail/cultureDetail.wxml @@ -65,30 +65,32 @@ 相关传承人 - - - 编  号: - {{library.libraryNumber}} + + + + 编  号: + {{item.libraryPersonNumber}} + + + 姓  名: + {{item.libraryPersonName}} + - - 姓  名: - {{library.libraryAuthor}} + + + 性  别: + {{item.libraryPersonSex == 1 ? '男' : '女'}} + + + 出生日期: + {{item.libraryPersonBirthday }} + - - - - 性  别: - 男 - - - 出生日期: - 1989年5月23日 - - - - - 民  族: - 藏族 + + + 民  族: + {{item.libraryPersonNationDictionaryName}} + diff --git a/pages/cultureDetail/cultureDetail.wxss b/pages/cultureDetail/cultureDetail.wxss index 20f017b..40e8a53 100644 --- a/pages/cultureDetail/cultureDetail.wxss +++ b/pages/cultureDetail/cultureDetail.wxss @@ -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; } \ No newline at end of file diff --git a/pages/friendCircle/friendCircle.js b/pages/friendCircle/friendCircle.js index dd7887d..7dbc9e1 100644 --- a/pages/friendCircle/friendCircle.js +++ b/pages/friendCircle/friendCircle.js @@ -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); }, /** diff --git a/pages/friendCircle/friendCircle.json b/pages/friendCircle/friendCircle.json index 8835af0..8275159 100644 --- a/pages/friendCircle/friendCircle.json +++ b/pages/friendCircle/friendCircle.json @@ -1,3 +1,6 @@ { - "usingComponents": {} + "usingComponents": {}, + "enablePullDownRefresh": true, + "backgroundTextStyle": "dark", + "onReachBottomDistance": 50 } \ No newline at end of file diff --git a/pages/friendCircle/friendCircle.wxml b/pages/friendCircle/friendCircle.wxml index 0005b82..a193577 100644 --- a/pages/friendCircle/friendCircle.wxml +++ b/pages/friendCircle/friendCircle.wxml @@ -1,59 +1,51 @@ - - + + - + - 张三 - 内容内容内容内容内容 - 2020-01-01 00:00:00 + {{item.creatorName}} + {{item.content}} + {{item.gmtCreate}} - + - + - 张三 - 内容内容内容内容内容 + {{item.creatorName}} + {{item.content}} - + - 2020-01-01 00:00:00 + {{item.gmtCreate}} - + - + - 张三 - 内容内容内容内容内容 + {{item.creatorName}} + {{item.content}} - - - - - - - - - + - 2020-01-01 00:00:00 + {{item.gmtCreate}} - + - + - 张三 - 内容内容内容内容内容 + {{item.creatorName}} + {{item.content}} - + - 2020-01-01 00:00:00 + {{item.gmtCreate}} \ No newline at end of file diff --git a/pages/friendCircle/friendCircle.wxss b/pages/friendCircle/friendCircle.wxss index b8dc371..00bff95 100644 --- a/pages/friendCircle/friendCircle.wxss +++ b/pages/friendCircle/friendCircle.wxss @@ -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%; } \ No newline at end of file diff --git a/pages/heritage/heritage.js b/pages/heritage/heritage.js index 5839247..2e358bb 100644 --- a/pages/heritage/heritage.js +++ b/pages/heritage/heritage.js @@ -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('正在加载'); diff --git a/pages/heritage/heritage.wxml b/pages/heritage/heritage.wxml index 624f1f7..99632f4 100644 --- a/pages/heritage/heritage.wxml +++ b/pages/heritage/heritage.wxml @@ -3,11 +3,11 @@ 非物质文化遗产数据库 - + 文化直播 - + 文化分享 diff --git a/pages/index/index.js b/pages/index/index.js index f1f0e99..de1dec0 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -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 () { - + }, /**