diff --git a/app.js b/app.js index 25adae5..adf56dc 100644 --- a/app.js +++ b/app.js @@ -14,15 +14,18 @@ App({ volunteerUrl: restAjax.baseUrl, activityUrl: restAjax.baseUrl, volunteerUrl: restAjax.baseUrl, - liveUrl: restAjax.url + 'live/', + liveUrl: restAjax.url + 'live', liveRecordUrl: restAjax.baseUrl, socialUrl: restAjax.baseUrl, areaCode: '540200000000', areaName: '日喀则市', areaId: '640675', shopUrl: restAjax.url + "xzshop", + bigDataUrl: restAjax.url + "module", restAjax: restAjax, shopImgUrl: restAjax.url + "xzshop/route/file/download/true/", + imgUrl: restAjax.baseUrl + "/route/file/download/true/", + liveImgUrl: restAjax.url + "live/route/file/download/true/", dialog: dialog, utils: utils, onLaunch: function () { diff --git a/app.json b/app.json index 11696fb..20ef3a9 100644 --- a/app.json +++ b/app.json @@ -53,7 +53,9 @@ "editshopaddress/editshopaddress", "orderconfirm/orderconfirm", "addresschoose/addresschoose", - "webcontentview/webcontent" + "webcontentview/webcontent", + "search/commonSearch", + "liverecord/liverecord" ] } ], diff --git a/app.wxss b/app.wxss index d033489..e02b9d2 100644 --- a/app.wxss +++ b/app.wxss @@ -76,4 +76,113 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before { /* 对勾颜色 白色 */ background: #07c160; transform: translate(-50%, -50%) scale(1); -} \ No newline at end of file +} + + + +.text-clamp1 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 1; + } + + .text-clamp2 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + + .text-clamp3 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 3; + } + + .text-clamp4 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 4; + } + + .text-clamp5 { + overflow: hidden; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 5; + } + +.flex { + display: -webkit-box; + display: -webkit-flex; + display: flex; + } + + .flex-center { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: center; + justify-content: center; + -webkit-align-items: center; + -webkit-justify-content: center; + } + + .flex-alignStart { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: flex-start; + -webkit-align-items: flex-start; + } + + .flex-alignCenter { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: center; + -webkit-align-items: center; + } + + .flex-alignEnd { + display: -webkit-box; + display: -webkit-flex; + display: flex; + align-items: flex-end; + -webkit-align-items: flex-end; + } + + .flex-between { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: space-between; + -webkit-justify-content: space-between; + } + + .flex-around { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: space-around; + -webkit-justify-content: space-around; + } + + .flex-middle { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: center; + -webkit-justify-content: center; + } + + .flex-end { + display: -webkit-box; + display: -webkit-flex; + display: flex; + justify-content: flex-end; + -webkit-justify-content: flex-end; + } \ No newline at end of file diff --git a/components/expandabletext/expandabletext.js b/components/expandabletext/expandabletext.js new file mode 100644 index 0000000..92fd564 --- /dev/null +++ b/components/expandabletext/expandabletext.js @@ -0,0 +1,80 @@ +// components/expandabletext/expandabletext.js +/** + * 长文本内容展开与收起 + * @param {String} content 长文本内容 + * @param {Number} maxline 最多展示行数[只允许 1-5 的正整数] + * @param {String} position 展开收起按钮位置[可选值为 left right] + * @param {Boolean} foldable 点击长文本是否展开收起 + */ + +Component({ + options: { + addGlobalClass: true + }, + /** + * 组件的属性列表 + */ + properties: { + content: { + type: String, + observer(val) { + console.log(val) + if (this.data.onReady) { + setTimeout(() => this.checkFold(), 10) + } + } + }, + maxline: { + type: Number, + value: 1, + observer(value) { + if (!(/^[1-5]$/).test(value)) { + throw new Error(`Maxline field value can only be digits (1-5), Error value: ${value}`) + } else if (this.data.onReady) { + setTimeout(() => this.checkFold(), 10) + } + } + }, + position: { + type: String, + value: "left" + }, + foldable: { + type: Boolean, + value: true + } + }, + + /** + * 组件的初始数据 + */ + data: { + onFold: false, + showFold: false, + onReady: false + }, + lifetimes: { + ready() { + this.checkFold() + this.data.onReady = true + } + }, + /** + * 组件的方法列表 + */ + methods: { + checkFold() { + const query = wx.createSelectorQuery().in(this); + query.selectAll(".showArea, .hideArea").boundingClientRect(res => { + this.setData({ + showFold: res[0].height < res[1].height + }) + }).exec() + }, + handleFold() { + this.setData({ + onFold: !this.data.onFold + }) + } + } +}) diff --git a/components/expandabletext/expandabletext.json b/components/expandabletext/expandabletext.json new file mode 100644 index 0000000..7e37c03 --- /dev/null +++ b/components/expandabletext/expandabletext.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/expandabletext/expandabletext.wxml b/components/expandabletext/expandabletext.wxml new file mode 100644 index 0000000..177cac9 --- /dev/null +++ b/components/expandabletext/expandabletext.wxml @@ -0,0 +1,7 @@ + + {{content || "示例文本"}} + {{content || "示例文本"}} + + {{onFold ? "收起" : "展开"}} + + \ No newline at end of file diff --git a/components/expandabletext/expandabletext.wxss b/components/expandabletext/expandabletext.wxss new file mode 100644 index 0000000..30bd345 --- /dev/null +++ b/components/expandabletext/expandabletext.wxss @@ -0,0 +1,34 @@ +.content { + width: 690rpx; + padding: 0 30rpx; + border-top: 20rpx solid transparent; + border-bottom: 20rpx solid transparent; + margin-bottom: 20rpx; + } + + .contentInner { + width: 690rpx; + color: #ffffff; + font-size: 30rpx; + line-height: 1.35; + text-align: justify; + } + + .hideArea { + display: -webkit-box; + overflow: hidden; + position: fixed; + top: 100vh; + left: -100vw; + } + + .foldInner { + width: 690rpx; + padding-top: 10rpx; + } + + .foldInner .fold { + color: #eb0000; + font-size: 32rpx; + cursor: pointer; + } \ No newline at end of file diff --git a/images/activity-on.png b/images/activity-on.png index 9393e14..21b4a86 100755 Binary files a/images/activity-on.png and b/images/activity-on.png differ diff --git a/images/activity.png b/images/activity.png index 47368d7..67b7076 100755 Binary files a/images/activity.png and b/images/activity.png differ diff --git a/images/address.png b/images/address.png index c3db54b..4cddf4d 100755 Binary files a/images/address.png and b/images/address.png differ diff --git a/images/avatar.png b/images/avatar.png index 2b021d9..3a27a6e 100755 Binary files a/images/avatar.png and b/images/avatar.png differ diff --git a/images/big-news.png b/images/big-news.png index ad890d3..104edda 100755 Binary files a/images/big-news.png and b/images/big-news.png differ diff --git a/images/center-bg.png b/images/center-bg.png index dc17baa..6b1a42a 100755 Binary files a/images/center-bg.png and b/images/center-bg.png differ diff --git a/images/center-on.png b/images/center-on.png index 2ada7b8..12b8eb5 100755 Binary files a/images/center-on.png and b/images/center-on.png differ diff --git a/images/center.png b/images/center.png index 0f4de8a..82bc34f 100755 Binary files a/images/center.png and b/images/center.png differ diff --git a/images/collect.png b/images/collect.png index beada9c..4e6fb4f 100755 Binary files a/images/collect.png and b/images/collect.png differ diff --git a/images/collected.png b/images/collected.png index 6c58152..e002b86 100755 Binary files a/images/collected.png and b/images/collected.png differ diff --git a/images/culture-on.png b/images/culture-on.png index cfd32e0..cd31b80 100755 Binary files a/images/culture-on.png and b/images/culture-on.png differ diff --git a/images/culture-slide.png b/images/culture-slide.png deleted file mode 100755 index 598e089..0000000 Binary files a/images/culture-slide.png and /dev/null differ diff --git a/images/culture.png b/images/culture.png index 0632efd..5b75524 100755 Binary files a/images/culture.png and b/images/culture.png differ diff --git a/images/delete.png b/images/delete.png index d2d9c2a..768ea38 100755 Binary files a/images/delete.png and b/images/delete.png differ diff --git a/images/friend.png b/images/friend.png index fb32fd1..ea7d2ab 100755 Binary files a/images/friend.png and b/images/friend.png differ diff --git a/images/good.png b/images/good.png index c5d5d5a..e52c992 100755 Binary files a/images/good.png and b/images/good.png differ diff --git a/images/ic_audio_bg.png b/images/ic_audio_bg.png new file mode 100755 index 0000000..56425d5 Binary files /dev/null and b/images/ic_audio_bg.png differ diff --git a/images/ic_empty_data.png b/images/ic_empty_data.png index f45aa49..625841c 100755 Binary files a/images/ic_empty_data.png and b/images/ic_empty_data.png differ diff --git a/images/ic_goods_type_default.png b/images/ic_goods_type_default.png index ecf9ab9..66ecf29 100755 Binary files a/images/ic_goods_type_default.png and b/images/ic_goods_type_default.png differ diff --git a/images/ic_music_icon.png b/images/ic_music_icon.png new file mode 100644 index 0000000..484155d Binary files /dev/null and b/images/ic_music_icon.png differ diff --git a/images/ic_search_black.png b/images/ic_search_black.png new file mode 100644 index 0000000..db4f792 Binary files /dev/null and b/images/ic_search_black.png differ diff --git a/images/ic_search_gray.png b/images/ic_search_gray.png new file mode 100644 index 0000000..d3bd372 Binary files /dev/null and b/images/ic_search_gray.png differ diff --git a/images/ic_shop_car_icon.png b/images/ic_shop_car_icon.png index 70006cd..69b6a8d 100755 Binary files a/images/ic_shop_car_icon.png and b/images/ic_shop_car_icon.png differ diff --git a/images/index-on.png b/images/index-on.png index 4a16628..e4a185d 100755 Binary files a/images/index-on.png and b/images/index-on.png differ diff --git a/images/index.png b/images/index.png index 57b5c65..a9bdc1f 100755 Binary files a/images/index.png and b/images/index.png differ diff --git a/images/login-bg.png b/images/login-bg.png index 2e3ea69..b2a2441 100755 Binary files a/images/login-bg.png and b/images/login-bg.png differ diff --git a/images/logo.png b/images/logo.png index d8bfbdb..d3b8222 100755 Binary files a/images/logo.png and b/images/logo.png differ diff --git a/images/marker_red.png b/images/marker_red.png old mode 100644 new mode 100755 index 8b4e20d..c2c8e4d Binary files a/images/marker_red.png and b/images/marker_red.png differ diff --git a/images/marker_yellow.png b/images/marker_yellow.png old mode 100644 new mode 100755 index febe8f6..d432909 Binary files a/images/marker_yellow.png and b/images/marker_yellow.png differ diff --git a/images/my-collect.png b/images/my-collect.png old mode 100644 new mode 100755 index 4f3f1cd..b367781 Binary files a/images/my-collect.png and b/images/my-collect.png differ diff --git a/images/my-comment.png b/images/my-comment.png old mode 100644 new mode 100755 index 448b590..e537d31 Binary files a/images/my-comment.png and b/images/my-comment.png differ diff --git a/images/my-sign.png b/images/my-sign.png old mode 100644 new mode 100755 index 09c9354..5ecc809 Binary files a/images/my-sign.png and b/images/my-sign.png differ diff --git a/images/play.png b/images/play.png old mode 100644 new mode 100755 index ab4c6ca..d758945 Binary files a/images/play.png and b/images/play.png differ diff --git a/images/play_next.png b/images/play_next.png new file mode 100755 index 0000000..b7fcecd Binary files /dev/null and b/images/play_next.png differ diff --git a/images/play_pause.png b/images/play_pause.png new file mode 100755 index 0000000..c556994 Binary files /dev/null and b/images/play_pause.png differ diff --git a/images/play_prev.png b/images/play_prev.png new file mode 100755 index 0000000..eebc540 Binary files /dev/null and b/images/play_prev.png differ diff --git a/images/play_resume.png b/images/play_resume.png new file mode 100755 index 0000000..68c2e85 Binary files /dev/null and b/images/play_resume.png differ diff --git a/images/prev.png b/images/prev.png old mode 100644 new mode 100755 index 190e558..1b2cd58 Binary files a/images/prev.png and b/images/prev.png differ diff --git a/images/select-tab.png b/images/select-tab.png old mode 100644 new mode 100755 index 6389bdb..923566a Binary files a/images/select-tab.png and b/images/select-tab.png differ diff --git a/images/setting.png b/images/setting.png index aa8f0a4..4572b03 100755 Binary files a/images/setting.png and b/images/setting.png differ diff --git a/images/share.png b/images/share.png index c0aca29..cd01dea 100755 Binary files a/images/share.png and b/images/share.png differ diff --git a/images/user-avatar.png b/images/user-avatar.png deleted file mode 100644 index f8e61a9..0000000 Binary files a/images/user-avatar.png and /dev/null differ diff --git a/pages/heritage/heritage.wxml b/pages/heritage/heritage.wxml index 6979eee..78eb64b 100644 --- a/pages/heritage/heritage.wxml +++ b/pages/heritage/heritage.wxml @@ -1,33 +1,33 @@ - - - 非物质文化遗产数据库 - - - - - - 文化地图 - + + + 文化地图 + - - - + + + + + + + {{item.libraryTitle}} + + {{item.libraryApplyTime}} + - - - {{item.libraryTitle}} - - {{item.libraryApplyTime}} - - \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 4694282..a45260c 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -30,16 +30,18 @@ Page({ liveList: [] }, usercenterUrl: app.usercenterUrl, + bigDataUrl: app.bigDataUrl, isConfirm: false, mainFuncList: [], mainNewTab: [], + isHide: true }, doLogin: function () { var self = this; wx.login({ success(res) { if (res.code) { - wx.setStorageSync('token', 'aGh2UkUyWTBMbFh5dlV2WXJRci9pT1VPN1JuNkhEQUc5NDF4NmdsUUUxSE91enFBc2VMTmoyTkJscDdlaEhnYW01dEQ1bDFqN1lXLzk2S2l1S1ZEclhTeEFiMEp1Vzk0a1VJWTBlandZSmV6YXVGbjhnaFMzOFN2MkdVdzZsZFA1V0JWcXBYTFFFWWRrREhUTHp0RUJ1YktFWi82N09xTGdjM1UwcFdVdy9WSTQ3U3VrUVdZVklZK0tRV2VQMTZtTElpYTkvandSNFo1cjMzVlRIaGRTVXlEUnBPQy9VV1NlNWZuYThYUzJVRT0'); + wx.setStorageSync('token', 'REQ5NW5IZTZjS2ZyQU9QQmFKZ1FIRmVhbjNFZmV4dEx3emdob2g5UjVXaForWGdpOHFIRWgyTWRIelJFWkhNS28wN1hUV2Uwb0FKSUEra2wzYVhXdnI4aG9odkxLd3ZFUGkrTTQwQTkzdyt3cnN3NkY4OE9aaGw0aUJPTUNSaENKbGxTdm8xR3Z5WTJBV0NDcWRpbEd3OW0zUzA3US8xMmUyaTU2a0N4YmN5d1FjTXd6aTZIZkhhdmpsSDlqYSt0OUJVUHRSbTJqSVd6eHlYc1M5WTlkK015MVR2R083T3crU2wrdVFmVGk4N3NHWmZNY1A3SGNNbm8xMDFMTy9tcTN2K0NuQTZJbk9YZGJqK3drQkxlMXNUVjZZNkZyRE9LMGdYdUQzSE9lbDQ9'); app.restAjax.post(app.restAjax.path('{url}/wechat-miniapp/sign/default', [app.loginUrl]), { jsCode: res.code }, null, function (code, data) { @@ -102,7 +104,8 @@ Page({ doGetNewsList(id) { var _self = this; app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [_self.data.news.newsUrl, app.areaCode]), { - newsDirectoriesId: id, + newsDirectoriesId: "", + newsDirectoriesParentId: id, page: 1, rows: 5 }, null, function (code, data) { @@ -216,7 +219,7 @@ Page({ goNewsDetail: function (event) { wx.navigateTo({ - url: '../newsDetail/newsDetail?templateRecordUrl=' + event.currentTarget.dataset.templateRecordUrl, + url: '../newsDetail/newsDetail?id=' + event.currentTarget.dataset.item.newsContentId }) }, openNewsDetail(e) { @@ -301,10 +304,23 @@ Page({ self.setData({ userInfo: data }) + self.doSaveLoginInfo(data.userId) }, function (code, data) { app.dialog.msg(data.msg); }) }, + doSaveLoginInfo(id) { + var params = "小程序USER" + id; + var info = { + requestUrl: params + } + app.restAjax.get(app.restAjax.path('{usercenterUrl}/app/contentcensusrelease/log', [app.bigDataUrl]), info, { + + }, function (code, data) { + + }, function (code, data) { + }) + }, goTrain: function () { wx.navigateTo({ url: '../train/train', @@ -344,5 +360,23 @@ Page({ self.getMainFunc(); self.getMainNewsTab(); }, - + onPageScroll(e) { + var _self = this; + if (e.scrollTop <= 96) { + //显示 + _self.setData({ + isHide: true + }) + } else { + //隐藏 + _self.setData({ + isHide: false + }) + } + }, + openSearch() { + wx.navigateTo({ + url: '/subpages/search/commonSearch', + }) + } }) \ No newline at end of file diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 5ace990..20e3f79 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -1,10 +1,11 @@ - + + @@ -66,7 +67,7 @@ - + {{item.newsContentTitle}} @@ -76,7 +77,7 @@ {{item.newsContentPublishTime}} - + @@ -88,7 +89,7 @@ - + {{item.newsContentTitle}} @@ -100,7 +101,7 @@ - + {{item.newsContentTitle}} @@ -110,14 +111,14 @@ {{item.newsContentPublishTime}} - + {{item.newsContentTitle}} 来源:{{item.newsContentResource}} {{item.newsContentPublishTime}} - + {{item.newsContentTitle}} @@ -128,12 +129,12 @@ {{item.newsContentPublishTime}} - + {{item.newsContentTitle}} 来源:{{item.newsContentResource}} {{item.newsContentPublishTime}} - + @@ -159,4 +160,7 @@ 错误 + + + \ No newline at end of file diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 58055f2..679f94f 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -5,6 +5,32 @@ swiper { height: 330rpx; } +.search-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + position: fixed; + bottom: 30rpx; + right: 50rpx; + width: 70rpx; + height: 70rpx; + background: linear-gradient(to right bottom, rgb(238 238 236 / 22%), rgb(105 105 104 / 28%) 70px); + border-radius: 50%; + padding: 10rpx; + +} + +.search-box image { + width: 48rpx; + height: 48rpx; +} + +.search-box text { + font-size: 25rpx; + color: #9f1512; +} + .tab { padding: 30rpx; display: flex; @@ -344,4 +370,12 @@ swiper { transform: translate(-50%, -50%); width: 80rpx; height: 80rpx; +} + + +.voice-img { + position: absolute; + right: 0; + width: 48rpx; + height: 48rpx; } \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.js b/pages/newsDetail/newsDetail.js index 9ab6664..00772bb 100644 --- a/pages/newsDetail/newsDetail.js +++ b/pages/newsDetail/newsDetail.js @@ -1,68 +1,232 @@ // pages/newsDetail/newsDetail.js var app = getApp(); +var audioContentx = null; Page({ - /** - * 页面的初始数据 - */ - data: { - newsContentUrl: app.newsContentUrl, - templateRecordUrl: null - }, + /** + * 页面的初始数据 + */ + data: { + newsId: '', + newsBean: null, + imgUrl: app.imgUrl, + pageHeight: 500, + currentVideoUrl: '', + currentDesc: '', + currentVideoIndex: 0, + sliderValue: 0, + currentTime: 0, + duration: 0, + currentAudioIndex: 0, + currentAudioDesc: '', + canPlay: false, + isPlaying: false, + totalValue: 0, + }, - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - this.setData({ - templateRecordUrl: options.templateRecordUrl - }) - }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + this.setData({ + newsId: options.id, + pageHeight: wx.getSystemInfoSync().windowHeight + }) + this.getNewsDetail(); + }, + getNewsDetail() { + var _self = this; + // app.dialog.loading('正在加载'); + app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/getnewscontentbyidrelease/{id}', [app.newsUrl, _self.data.newsId]), null, null, + function (code, data) { + _self.setData({ + newsBean: data + }) + //视频 + if (_self.data.newsBean.newsContentType == '4') { + _self.setData({ + currentVideoUrl: _self.data.imgUrl + _self.data.newsBean.fileList[0].contentFileFileId, + currentDesc: _self.data.newsBean.fileList[0].contentFileText + }) + } + //音频 + if (_self.data.newsBean.newsContentType == '3') { + _self.setData({ + currentAudioUrl: _self.data.imgUrl + _self.data.newsBean.fileList[0].contentFileFileId, + currentAudioDesc: _self.data.newsBean.fileList[0].contentFileText, + }) + _self.initAudio() + } + }, + function (code, data) { + app.dialog.msg(data.msg); + }, + function () { + wx.stopPullDownRefresh(); + // wx.hideLoading(); + }); + }, + setVideoUrl(e) { + var _self = this; + var item = e.currentTarget.dataset.item + var index = e.currentTarget.dataset.index + this.setData({ + currentVideoUrl: _self.data.imgUrl + item.contentFileFileId, + currentDesc: item.contentFileText, + currentVideoIndex: index + }) + }, + //初始化音频播放器 + initAudio() { + var _self = this; + audioContentx = wx.createInnerAudioContext(); - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { + audioContentx.src = _self.data.currentAudioUrl; + // 准备好歌曲流,可以播放 + audioContentx.onCanplay(() => { + _self.setData({ + canPlay: true, + duration: audioContentx.duration * 1000 + }) + console.log(audioContentx.duration) - }, + }) + audioContentx.onTimeUpdate(function () { + const currentTime = audioContentx.currentTime * 1000 + _self.setData({ + duration: audioContentx.duration * 1000, + currentTime: currentTime, + sliderValue: audioContentx.currentTime, + totalValue: audioContentx.duration + }) - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { + }); + audioContentx.onStop(() => { + _self.setData({ + isPlaying: false, + sliderValue: 0, + }) + }); + audioContentx.onEnded(() => { + _self.setData({ + isPlaying: false, + sliderValue: 0, + }) + }); + audioContentx.onPlay(() => { + _self.setData({ + isPlaying: true, + }) + }); + audioContentx.onError((res) => { + console.log(res.errMsg) + console.log(res.errCode) + }) - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () {} + }, + playAudio() { + if (audioContentx && audioContentx.paused) { + audioContentx.stop(); + audioContentx.play(); + this.setData({ + isPlaying: true + }) + } else { + audioContentx.pause(); + this.setData({ + isPlaying: false + }) + } + }, + //下一个音频 + nextAudio() { + var _self = this; + var index = _self.data.currentAudioIndex + 1 + if (index >= _self.data.newsBean.fileList.length) { + index = _self.data.newsBean.fileList.length - 1 + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } else { + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } + }, + setAudioUrl(e) { + var _self = this; + var item = e.currentTarget.dataset.item + var index = e.currentTarget.dataset.index + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId; + audioContentx.play() + this.setData({ + currentAudioIndex: index, + sliderValue: 0 + }) + } + }, + //上一个音频 + preAudio() { + var _self = this; + var index = _self.data.currentAudioIndex - 1 + if (index <= 0) { + index = 0 + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } else { + var item = _self.data.newsBean.fileList[index] + _self.setData({ + currentAudioIndex: index, + sliderValue: 0, + currentAudioDesc: item.contentFileText + }) + if (audioContentx) { + audioContentx.stop() + audioContentx.src = _self.data.imgUrl + item.contentFileFileId + audioContentx.play() + } + } + }, + //slider进度调整 + handleSliderChange(event) { + this.setData({ + currentTime: event.detail.value * 1000 + }) + audioContentx.pause() + audioContentx.seek(event.detail.value) + audioContentx.play() + }, + onUnload() { + if (audioContentx) { + audioContentx.stop(); + audioContentx.destroy(); + } + } }) \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.json b/pages/newsDetail/newsDetail.json index 8835af0..1c77cb0 100644 --- a/pages/newsDetail/newsDetail.json +++ b/pages/newsDetail/newsDetail.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "custom-content": "/components/expandabletext/expandabletext" + } } \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.wxml b/pages/newsDetail/newsDetail.wxml index ff79424..dda1eb8 100644 --- a/pages/newsDetail/newsDetail.wxml +++ b/pages/newsDetail/newsDetail.wxml @@ -1,94 +1,84 @@ - - + + + {{newsBean.newsContentTitle}} + + 新闻来源:{{newsBean.newsContentResource}} + 发布时间:{{newsBean.newsContentPublishTime}} - - - - - - - - - - 王耿 - 200 - - - 评论内容评论内容评论内容评论内容评论内容评论内容评论内容 - - - + + - - - 1天前 - 回复 - - + + + + + + + + + + + + + + + + + + + + + + {{format.formatDuration(currentTime)}} + + {{format.formatDuration(duration)}} + + + + + + + 目录 + + + {{index+1}} + + + + + | + 详情 + + {{currentAudioDesc}} + + + + + + 目录 + + + {{index+1}} + + + + + | + 详情 + + {{currentDesc}} + + + + + + + + + - - - 请填写你的评论 - - - - - - - - --> \ No newline at end of file + \ No newline at end of file diff --git a/pages/newsDetail/newsDetail.wxss b/pages/newsDetail/newsDetail.wxss index d7adf34..92023be 100644 --- a/pages/newsDetail/newsDetail.wxss +++ b/pages/newsDetail/newsDetail.wxss @@ -1,127 +1,201 @@ /* page{ background: #d2e0f6; } */ -.news-title{ - padding: 20rpx 30rpx; +.news-title { + padding: 20rpx 30rpx; + font-size: 34rpx; + font-weight: bold; + color: #242424; + text-align: center; } -.title{ - font-size: 34rpx; - font-weight: bold; - color: #242424; - text-align: center; + +.news-attr-box { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; } -.news-info{ - font-size: 28rpx; - color: #949494; + +.news-attr { + font-size: 24rpx; + color: #949494; } -.news-info text{ - margin-right: 30rpx; + +.news-attr:nth-of-type(n+2) { + margin-left: 20rpx; } -.news-content{ - padding: 0 30rpx 10rpx; - font-size: 32rpx; - color: #242424; - line-height: 50rpx; - border-bottom: 5px solid #d2e0f6; + +.news-content { + padding: 20rpx 20rpx; + font-size: 34rpx; + color: #242424; } -.comment{ - padding: 30rpx; - margin-bottom: 95rpx; + +.img-box { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + background: black; } -.commnet-box{ - display: flex; - justify-content: space-between; - margin-bottom: 10rpx; + +.swiper-item { + width: 100%; + height: 100%; + position: absolute; + transform: translate(0%, 0px) translateZ(0px); + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; } -.commnet-box view{ - flex-shrink: 0; + +.item-txt { + position: absolute; + color: white; + font-size: 24rpx; + bottom: 0rpx; } -.commnet-avatar, .commnet-avatar image{ - width: 50rpx; - height: 50rpx; + +.video-box { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: flex-start; + background: #242424; } -.comment-right{ - width: 620rpx; - padding-bottom: 20rpx; - border-bottom: 1px solid #EBEBEB; + +.video-box video { + width: 100%; } -.comment-people{ - display: flex; - font-size: 22rpx; - color: #B1B1B1; - justify-content: space-between; - vertical-align: middle; - line-height: 40rpx; + +.video-category { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: flex-start; + padding-bottom: 30rpx; + margin: 20rpx; + flex-wrap: wrap; } -.comment-people image{ - width: 40rpx; - height: 40rpx; - vertical-align: top; + +.category-title { + font-size: 34rpx; + color: white; + align-self: center; + margin-top: 20rpx; } -.comment-content{ - font-size: 30rpx; - color: #242424; - line-height: 40rpx; - margin: 10rpx 0; + +.category-item { + font-size: 30rpx; + color: white; + border: 1rpx solid #949494; + padding: 20rpx; + margin: 5rpx; } -.date-reply{ - font-size: 24rpx; + +.category-item-sel { + border: 1rpx solid #f30000; + color: #f30000; + background: #97979741; } -.date{ - color: #949494; - margin-right: 20rpx; + +.desc-box { + color: #f30000; + margin-top: 40rpx; + padding-left: 20rpx; } -.reply{ - color: #242424; + + +.desc { + font-size: 28rpx; + color: #242424; + padding: 30rpx 40rpx; } -.reply-box{ - padding: 20rpx; - background: #EDEDED; - font-size: 24rpx; - margin-top: 10rpx; - line-height: 40rpx; + +.audio-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + background: black; + color: white; } -.reply-people{ - color: #242424; + +.audio-img { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + height: 400rpx; } -.comment-img{ - margin: 10rpx 0; + +.img-bg { + width: 100%; + height: 400rpx; } -.comment-img image{ - width: 30%; - height: 150rpx; - margin-right: 15rpx; + +.img-loading { + width: 200rpx; + height: 200rpx; + position: absolute; + top: calc(50%-50rpx); + left: calc(50%-50rpx); } -.page-bottom{ - position: fixed; - left: 0; - right: 0; - bottom: 0; - padding: 10rpx 30rpx; - height: 90rpx; - box-sizing: border-box; - background: #fff; - box-shadow:0px 0px 17px 0px rgba(0,0,0,0.1); - display: flex; - justify-content: space-between; + +.progress { + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + width: 100%; } -.do-comment{ - width: 500rpx; - padding: 0 20rpx; - height: 100%; - background: #EDEDED; - flex-shrink: 0; - display: flex; - align-items: center; - color: #B1B1B1; - font-size: 26rpx; + +.slider { + margin: 10rpx; + width: 50%; } -.btn-box{ - width: 150rpx; - display: flex; - justify-content: space-between; + +.option { + display: flex; + flex: 1; + justify-content: space-between; + align-items: center; + padding-bottom: 20rpx; + width: 70%; + align-self: center; + margin-top: 20rpx; } -.collect, .share, .collect image, .share image{ - width: 70rpx; - height: 100%; + +.btn-mode, +.btn-music { + width: 70rpx; + height: 70rpx; +} + +.btn-prev, +.btn-next { + width: 70rpx; + height: 70rpx; +} + +.btn-pause { + width: 140rpx; + height: 140rpx; +} + +.current { + font-size: 28rpx; + margin-right: 30rpx; +} + +.duration { + font-size: 28rpx; + margin-left: 30rpx; +} + +.btn { + width: 64rpx; + height: 64rpx; } \ No newline at end of file diff --git a/pages/newsList/newsList.js b/pages/newsList/newsList.js index fa89a78..62f35b5 100644 --- a/pages/newsList/newsList.js +++ b/pages/newsList/newsList.js @@ -87,7 +87,7 @@ Page({ }, goNewsDetail: function (event) { wx.navigateTo({ - url: '../newsDetail/newsDetail?templateRecordUrl=' + event.currentTarget.dataset.templateRecordUrl, + url: '../newsDetail/newsDetail?id=' + event.currentTarget.dataset.item.newsContentId }) }, getAreaList: function () { diff --git a/pages/newsList/newsList.wxml b/pages/newsList/newsList.wxml index ec3c82b..827f68c 100644 --- a/pages/newsList/newsList.wxml +++ b/pages/newsList/newsList.wxml @@ -27,7 +27,7 @@ - + {{item.newsContentTitle}} @@ -37,7 +37,7 @@ {{item.newsContentPublishTime}} - + @@ -49,7 +49,7 @@ - + {{item.newsContentTitle}} @@ -61,7 +61,7 @@ - + {{item.newsContentTitle}} @@ -71,14 +71,14 @@ {{item.newsContentPublishTime}} - + {{item.newsContentTitle}} 来源:{{item.newsContentResource}} {{item.newsContentPublishTime}} - + {{item.newsContentTitle}} @@ -89,12 +89,12 @@ {{item.newsContentPublishTime}} - + {{item.newsContentTitle}} 来源:{{item.newsContentResource}} {{item.newsContentPublishTime}} - + diff --git a/pages/newsList/newsList.wxss b/pages/newsList/newsList.wxss index 5b62c2f..2658c29 100644 --- a/pages/newsList/newsList.wxss +++ b/pages/newsList/newsList.wxss @@ -221,4 +221,12 @@ .news-row-info { width: 68%; +} + + +.voice-img { + position: absolute; + right: 0; + width: 48rpx; + height: 48rpx; } \ No newline at end of file diff --git a/pages/venue/venue.wxml b/pages/venue/venue.wxml index 94a6df2..57dd59d 100644 --- a/pages/venue/venue.wxml +++ b/pages/venue/venue.wxml @@ -1,49 +1,49 @@ - - - - 全部 + + + + 全部 + + + + {{item.dictionaryName}} + - - - {{item.dictionaryName}} + + + 默认排序 + + + 离我最近 + + + 最新发布 + + + 选择区域 + + + {{areaName}} + - - - - 默认排序 - - - 离我最近 - - - 最新发布 - - - 选择区域 - - - {{areaName}} - - - - - + + + + + + + {{item.venueName}} + 距离:{{item.apart == '0' ? '未知' : item.apart}} + + 营业时间:{{item.businessHours}} + - - - {{item.venueName}} - 距离:{{item.apart == '0' ? '未知' : item.apart}} - - 营业时间:{{item.businessHours}} - - - - 全部 - {{item.areaName}} - + + 全部 + {{item.areaName}} + \ No newline at end of file diff --git a/pages/volunteer/volunteer.wxml b/pages/volunteer/volunteer.wxml index 04e15c6..170dc9c 100644 --- a/pages/volunteer/volunteer.wxml +++ b/pages/volunteer/volunteer.wxml @@ -1,63 +1,63 @@ - - - - - - - - - - - + + + + + + + + + + + - - - 志愿者注册 - 实名注册 + + + 志愿者注册 + 实名注册 + + + + - - + + + 志愿者服务组织 + 志愿者团队 + + + + - - - - 志愿者服务组织 - 志愿者团队 - - - - - - - - - 志愿活动 - - - - - - - - 报名中 - 已报名 - 停止报名 - 进行中 - 已结束 - - - - {{item.serviceName}} + + + + 志愿活动 + + + + + + + + 报名中 + 已报名 + 停止报名 + 进行中 + 已结束 + + + + {{item.serviceName}} + + {{item.startTime}}至{{item.endTime}} + - {{item.startTime}}至{{item.endTime}} - - - 发起新活动 + 发起新活动 \ No newline at end of file diff --git a/pages/volunteerRegister/volunteerRegister.wxml b/pages/volunteerRegister/volunteerRegister.wxml index fb44c3f..13f876c 100644 --- a/pages/volunteerRegister/volunteerRegister.wxml +++ b/pages/volunteerRegister/volunteerRegister.wxml @@ -1,4 +1,4 @@ - + 您已经是志愿者,可修改以下信息! diff --git a/subpages/goodsaddress/goodsaddress.wxss b/subpages/goodsaddress/goodsaddress.wxss index b024cc7..e35a71b 100644 --- a/subpages/goodsaddress/goodsaddress.wxss +++ b/subpages/goodsaddress/goodsaddress.wxss @@ -1,13 +1,15 @@ /* subpages/goodsaddress/goodsaddress.wxss */ .empty-box { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; - position: absolute; - top: 50%; - left: 50%; - transform: translateX(-50%)translateY(-50%); + background: white; } .empty-box image { diff --git a/subpages/liverecord/liverecord.js b/subpages/liverecord/liverecord.js new file mode 100644 index 0000000..6eaa123 --- /dev/null +++ b/subpages/liverecord/liverecord.js @@ -0,0 +1,73 @@ +// subpages/liverecord/liverecord.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + planId: '', + liveUrl: app.liveUrl, + liveImgUrl: app.liveImgUrl, + liveList: [], + page: 1, + rows: 5, + hasMore: true, + isLoading: true + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + planId: options.id + }) + this.getList(); + }, + + getList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liverecord/listpageliverecordrelease/' + _self.data.planId, []), + { + page: _self.data.page, + rows: _self.data.rows + }, null, + function (code, data) { + _self.data.liveList = _self.data.liveList.concat(data.rows) + _self.setData({ + liveList: _self.data.liveList, + isLoading: false, + hasMore: _self.data.liveList.length < data.total + }) + wx.stopPullDownRefresh() + }, + function (code, err) { + app.dialog.msg('网络错误') + wx.stopPullDownRefresh() + _self.setData({ + isLoading: false + }) + }, + ) + }, + onReachBottom() { + var _self = this; + if (_self.data.hasMore) { + _self.setData({ + page: _self.data.page + 1 + }) + _self.getList() + } else { + app.dialog.msg('暂无更多数据了') + } + }, + onPullDownRefresh() { + this.setData({ + liveList: [], + page: 1, + hasMore: true + }) + this.getList() + } +}) \ No newline at end of file diff --git a/subpages/liverecord/liverecord.json b/subpages/liverecord/liverecord.json new file mode 100644 index 0000000..7ad8a36 --- /dev/null +++ b/subpages/liverecord/liverecord.json @@ -0,0 +1,4 @@ +{ + "usingComponents": {}, + "enablePullDownRefresh": true +} \ No newline at end of file diff --git a/subpages/liverecord/liverecord.wxml b/subpages/liverecord/liverecord.wxml new file mode 100644 index 0000000..290f301 --- /dev/null +++ b/subpages/liverecord/liverecord.wxml @@ -0,0 +1,7 @@ + + + + + {{item.recordFileRecord}} + + \ No newline at end of file diff --git a/subpages/liverecord/liverecord.wxss b/subpages/liverecord/liverecord.wxss new file mode 100644 index 0000000..56a8c2b --- /dev/null +++ b/subpages/liverecord/liverecord.wxss @@ -0,0 +1,30 @@ +/* subpages/liverecord/liverecord.wxss */ +.video-box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + width: 95%; + padding: 20rpx 0rpx; +} + +.video-box video { + width: 100%; + height: 400rpx; + border-radius: 10rpx; + +} + +.txt { + color: #242424; + font-size: 28rpx; + margin-top: 10rpx; +} + +.page { + display: flex; + flex-direction: column; + justify-content: flex-start; + align-items: center; + margin-top: 20rpx; +} \ No newline at end of file diff --git a/subpages/search/commonSearch.js b/subpages/search/commonSearch.js new file mode 100644 index 0000000..cf1e7df --- /dev/null +++ b/subpages/search/commonSearch.js @@ -0,0 +1,470 @@ +// subpages/search/commonSearch.js +const app = getApp(); +Page({ + + /** + * 页面的初始数据 + */ + data: { + // (网页|安卓|小程序)[a-zA-Z0-9-]{36}(新闻|活动|非遗|场馆|直播|志愿) 我后台正则是这样的 + tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + currentIndex: 0, + keywords: '', + newsList: [],//新闻 + activityList: [],//活动 + legacyList: [],//非遗 + placeList: [],//场馆 + liveList: [],//直播 + volumerList: [],//志愿者活动 + isLoading: false,//是否正在加载 + isInit: true,//初始化搜索 + imgUrl: app.imgUrl, + url: app.newsUrl, + liveUrl: app.liveUrl, + liveImgUrl: app.liveImgUrl, + page: 1, + rows: 10, + hasMore: true, + latitude: '', + longitude: '' + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.getLocation(); + }, + changeTab(e) { + var _self = this; + var index = e.currentTarget.dataset.index; + this.setData({ + currentIndex: index, + hasMore: true + }) + //刷新 + if (_self.data.keywords != '') { + _self.setData({ + isLoading: true, + page: 1, + isInit: false + }) + //tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + switch (_self.data.currentIndex) { + case 0: + _self.setData({ + newsList: [], + }) + _self.getNewsList() + _self.doSaveKeyword('新闻') + break; + case 1: + _self.setData({ + activityList: [], + }) + _self.getActivityList() + _self.doSaveKeyword('活动') + break; + case 2: + _self.setData({ + legacyList: [] + }) + _self.getLegacyList() + _self.doSaveKeyword('非遗') + break; + case 3: + _self.setData({ + placeList: [] + }) + _self.getPlaceList() + _self.doSaveKeyword('场馆') + break; + case 4: + _self.setData({ + liveList: [] + }) + _self.getLiveList() + _self.doSaveKeyword('直播') + break; + case 5: + _self.setData({ + volumerList: [] + }) + _self.getVolumerList() + _self.doSaveKeyword('志愿') + break; + } + } + }, + //新闻详情 + goNewsDetail: function (event) { + wx.navigateTo({ + url: '/pages/newsDetail/newsDetail?id=' + event.currentTarget.dataset.item.newsContentId + }) + }, + //活动详情 + goDetail: function (e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/activityDetail/activityDetail?id=' + id + }) + }, + //非遗详情 + legacyDetail(e) { + wx.navigateTo({ + url: '/pages/cultureDetail/cultureDetail?libraryId=' + e.currentTarget.dataset.libraryId, + }) + }, + //场馆详情 + placeDetail: function (options) { + var venuesInfoId = options.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/venueDetail/venueDetail?venuesInfoId=' + venuesInfoId, + }) + }, + volumerDetail(e) { + var id = e.currentTarget.dataset.id; + wx.navigateTo({ + url: '/pages/serviceActivityDetail/serviceActivityDetail?id=' + id + }) + }, + //直播点播详情 + detailLive(event) { + //判断是直播还是录播 + var item = event.currentTarget.dataset.id; + if ('0' == item.liveStatus) { + //直播回放 + wx.navigateTo({ + url: '/subpages/liverecord/liverecord?id=' + item.livePlanId, + }) + } else if ('2' == item.liveStatus) { + //直播中 + wx.navigateTo({ + url: '/pages/broadcastDetail/broadcastDetail?livePlanId=' + event.currentTarget.dataset.id.livePlanId, + }) + } else { + //未开始 + } + }, + //输入监听 + inputKeywords(e) { + this.setData({ + keywords: e.detail.value + }) + if (e.detail.value == '') { + this.setData({ + isInit: true + }) + } + }, + //搜索 + doSearch() { + //tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + var _self = this; + if (_self.data.keywords == '') { + wx.showToast({ + icon: 'error', + title: '请输入关键词', + }) + } else { + _self.setData({ + isLoading: true, + page: 1, + isInit: false, + hasMore: true + }) + switch (_self.data.currentIndex) { + case 0: + _self.setData({ + newsList: [], + }) + _self.getNewsList() + _self.doSaveKeyword('新闻') + break; + case 1: + _self.setData({ + activityList: [], + }) + _self.getActivityList() + _self.doSaveKeyword('活动') + break; + case 2: + _self.setData({ + legacyList: [] + }) + _self.getLegacyList() + _self.doSaveKeyword('非遗') + break; + case 3: + _self.setData({ + placeList: [] + }) + _self.getPlaceList() + _self.doSaveKeyword('场馆') + break; + case 4: + _self.setData({ + liveList: [] + }) + _self.getLiveList() + _self.doSaveKeyword('直播') + break; + case 5: + _self.setData({ + volumerList: [] + }) + _self.getVolumerList() + _self.doSaveKeyword('志愿') + break; + } + } + }, + //获取新闻 + getNewsList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/newscontent/listpagenewscontentrelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + _self.data.newsList = _self.data.newsList.concat(data.rows) + _self.setData({ + newsList: _self.data.newsList, + isLoading: false, + hasMore: _self.data.newsList.length < data.total + }) + }, + function (code, err) { + //加载失败 + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取活动 + getActivityList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/activitylibrary/listpageactivitylibraryfornetrelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + for (var item of data.rows) { + if ('' != item.activityImage) { + item.activityImage = _self.data.imgUrl + item.activityImage; + } + } + _self.data.activityList = _self.data.activityList.concat(data.rows) + _self.setData({ + activityList: _self.data.activityList, + isLoading: false, + hasMore: _self.data.activityList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取非遗 + getLegacyList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/intangiblelibrary/listpageintangiblelibraryrelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + for (var i = 0, item; item = data.rows[i++];) { + item.libraryApplyTime = item.libraryApplyTime.substring(0, item.libraryApplyTime.length - 10); + item.libraryCoverArray = item.libraryCover.split(','); + } + _self.data.legacyList = _self.data.legacyList.concat(data.rows) + _self.setData({ + legacyList: _self.data.legacyList, + isLoading: false, + hasMore: _self.data.legacyList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取场馆 + getPlaceList() { + var _self = this; + + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/venuesinfo/listpagevenuesinforelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords, + latitude: _self.data.latitude, + longitude: _self.data.longitude + }, null, + function (code, data) { + data.rows.forEach(element => { + element.venuePanorama = element.venuePanorama.split(',')[0]; + if (element.apart >= 1000) { + element.apart = (element.apart / 1000).toFixed(2) + 'km'; + } else { + element.apart += 'm'; + } + }); + _self.data.placeList = _self.data.placeList.concat(data.rows) + _self.setData({ + placeList: _self.data.placeList, + isLoading: false, + hasMore: _self.data.placeList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取直播 + getLiveList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.liveUrl + '/app/liveplan/listpageliveplanrelease/', []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + _self.data.liveList = _self.data.liveList.concat(data.rows) + _self.setData({ + liveList: _self.data.liveList, + isLoading: false, + hasMore: _self.data.liveList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取志愿者活动 + getVolumerList() { + var _self = this; + app.restAjax.get(app.restAjax.path(_self.data.url + '/app/volunteerservice/listpagevolunteerservicerelease/' + app.areaCode, []), + { + page: _self.data.page, + rows: _self.data.rows, + keywords: _self.data.keywords + }, null, + function (code, data) { + _self.setData({ + isLoading: false, + hasMore: false + }) + for (var item of data.rows) { + if ('' != item.photo) { + var photoArr = item.photo.split(","); + item.photo = app.imgUrl + photoArr[0]; + } + } + _self.data.volumerList = _self.data.volumerList.concat(data.rows) + _self.setData({ + volumerList: _self.data.volumerList, + isLoading: false, + hasMore: _self.data.volumerList.length < data.total + }) + }, + function (code, err) { + app.dialog.msg('网络错误') + _self.setData({ + isLoading: false + }) + }, + ) + }, + //获取定位 + getLocation: function () { + var self = this; + wx.getLocation({ + type: 'gcj02', + success: function (res) { + self.setData({ + latitude: res.latitude, + longitude: res.longitude + }) + }, + complete: function () { + } + }) + }, + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + var _self = this; + if (_self.data.hasMore) { + if (!_self.data.isInit) { + _self.setData({ + page: _self.data.page + 1, + isInit: false + }) + //tabList: ['新闻', '活动', '非遗数据', '场馆', '直播', '志愿者活动'], + switch (_self.data.currentIndex) { + case 0: + _self.getNewsList() + break; + case 1: + _self.getActivityList() + break; + case 2: + _self.getLegacyList() + break; + case 3: + _self.getPlaceList() + break; + case 4: + _self.getLiveList() + break; + case 5: + _self.getVolumerList() + break; + } + } + } else { + app.dialog.msg('暂无更多数据了') + } + }, + doSaveKeyword(type) { + var _self = this; + var params = "小程序" + _self.data.keywords + type + app.restAjax.get(app.restAjax.path(app.bigDataUrl + '/app/contentcensusrelease/log', []), + { + requestUrl: params + }, null, + function (code, data) { + + }, + function (code, err) { + }, + ) + } + +}) \ No newline at end of file diff --git a/subpages/search/commonSearch.json b/subpages/search/commonSearch.json new file mode 100644 index 0000000..3928faa --- /dev/null +++ b/subpages/search/commonSearch.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/subpages/search/commonSearch.wxml b/subpages/search/commonSearch.wxml new file mode 100644 index 0000000..a4f7cbe --- /dev/null +++ b/subpages/search/commonSearch.wxml @@ -0,0 +1,222 @@ + + + + + + + + + {{item}} + + + + + + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + {{item.newsContentTitle}} + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + + + + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + {{item.newsContentTitle}} + + 来源:{{item.newsContentResource}} + {{item.newsContentPublishTime}} + + + + + + + + + 暂无数据 + + + + + + + + + + + + {{item.activityTitle}} + 报名中 + 报名人数已满 + 停止报名 + 进行中 + 直接进入 + 已结束 + + {{item.activityStartTime}}至{{item.activityEndTime}} + + + + + + 暂无数据 + + + + + + + + + + + + {{item.libraryTitle}} + + {{item.libraryApplyTime}} + + + + + + 暂无数据 + + + + + + + + + + + + {{item.venueName}} + 距离:{{item.apart == '0' ? '未知' : item.apart}} + + 营业时间:{{item.businessHours}} + + + + + + 暂无数据 + + + + + + + + + + + + {{item.livePlanName}} + 未开始 + 直播回放 + 直播中 + + {{item.livePlanStart}}至{{item.livePlanEnd}} + + + + + + 暂无数据 + + + + + + + + + 报名中 + 已报名 + 停止报名 + 进行中 + 已结束 + + + + {{item.serviceName}} + + {{item.startTime}}至{{item.endTime}} + + + + + + 暂无数据 + + + + + + 加载中... + + + + 请输入关键词 + \ No newline at end of file diff --git a/subpages/search/commonSearch.wxss b/subpages/search/commonSearch.wxss new file mode 100644 index 0000000..90d8fa5 --- /dev/null +++ b/subpages/search/commonSearch.wxss @@ -0,0 +1,404 @@ +.top-tab { + position: fixed; + top: 0; + left: 0; + right: 0; + background: #fff; + overflow-x: hidden; + z-index: 100; +} + +.search-box { + background: #f2f2f2; + border-radius: 30rpx; + padding: 5rpx; + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + margin: 20rpx 30rpx; +} + +.search-box image { + width: 32rpx; + height: 32rpx; + margin-left: 20rpx; +} + +.search-box input { + font-size: 28rpx; + color: #242424; + margin-left: 20rpx; + width: 100%; +} + +.type { + display: flex; + /* overflow-x: auto; */ + /* 隐藏滚动条 */ + /* scrollbar-width: none; */ + /* firefox */ + /* -ms-overflow-style: none; */ + /* IE 10+ */ + margin-left: 20rpx; +} + +.tab-box { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + width: 13%; + min-width: fit-content; + position: relative; + height: 60rpx; + font-size: 30rpx; + color: #242424; + flex-shrink: 0; +} + +.sel-line { + background-color: #9F1512; + width: 50%; + height: 5rpx; + border-radius: 3rpx; +} + +.tab-box.active { + color: #9F1512; +} + +.tab-box image { + width: 20rpx; + height: 40rpx; +} + +.tab-box .txt { + padding: 0rpx 10rpx; + width: 100%; + text-align: center; +} + +.tab-box .txt-active { + color: #9F1512; +} + +.tab-box.active image { + display: block; +} + +.tab-box image.selected-l { + left: 20rpx; +} + +.tab-box image.selected-r { + right: 20rpx; +} + +.search-init { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; + background: #ffffff; +} + +.loading-page { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; + background: white; +} + +.loading-page image { + width: 80rpx; + height: 80rpx; +} + +.search-init image { + width: 80rpx; + height: 80rpx; +} + +.loading-page text { + font-size: 28rpx; + margin-top: 20rpx; + color: #949494; +} + +.search-init text { + font-size: 28rpx; + margin-top: 20rpx; + color: #949494; +} + +/* =================================新闻======================================= */ + +.news { + padding: 30rpx; + border-bottom: 5px solid #FBFBFB; +} + +.news-box { + padding: 30rpx 0; + border-bottom: 1px solid #EBEBEB; + display: flex; + flex-direction: column; +} + +.news-title { + color: #242424; + font-size: 30rpx; + font-weight: bold; +} + +.news-info { + color: #949494; + margin-top: 15rpx; + font-size: 24rpx; +} + +.news-info text { + margin-right: 20rpx; +} + +.voice-box { + padding-right: 30px; + position: relative; +} + +.voice-img { + position: absolute; + right: 0; + width: 48rpx; + height: 48rpx; +} + +.news-big-pic, +.news-small-pic { + margin-top: 10rpx; +} + +.news-big-pic { + position: relative; +} + +.news-big-pic image { + width: 100%; + height: 380rpx; +} + +.news-big-pic image.play-btn { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 80rpx; + height: 80rpx; +} + +.news-small-pic image { + width: 30%; + height: 150rpx; + margin-right: 20rpx; +} + +.transverse-news { + flex-direction: row; + justify-content: space-between; +} + +.news-row-img { + width: 30%; + height: 150rpx; +} + +.news-row-img image { + width: 100%; + height: 100%; +} + +.news-row-info { + width: 68%; +} + +/* end */ + +/* 活动 */ +.activity { + padding: 20rpx 30rpx 0; +} + +.activity-box { + margin-bottom: 20rpx; + box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.1); + border-radius: 10rpx; + overflow: hidden; +} + +.activity-img { + height: 320rpx; + position: relative; +} + +.activity-img image { + width: 100%; + height: 100%; +} + +.corner { + position: absolute; + top: 20rpx; + right: 20rpx; + display: flex; + color: #fff; +} + +.corner view { + padding: 0 10rpx; + background: rgba(0, 0, 0, 0.6); + line-height: 40rpx; + vertical-align: middle; + display: flex; + align-items: center; + border-radius: 5rpx; +} + +.view-count { + margin-right: 20rpx; +} + +.view-count image { + width: 40rpx; + height: 40rpx; +} + +.activity-info { + padding: 15rpx 20rpx; +} + +.title { + display: flex; + justify-content: space-between; +} + +.activity-title { + width: 70%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + font-size: 32rpx; + color: #242424; + line-height: 40rpx; +} + +.sign { + background: rgba(159, 21, 18, .1); + color: #9F1512; + border-radius: 10rpx; + padding: 0 20rpx; + line-height: 40rpx; + font-size: 28rpx; +} + +.date { + margin-top: 10rpx; + font-size: 24rpx; + color: #242424; +} + + +/* end */ + +/* ====================场馆==================== */ + +.venue { + height: 400rpx; + padding: 0 30rpx; +} + +.venue-box { + box-shadow: 0 0 17rpx 0 rgba(0, 0, 0, 0.1); + border-radius: 10rpx; + overflow: hidden; + margin-bottom: 15rpx; +} + +.venue-img, +.venue-img image { + width: 100%; + height: 315rpx; +} + +.venue-info { + padding: 15rpx 20rpx; +} + +.name-distance { + display: flex; + justify-content: space-between; + height: 35rpx; + line-height: 35rpx; +} + +.name { + font-size: 32rpx; + width: 60%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.distance { + padding: 0 10rpx; + background: rgba(159, 21, 18, .1); + color: #9F1512; + border-radius: 10rpx; + font-size: 28rpx; +} + +.time { + font-size: 28rpx; + color: #242424; + margin-top: 10rpx; +} + +/* =end= */ + +.empty-box { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + z-index: 99; + background: white; +} + +.empty-box image { + width: 128rpx; + height: 96rpx; +} + +.empty-box text { + font-size: 28rpx; + margin-top: 20rpx; + color: gray; +} \ No newline at end of file diff --git a/utils/indexof.wxs b/utils/indexof.wxs deleted file mode 100644 index 1813a08..0000000 --- a/utils/indexof.wxs +++ /dev/null @@ -1,10 +0,0 @@ -function indexOf(str, val) { - if (str.indexOf(val) != -1) { - return true; - } else { - return false; - } -} -module.exports = { - indexOf: indexOf -} \ No newline at end of file diff --git a/utils/restAjax.js b/utils/restAjax.js index ca38cbb..8b19796 100644 --- a/utils/restAjax.js +++ b/utils/restAjax.js @@ -227,5 +227,8 @@ module.exports.escape = escape; module.exports.file = postFile; // module.exports.baseUrl='http://v3.xzszwhy.cn/xzszwhy'; // module.exports.url="http://v3.xzszwhy.cn/"; -module.exports.baseUrl = 'http://192.168.0.120:8081/xzszwhy'; -module.exports.url = "http://192.168.0.120:8081/"; \ No newline at end of file +module.exports.baseUrl = 'https://www.xzszwhy.cn/xzszwhy'; +module.exports.url = "https://www.xzszwhy.cn/"; + +// module.exports.baseUrl = 'http://192.168.0.120:8081/xzszwhy'; +// module.exports.url = "http://192.168.0.120:8081/"; \ No newline at end of file diff --git a/utils/util.js b/utils/util.js index 46464a2..9ff37b1 100644 --- a/utils/util.js +++ b/utils/util.js @@ -32,6 +32,9 @@ function indexOf(str, val) { } else { return false; } +} +function formatDuration(){ + } module.exports = { formatTime: formatTime, diff --git a/utils/utils.wxs b/utils/utils.wxs new file mode 100644 index 0000000..197cf9b --- /dev/null +++ b/utils/utils.wxs @@ -0,0 +1,42 @@ +function indexOf(str, val) { + if (str.indexOf(val) != -1) { + return true; + } else { + return false; + } +} + +function formatCount(count){ + var counter = parseInt(count) + if(counter > 100000000){ + return (counter / 100000000).toFixed(1) + '亿' + }else if(counter > 10000){ + return (counter / 10000).toFixed(1) + '万' + }else{ + return counter + } + } + + // 12->12 5->05 + function padLeftZero(str){ + str = str + '' + return ("00" + str).slice(str.length) + } + + function formatDuration(duration, isMilliseconds) { + isMilliseconds = isMilliseconds === undefined + if (isMilliseconds) { + duration = duration / 1000 + } + + var minute = Math.floor(duration / 60) + var second = Math.floor(duration) % 60 + + return padLeftZero(minute) + ":" + padLeftZero(second) + } + +module.exports = { + indexOf: indexOf, + formatCount:formatCount, + formatDuration:formatDuration +} \ No newline at end of file