非遗列表和详情部分

This commit is contained in:
wenc000 2020-07-02 20:08:23 +08:00
parent b7497f1066
commit d7e913f90d
8 changed files with 102 additions and 62 deletions

View File

@ -1,7 +1,7 @@
{ {
"pages": [ "pages": [
"pages/friendCircle/friendCircle",
"pages/index/index", "pages/index/index",
"pages/friendCircle/friendCircle",
"pages/venue/venue", "pages/venue/venue",
"pages/broadcastList/broadcastList", "pages/broadcastList/broadcastList",
"pages/orderDetail/orderDetail", "pages/orderDetail/orderDetail",

View File

@ -1,20 +1,19 @@
// pages/cultureDetail/cultureDetail.js // pages/cultureDetail/cultureDetail.js
var app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
libraryUrl: app.libraryUrl,
swiper: { swiper: {
imgUrl: [ imgUrl: [],
'../../images/culture-slide.png',
'../../images/culture-slide.png',
'../../images/culture-slide.png'
],
indicatorDots: false, indicatorDots: false,
autoplay: true, autoplay: true,
current: 0 current: 0
} },
library: null
}, },
prevImg: function () { prevImg: function () {
var swiper = this.data.swiper; var swiper = this.data.swiper;
@ -33,11 +32,31 @@ Page({
swiper: swiper, swiper: swiper,
}) })
}, },
doGetLibrary: function(libraryId) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/getintangiblelibrarybyidrelease/{libraryId}', [self.data.libraryUrl, libraryId]), {}, null, function(code, data) {
var covers = data.libraryCover.split(',');
var imageArray = [];
for(var i = 0, item; item = covers[i++];) {
imageArray.push(app.restAjax.path('{libraryUrl}/route/file/downloadfile/true/{cover}', [self.data.libraryUrl, item]));
}
self.setData({
library: data,
'swiper.imgUrl': imageArray
})
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
})
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.doGetLibrary(options.libraryId);
}, },
/** /**

View File

@ -12,55 +12,55 @@
</view> </view>
</view> </view>
<view class="culture"> <view class="culture">
<view class="culture-title">民间舞蹈</view> <view class="culture-title">{{library.libraryTitle}}</view>
<view class="culture-info"> <view class="culture-info">
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>项目编号:</text> <text>项目编号:</text>
EKLAJNKAS09 {{library.libraryNumber}}
</view> </view>
<view class="info"> <view class="info">
<text>数据来源:</text> <text>数据来源:</text>
EKLAJNKAS09 {{library.librarySource}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>公布时间:</text> <text>公布时间:</text>
2020-02-03 {{library.libraryOpenDateValue}}
</view> </view>
<view class="info"> <view class="info">
<text>非遗级别:</text> <text>非遗级别:</text>
{{library.libraryLevel}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>所属地区:</text> <text>所属地区:</text>
西藏林芝市 {{library.libraryArea}}
</view> </view>
<view class="info"> <view class="info">
<text>类  型:</text> <text>类  型:</text>
新增项目 {{library.libraryTypeValue}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>申报地区或单位:</text> <text>申报地区或单位:</text>
测试 {{library.libraryAddress}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>保护单位:</text> <text>保护单位:</text>
测试 {{library.libraryAuthor}}
</view> </view>
</view> </view>
</view> </view>
<view class="part"> <view class="part">
<view class="part-title">相关描述</view> <view class="part-title">相关描述</view>
<view class="part-content"> <view class="part-content">
光拉便半运县写员二到院细天县见运命运感知争公着解全得律号深共权发市以家情军少先意单理样好族权达保很具你住红许气已第白知题候其然知王公众我头务族观经市指或七比生。适基历然题和低是局着先重信知议过说心龙素标安放大支入完二种设力果每角解收美约声里历美节办约管运但然新分活们心毛手过共点家或。革解快和特技县应精术被心走小器风育相条际北些有品同自群素革拉林积张严求选马打书。力问业光者最论快决装争每保时造何历入越日劳经干好东此金区法思设断这层压很决给地确思引光各年与队太习面方加族社种斗表越划快。 {{library.librarySummary}}
</view> </view>
</view> </view>
<view class="part"> <view class="part">
@ -68,11 +68,11 @@
<view class="row"> <view class="row">
<view class="info"> <view class="info">
<text>编  号:</text> <text>编  号:</text>
EKLAJNKAS09 {{library.libraryNumber}}
</view> </view>
<view class="info"> <view class="info">
<text>姓  名:</text> <text>姓  名:</text>
Ruby Pope {{library.libraryAuthor}}
</view> </view>
</view> </view>
<view class="row"> <view class="row">
@ -93,6 +93,3 @@
</view> </view>
</view> </view>
</view> </view>
<view class="sign-box">
<view class="sign-btn">报名</view>
</view>

View File

@ -1,22 +1,57 @@
// pages/heritage/heritage.js // pages/heritage/heritage.js
var app = getApp();
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
libraryUrl: app.libraryUrl,
libraryList: [],
currentPage: 1,
rows: 20
}, },
goDetail: function () { goDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../cultureDetail/cultureDetail', url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
}) })
}, },
doGetLibraryList: function(page) {
var self = this;
app.dialog.loading('正在加载');
app.restAjax.get(app.restAjax.path('{libraryUrl}/app/intangiblelibrary/listpageintangiblelibraryrelease', [self.data.libraryUrl]), {
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++];) {
item.libraryApplyTime = item.libraryApplyTime.substring(0, item.libraryApplyTime.length - 10);
}
var libraryArray;
if(page <= 1) {
libraryArray = data.rows;
} else {
libraryArray = self.data.news.newsList;
libraryArray = libraryArray.concat(data.rows);
}
self.setData({
currentPage: page,
libraryList: libraryArray
})
}, function(code, data) {
app.dialog.msg(data.msg);
}, function() {
wx.stopPullDownRefresh();
wx.hideLoading();
});
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
this.doGetLibraryList(1);
}, },
/** /**
@ -51,14 +86,14 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.doGetLibraryList(1);
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
this.doGetLibraryList(this.data.currentPage + 1);
}, },
/** /**

View File

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

View File

@ -1,49 +1,27 @@
<view class="top-select"> <view class="top-select">
<view class="select-box active"> <view class="select-box active">
<image src="../../images/select-tab.png"></image> <image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view> <view class="select-title">非物质文化数据库</view>
</view> </view>
<view class="select-box"> <view class="select-box">
<image src="../../images/select-tab.png"></image> <image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view> <view class="select-title">文化直播</view>
</view> </view>
<view class="select-box"> <view class="select-box">
<image src="../../images/select-tab.png"></image> <image src="../../images/select-tab.png"></image>
<view class="select-title">非遗数据库</view> <view class="select-title">文化分享</view>
</view> </view>
</view> </view>
<view class="activity"> <view class="activity">
<view class="activity-box" bindtap="goDetail"> <view class="activity-box" bindtap="goDetail" data-library-id="{{item.intangibleLibraryId}}" wx:for="{{libraryList}}" wx:for-item="item" wx:for-index="index" wx:key="libraryList">
<view class="activity-img"> <view class="activity-img">
<image src="../../images/big-news.png"></image> <image src="{{libraryUrl}}/route/file/downloadfile/true/{{item.libraryCover}}"></image>
</view> </view>
<view class="activity-info"> <view class="activity-info">
<view class="title"> <view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view> <view class="activity-title">{{item.libraryTitle}}</view>
</view> </view>
<view class="date">2020-02-02 14:00:00至2020-02-03 14:00:00</view> <view class="date">{{item.libraryApplyTime}}</view>
</view>
</view>
<view class="activity-box" bindtap="goDetail">
<view class="activity-img">
<image src="../../images/big-news.png"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view>
</view>
<view class="date">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
</view>
</view>
<view class="activity-box" bindtap="goDetail">
<view class="activity-img">
<image src="../../images/big-news.png"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">银保监会印发《关于加快推进意外险改…</view>
</view>
<view class="date">2020-02-02 14:00:00至2020-02-03 14:00:00</view>
</view> </view>
</view> </view>
</view> </view>

View File

@ -65,6 +65,9 @@ Page({
page: 1, page: 1,
rows: 5 rows: 5
}, null, function(code, data) { }, null, function(code, data) {
for(var i = 0, item; item = data.rows[i++];) {
item.cover = item.libraryCover.split(',')[0];
}
self.setData({ self.setData({
'library.bannerLibrary': data.rows 'library.bannerLibrary': data.rows
}); });
@ -124,6 +127,11 @@ Page({
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}); });
}, },
goCultureDetail: function(event) {
wx.navigateTo({
url: '../cultureDetail/cultureDetail?libraryId='+ event.currentTarget.dataset.libraryId,
})
},
goNewsDetail: function (event) { goNewsDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl, url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl,

View File

@ -1,7 +1,7 @@
<view class="swiper-box"> <view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" > <swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
<swiper-item class="swiper-item" wx:for="{{library.bannerLibrary}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerLibrary"> <swiper-item class="swiper-item" wx:for="{{library.bannerLibrary}}" bindtap="goCultureDetail" data-library-id="{{item.intangibleLibraryId}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerLibrary">
<image src="{{library.libraryUrl}}/route/file/downloadfile/true/{{item.libraryCover}}" class="swiper-img"></image> <image src="{{library.libraryUrl}}/route/file/downloadfile/true/{{item.cover}}" class="swiper-img"></image>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>