公共搜索页面、大数据搜索关键词

This commit is contained in:
itgaojian 2023-03-15 17:58:44 +08:00
parent 0cf235c752
commit 7e80b99032
76 changed files with 2204 additions and 402 deletions

5
app.js
View File

@ -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 () {

View File

@ -53,7 +53,9 @@
"editshopaddress/editshopaddress",
"orderconfirm/orderconfirm",
"addresschoose/addresschoose",
"webcontentview/webcontent"
"webcontentview/webcontent",
"search/commonSearch",
"liverecord/liverecord"
]
}
],

109
app.wxss
View File

@ -77,3 +77,112 @@ checkbox .wx-checkbox-input.wx-checkbox-input-checked::before {
background: #07c160;
transform: translate(-50%, -50%) scale(1);
}
.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;
}

View File

@ -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
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,7 @@
<view class="content">
<view class="contentInner showArea {{!onFold ? 'text-clamp' + maxline : ''}}" bindtap="{{foldable ? 'handleFold' : ''}}">{{content || "示例文本"}}</view>
<view class="contentInner hideArea">{{content || "示例文本"}}</view>
<view class="foldInner {{position === 'right' ? 'flex-end' : 'flex'}}" wx:if="{{showFold}}">
<text class="fold" catchtap="handleFold">{{onFold ? "收起" : "展开"}}</text>
</view>
</view>

View File

@ -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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 B

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 453 B

After

Width:  |  Height:  |  Size: 400 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 582 B

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 871 B

After

Width:  |  Height:  |  Size: 756 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 728 B

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 B

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 349 B

BIN
images/ic_audio_bg.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 B

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 519 B

After

Width:  |  Height:  |  Size: 455 B

BIN
images/ic_music_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 921 B

BIN
images/ic_search_black.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
images/ic_search_gray.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 470 B

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

BIN
images/marker_red.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 812 B

After

Width:  |  Height:  |  Size: 671 B

BIN
images/marker_yellow.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 713 B

BIN
images/my-collect.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 537 B

BIN
images/my-comment.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 573 B

BIN
images/my-sign.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 B

After

Width:  |  Height:  |  Size: 450 B

BIN
images/play.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1008 B

After

Width:  |  Height:  |  Size: 507 B

BIN
images/play_next.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

BIN
images/play_pause.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 737 B

BIN
images/play_prev.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 573 B

BIN
images/play_resume.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 805 B

BIN
images/prev.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 270 B

BIN
images/select-tab.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 716 B

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 757 B

After

Width:  |  Height:  |  Size: 687 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

View File

@ -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',
})
}
})

View File

@ -1,10 +1,11 @@
<view class="swiper-box">
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}">
<swiper-item class="swiper-item" wx:for="{{news.bannerList}}" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerList">
<swiper-item class="swiper-item" wx:for="{{news.bannerList}}" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:for-index="idx" wx:for-item="item" wx:key="bannerList">
<image binderror="loadBannerErr" data-index="{{idx}}" src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" class="swiper-img" wx:key="swiperImg"></image>
</swiper-item>
</swiper>
</view>
<view class="tab">
<block wx:for="{{mainFuncList}}" wx:key="index">
<view class="tab-box" bindtap="openNewsDetail" data-item="{{item}}">
@ -66,7 +67,7 @@
</view>
<block wx:if="{{it.newsList}}">
<view wx:for="{{it.newsList}}" wx:for-index="idx" wx:for-item="item" wx:key="idx">
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_1'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_1'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-small-pic">
<image src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" wx:key="coverItem"></image>
@ -76,7 +77,7 @@
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box transverse-news" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_2'}}">
<view class="news-box transverse-news" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_2'}}">
<view class="news-row-img">
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
@ -88,7 +89,7 @@
</view>
</view>
</view>
<view class="news-box transverse-news" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_3'}}">
<view class="news-box transverse-news" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_3'}}">
<view class="news-row-info">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
@ -100,7 +101,7 @@
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_4'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_4'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-big-pic">
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
@ -110,14 +111,14 @@
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_5'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_5'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_6'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_6'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-big-pic">
<image src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" wx:key="coverItem"></image>
@ -128,12 +129,12 @@
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_7'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_7'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info voice-box">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
<image src="../../images/play.png"></image>
<image src="/images/ic_music_icon.png" class="voice-img"></image>
</view>
</view>
</view>
@ -160,3 +161,6 @@
</view>
</view>
</view>
<view wx:if="{{isHide}}" class="search-box" bindtap="openSearch">
<image src="/images/ic_search_gray.png" mode="scaleToFill"></image>
</view>

View File

@ -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;
@ -345,3 +371,11 @@ swiper {
width: 80rpx;
height: 80rpx;
}
.voice-img {
position: absolute;
right: 0;
width: 48rpx;
height: 48rpx;
}

View File

@ -1,13 +1,27 @@
// pages/newsDetail/newsDetail.js
var app = getApp();
var audioContentx = null;
Page({
/**
* 页面的初始数据
*/
data: {
newsContentUrl: app.newsContentUrl,
templateRecordUrl: null
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,
},
/**
@ -15,54 +29,204 @@ Page({
*/
onLoad: function (options) {
this.setData({
templateRecordUrl: options.templateRecordUrl
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 () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: 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
})
});
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)
})
},
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();
}
}
})

View File

@ -1,3 +1,5 @@
{
"usingComponents": {}
"usingComponents": {
"custom-content": "/components/expandabletext/expandabletext"
}
}

View File

@ -1,94 +1,84 @@
<web-view src="{{newsContentUrl}}/{{templateRecordUrl}}" wx:if="{{templateRecordUrl}}"></web-view>
<!-- <view class="news-title">
<view class="title">银保监会印发《关于加快推进意外险改革的意见》</view>
<view class="news-info">
<text>来源</text>
<text>2020-02-02</text>
</view>
<wxs src="/utils/utils.wxs" module="format"></wxs>
<view wx:if="{{newsBean}}">
<!-- newsContentType 1 文章 2图片 3音频 4视频 5PDF 6链接 -->
<!-- 文章 -->
<view wx:if="{{newsBean.newsContentType=='1'}}">
<view class="news-title">{{newsBean.newsContentTitle}}</view>
<view class="news-attr-box">
<view class="news-attr">新闻来源:{{newsBean.newsContentResource}}</view>
<view class="news-attr">发布时间:{{newsBean.newsContentPublishTime}}</view>
</view>
<view class="news-content">
大量的小号被封杀,基于小号和社群建立起来的粉丝用户体系,一朝回到解放前。
微信这番操作,也是告诉大家,没有私域流量,只能按照我的路子来。要么公众号,要么企业微信。
今天早上和业务团队聊了一下,感觉企业微信还是任重而道远,由于企业微信的能力开放有限,想大规模的玩起来,还需要一点时间积累。
现在,在企业微信能力开放之前,最好的粉丝载体,还是要回到微信公众号。
但微信公众号的限制,也是非常严格的,完全无法通过阅读情况,判断用户的喜好和特定,那产品经理该如何提供策略工具,为搭建公众号下的用户分层体系呢?
<rich-text nodes="{{newsBean.newsContentContent}}"></rich-text>
</view>
<view class="comment">
<view class="commnet-box">
<view class="commnet-avatar">
<image src="../../images/avatar.png"></image>
</view>
<view class="comment-right">
<view class="comment-people">
<view>王耿</view>
<view>200 <image src="../../images/good.png"></image></view>
<!-- 图片 -->
<view wx:elif="{{newsBean.newsContentType=='2'}}">
<view class="img-box" style="height: {{pageHeight}}px;">
<swiper autoplay="true" interval="10000" style="width: 100%;height: {{pageHeight}}px;">
<swiper-item class="swiper-item" wx:for="{{newsBean.fileList}}" wx:for-item="item" wx:key="index">
<image style="width: 100%;height: 500rpx;" src="{{imgUrl+item.contentFileFileId}}" mode="aspectFit"></image>
<view class="item-txt">
<custom-content content="{{item.contentFileText}}" maxline="2" position="right" foldable="true"></custom-content>
</view>
<view class="comment-content">
评论内容评论内容评论内容评论内容评论内容评论内容评论内容
</swiper-item>
</swiper>
</view>
<view class="date-reply">
<text class="date">1天前</text>
<text class="reply">回复</text>
</view>
<!-- 音频 -->
<view wx:elif="{{newsBean.newsContentType=='3'}}">
<view class="audio-box">
<view class="audio-img">
<image class="img-bg" src="/images/ic_audio_bg.png" mode="scaleToFill"></image>
<image class="img-loading" wx:if="{{!canPlay}}" src="/images/loading-small.gif" mode="scaleToFill"></image>
</view>
<view class="progress">
<view class="current">{{format.formatDuration(currentTime)}}</view>
<slider class="slider" block-size="{{16}}" value="{{sliderValue}}" bindchange="handleSliderChange" max="{{totalValue}}"></slider>
<view class="duration">{{format.formatDuration(duration)}}</view>
</view>
<view class="option">
<image class="btn btn-prev" src="/images/play_prev.png" bindtap="preAudio"> </image>
<image class="btn btn-pause" src="{{isPlaying?'/images/play_pause.png':'/images/play_resume.png'}}" bindtap="playAudio"> </image>
<image class="btn btn-next" src="/images/play_next.png" bindtap="nextAudio"> </image>
</view>
<view class="category-title">目录</view>
<view class="video-category">
<view class="category-item {{index==currentAudioIndex? 'category-item-sel':''}}" wx:for="{{newsBean.fileList}}" wx:for-item="item" wx:key="index" bindtap="setAudioUrl" data-index="{{index}}" data-item="{{item}}">
<view>{{index+1}}</view>
</view>
</view>
</view>
<view class="commnet-box">
<view class="commnet-avatar">
<image src="../../images/avatar.png"></image>
<view class="flex desc-box">
<view>|</view>
<view style="margin-left: 10rpx;color: #242424;">详情</view>
</view>
<view class="comment-right">
<view class="comment-people">
<view>王耿</view>
<view>200 <image src="../../images/good.png"></image></view>
<view class="desc">{{currentAudioDesc}}</view>
</view>
<view class="comment-content">
评论内容评论内容评论内容评论内容评论内容评论内容评论内容
</view>
<view class="date-reply">
<text class="date">1天前</text>
<text class="reply">回复</text>
</view>
<view class="reply-box">
<view class="reply-content">
<text class="reply-people">王耿:</text>
回复内容回复内容回复内容回复内容回复内容回复内容回复内容回复内容
<!-- 视频 -->
<view wx:elif="{{newsBean.newsContentType=='4'}}">
<view class="video-box">
<video src="{{currentVideoUrl}}"></video>
<view class="category-title">目录</view>
<view class="video-category">
<view class="category-item {{index==currentVideoIndex? 'category-item-sel':''}}" wx:for="{{newsBean.fileList}}" wx:for-item="item" wx:key="index" bindtap="setVideoUrl" data-index="{{index}}" data-item="{{item}}">
<view>{{index+1}}</view>
</view>
</view>
</view>
<view class="flex desc-box">
<view>|</view>
<view style="margin-left: 10rpx;color: #242424;">详情</view>
</view>
<view class="commnet-box">
<view class="commnet-avatar">
<image src="../../images/avatar.png"></image>
<view class="desc">{{currentDesc}}</view>
</view>
<view class="comment-right">
<view class="comment-people">
<view>王耿</view>
<view>200 <image src="../../images/good.png"></image></view>
<!-- PDF -->
<view wx:elif="{{newsBean.newsContentType=='5'}}">
<web-view src="{{newsBean.newsContentLink}}"></web-view>
</view>
<view class="comment-content">
评论内容评论内容评论内容评论内容评论内容评论内容评论内容
<view class="comment-img">
<image src="../../images/big-news.png"></image>
<image src="../../images/big-news.png"></image>
<!-- 链接 -->
<view wx:elif="{{newsBean.newsContentType=='6'}}">
<web-view src="{{newsBean.newsContentContent}}"></web-view>
</view>
</view>
<view class="date-reply">
<text class="date">1天前</text>
<text class="reply">回复</text>
</view>
</view>
</view>
</view>
<view class="page-bottom">
<view class="do-comment">
请填写你的评论
</view>
<view class="btn-box">
<view class="collect">
<image src="../../images/collect.png"></image>
</view>
<view class="share">
<image src="../../images/share.png"></image>
</view>
</view>
</view> -->
<page-loading wx:else></page-loading>

View File

@ -3,125 +3,199 @@
} */
.news-title {
padding: 20rpx 30rpx;
}
.title{
font-size: 34rpx;
font-weight: bold;
color: #242424;
text-align: center;
}
.news-info{
font-size: 28rpx;
.news-attr-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
}
.news-attr {
font-size: 24rpx;
color: #949494;
}
.news-info text{
.news-attr:nth-of-type(n+2) {
margin-left: 20rpx;
}
.news-content {
padding: 20rpx 20rpx;
font-size: 34rpx;
color: #242424;
}
.img-box {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
background: black;
}
.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;
}
.item-txt {
position: absolute;
color: white;
font-size: 24rpx;
bottom: 0rpx;
}
.video-box {
display: flex;
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
background: #242424;
}
.video-box video {
width: 100%;
}
.video-category {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
padding-bottom: 30rpx;
margin: 20rpx;
flex-wrap: wrap;
}
.category-title {
font-size: 34rpx;
color: white;
align-self: center;
margin-top: 20rpx;
}
.category-item {
font-size: 30rpx;
color: white;
border: 1rpx solid #949494;
padding: 20rpx;
margin: 5rpx;
}
.category-item-sel {
border: 1rpx solid #f30000;
color: #f30000;
background: #97979741;
}
.desc-box {
color: #f30000;
margin-top: 40rpx;
padding-left: 20rpx;
}
.desc {
font-size: 28rpx;
color: #242424;
padding: 30rpx 40rpx;
}
.audio-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
background: black;
color: white;
}
.audio-img {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
width: 100%;
height: 400rpx;
}
.img-bg {
width: 100%;
height: 400rpx;
}
.img-loading {
width: 200rpx;
height: 200rpx;
position: absolute;
top: calc(50%-50rpx);
left: calc(50%-50rpx);
}
.progress {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100%;
}
.slider {
margin: 10rpx;
width: 50%;
}
.option {
display: flex;
flex: 1;
justify-content: space-between;
align-items: center;
padding-bottom: 20rpx;
width: 70%;
align-self: center;
margin-top: 20rpx;
}
.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;
}
.news-content{
padding: 0 30rpx 10rpx;
font-size: 32rpx;
color: #242424;
line-height: 50rpx;
border-bottom: 5px solid #d2e0f6;
.duration {
font-size: 28rpx;
margin-left: 30rpx;
}
.comment{
padding: 30rpx;
margin-bottom: 95rpx;
}
.commnet-box{
display: flex;
justify-content: space-between;
margin-bottom: 10rpx;
}
.commnet-box view{
flex-shrink: 0;
}
.commnet-avatar, .commnet-avatar image{
width: 50rpx;
height: 50rpx;
}
.comment-right{
width: 620rpx;
padding-bottom: 20rpx;
border-bottom: 1px solid #EBEBEB;
}
.comment-people{
display: flex;
font-size: 22rpx;
color: #B1B1B1;
justify-content: space-between;
vertical-align: middle;
line-height: 40rpx;
}
.comment-people image{
width: 40rpx;
height: 40rpx;
vertical-align: top;
}
.comment-content{
font-size: 30rpx;
color: #242424;
line-height: 40rpx;
margin: 10rpx 0;
}
.date-reply{
font-size: 24rpx;
}
.date{
color: #949494;
margin-right: 20rpx;
}
.reply{
color: #242424;
}
.reply-box{
padding: 20rpx;
background: #EDEDED;
font-size: 24rpx;
margin-top: 10rpx;
line-height: 40rpx;
}
.reply-people{
color: #242424;
}
.comment-img{
margin: 10rpx 0;
}
.comment-img image{
width: 30%;
height: 150rpx;
margin-right: 15rpx;
}
.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;
}
.do-comment{
width: 500rpx;
padding: 0 20rpx;
height: 100%;
background: #EDEDED;
flex-shrink: 0;
display: flex;
align-items: center;
color: #B1B1B1;
font-size: 26rpx;
}
.btn-box{
width: 150rpx;
display: flex;
justify-content: space-between;
}
.collect, .share, .collect image, .share image{
width: 70rpx;
height: 100%;
.btn {
width: 64rpx;
height: 64rpx;
}

View File

@ -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 () {

View File

@ -27,7 +27,7 @@
<view class="news">
<view wx:for="{{news.newsList}}" wx:for-index="idx" wx:for-item="item" wx:key="idx">
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_1'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_1'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-small-pic">
<image src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" wx:key="coverItem"></image>
@ -37,7 +37,7 @@
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box transverse-news" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_2'}}">
<view class="news-box transverse-news" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_2'}}">
<view class="news-row-img">
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
@ -49,7 +49,7 @@
</view>
</view>
</view>
<view class="news-box transverse-news" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_3'}}">
<view class="news-box transverse-news" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_3'}}">
<view class="news-row-info">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
@ -61,7 +61,7 @@
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_4'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_4'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-big-pic">
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
@ -71,14 +71,14 @@
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_5'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_5'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_6'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_6'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-big-pic">
<image src="{{news.newsUrl}}/route/file/download/true/{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" wx:key="coverItem"></image>
@ -89,12 +89,12 @@
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_7'}}">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" data-template-record-url="{{item.templateRecordUrl}}" wx:if="{{item.typesettingCode == 'key_7'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info voice-box">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
<image src="../../images/play.png"></image>
<image src="/images/ic_music_icon.png" class="voice-img"></image>
</view>
</view>
</view>

View File

@ -222,3 +222,11 @@
.news-row-info {
width: 68%;
}
.voice-img {
position: absolute;
right: 0;
width: 48rpx;
height: 48rpx;
}

View File

@ -1,4 +1,4 @@
<wxs src="/utils/indexof.wxs" module="utils" />
<wxs src="/utils/utils.wxs" module="utils" />
<view class="register">
<view class="hint" wx:if="{{volunteerMsg}}">您已经是志愿者,可修改以下信息!</view>
<view class="thick-line"></view>

View File

@ -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 {

View File

@ -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()
}
})

View File

@ -0,0 +1,4 @@
{
"usingComponents": {},
"enablePullDownRefresh": true
}

View File

@ -0,0 +1,7 @@
<!--subpages/liverecord/liverecord.wxml-->
<view class="page">
<view wx:for="{{liveList}}" wx:key="index" class="video-box">
<video src="{{item.recordFilePath}}"></video>
<view class="txt">{{item.recordFileRecord}}</view>
</view>
</view>

View File

@ -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;
}

View File

@ -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) {
},
)
}
})

View File

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

View File

@ -0,0 +1,222 @@
<view class="top-tab">
<view class="search-box">
<image src="/images/ic_search_black.png" mode="scaleToFill"></image>
<input placeholder="请输入关键词" type="text" confirm-type="search" bindconfirm="doSearch" bindinput="inputKeywords" />
</view>
<scroll-view scroll-x="true" style="margin-top: 20rpx;">
<view class="type">
<view class="tab-box" wx:for="{{tabList}}" wx:for-index="index" wx:for-item="item" wx:key="index" data-index="{{index}}" bindtap="changeTab">
<view class="txt {{currentIndex==index? 'txt-active' :''}}">{{item}}</view>
<view class="sel-line" wx:if="{{currentIndex==index}}"></view>
</view>
</view>
</scroll-view>
</view>
<view style="margin-top: 180rpx;">
<!-- 新闻 -->
<view wx:if="{{currentIndex==0}}" class="news">
<view wx:if="{{newsList.length>0}}">
<view wx:for="{{newsList}}" wx:for-index="idx" wx:for-item="item" wx:key="idx">
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_1'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-small-pic">
<image src="{{imgUrl}}{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" wx:key="coverItem"></image>
</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box transverse-news" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_2'}}">
<view class="news-row-img">
<image src="{{imgUrl}}{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
<view class="news-row-info">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
</view>
<view class="news-box transverse-news" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_3'}}">
<view class="news-row-info">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-row-img">
<image src="{{imgUrl}}{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_4'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-big-pic">
<image src="{{imgUrl}}{{item.newsContentCoverList[0].contentCoverId}}"></image>
</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_5'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_6'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-big-pic">
<image src="{{imgUrl}}{{coverItem.contentCoverId}}" wx:for="{{item.newsContentCoverList}}" wx:for-item="coverItem" wx:key="coverItem"></image>
<image src="../../images/play.png" class="play-btn"></image>
</view>
<view class="news-info">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
</view>
</view>
<view class="news-box" bindtap="goNewsDetail" data-item="{{item}}" wx:if="{{item.typesettingCode == 'key_7'}}">
<view class="news-title">{{item.newsContentTitle}}</view>
<view class="news-info voice-box">
<text>来源:{{item.newsContentResource}}</text>
<text>{{item.newsContentPublishTime}}</text>
<image class="voice-img" src="/images/ic_music_icon.png"></image>
</view>
</view>
</view>
</view>
<view wx:else class="empty-box">
<image src="/images/ic_empty_data.png"></image>
<text>暂无数据</text>
</view>
</view>
<!-- 活动 -->
<view class="activity" wx:elif="{{currentIndex==1}}">
<view wx:if="{{activityList.length>0}}">
<view class="activity-box" bindtap="goDetail" data-id="{{item.activityLibraryId}}" wx:for="{{activityList}}" wx:key="index">
<view class="activity-img">
<image src="{{item.activityImage}}"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">{{item.activityTitle}}</view>
<view class="sign" wx:if="{{item.activityState == '3'}}">报名中</view>
<view class="sign" wx:if="{{item.activityState == '4'}}">报名人数已满</view>
<view class="sign" wx:if="{{item.activityState == '5'}}">停止报名</view>
<view class="sign" wx:if="{{item.activityState == '6'}}">进行中</view>
<view class="sign" wx:if="{{item.activityState == '7'}}">直接进入</view>
<view class="sign" wx:if="{{item.activityState == '99'}}">已结束</view>
</view>
<view class="date">{{item.activityStartTime}}至{{item.activityEndTime}}</view>
</view>
</view>
</view>
<view wx:else class="empty-box">
<image src="/images/ic_empty_data.png"></image>
<text>暂无数据</text>
</view>
</view>
<!-- 非遗数据 -->
<view class="activity" wx:elif="{{currentIndex==2}}">
<view wx:if="{{legacyList.length>0}}">
<view class="activity-box" bindtap="legacyDetail" data-library-id="{{item.intangibleLibraryId}}" wx:for="{{legacyList}}" wx:for-item="item" wx:for-index="index" wx:key="libraryList">
<view class="activity-img">
<image src="{{imgUrl}}{{item.libraryCoverArray[0]}}"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">{{item.libraryTitle}}</view>
</view>
<view class="date">{{item.libraryApplyTime}}</view>
</view>
</view>
</view>
<view wx:else class="empty-box">
<image src="/images/ic_empty_data.png"></image>
<text>暂无数据</text>
</view>
</view>
<!-- 场馆 -->
<view class="venue" wx:elif="{{currentIndex==3}}">
<view wx:if="{{placeList.length>0}}">
<view class="venue-box" wx:for="{{placeList}}" wx:key="index" bindtap="placeDetail" data-id="{{item.venuesInfoId}}">
<view class="venue-img">
<image src="{{imgUrl}}{{item.venuePanorama}}"></image>
</view>
<view class="venue-info">
<view class="name-distance">
<view class="name">{{item.venueName}}</view>
<view class="distance">距离:{{item.apart == '0' ? '未知' : item.apart}}</view>
</view>
<view class="time">营业时间:{{item.businessHours}}</view>
</view>
</view>
</view>
<view wx:else class="empty-box">
<image src="/images/ic_empty_data.png"></image>
<text>暂无数据</text>
</view>
</view>
<!-- 直播 -->
<view class="activity" wx:elif="{{currentIndex==4}}">
<view wx:if="{{liveList.length>0}}">
<view class="activity-box" bindtap="detailLive" data-id="{{item}}" wx:for="{{liveList}}" wx:key="index">
<view class="activity-img">
<image src="{{liveImgUrl}}{{item.livePlanPhoto}}"></image>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">{{item.livePlanName}}</view>
<view class="sign" wx:if="{{item.liveStatus == '1'}}">未开始</view>
<view class="sign" wx:if="{{item.liveStatus == '0'}}">直播回放</view>
<view class="sign" wx:if="{{item.liveStatus == '2'}}">直播中</view>
</view>
<view class="date">{{item.livePlanStart}}至{{item.livePlanEnd}}</view>
</view>
</view>
</view>
<view wx:else class="empty-box">
<image src="/images/ic_empty_data.png"></image>
<text>暂无数据</text>
</view>
</view>
<!-- 志愿者活动 -->
<view wx:elif="{{currentIndex==5}}" class="activity">
<view wx:if="{{volumerList.length>0}}">
<view class="activity-box" bindtap="volumerDetail" data-id="{{item.volunteerServiceId}}" wx:for="{{volumerList}}" wx:key="index">
<view class="activity-img">
<image src="{{item.photo}}"></image>
<view class="corner" wx:if="{{item.status == 'enroll'}}">报名中</view>
<view class="corner" wx:if="{{item.status == 'isEnroll'}}">已报名</view>
<view class="corner" wx:if="{{item.status == 'stop'}}">停止报名</view>
<view class="corner" wx:if="{{item.status == 'ing'}}">进行中</view>
<view class="corner" wx:if="{{item.status == 'over'}}">已结束</view>
</view>
<view class="activity-info">
<view class="title">
<view class="activity-title">{{item.serviceName}}</view>
</view>
<view class="date">{{item.startTime}}至{{item.endTime}}</view>
</view>
</view>
</view>
<view wx:else class="empty-box">
<image src="/images/ic_empty_data.png"></image>
<text>暂无数据</text>
</view>
</view>
</view>
<view class="loading-page" wx:if="{{isLoading}}">
<image src="/images/loading-small.gif"></image>
<text>加载中...</text>
</view>
<view class="search-init" wx:if="{{isInit}}">
<image src="/images/ic_empty_data.png"></image>
<text>请输入关键词</text>
</view>

View File

@ -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;
}

View File

@ -1,10 +0,0 @@
function indexOf(str, val) {
if (str.indexOf(val) != -1) {
return true;
} else {
return false;
}
}
module.exports = {
indexOf: indexOf
}

View File

@ -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/";
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/";

View File

@ -32,6 +32,9 @@ function indexOf(str, val) {
} else {
return false;
}
}
function formatDuration(){
}
module.exports = {
formatTime: formatTime,

42
utils/utils.wxs Normal file
View File

@ -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
}