首页功能对接接口
This commit is contained in:
parent
7bbad266ba
commit
ff9c36ae56
7
app.js
7
app.js
@ -6,16 +6,19 @@ App({
|
||||
loginUrl: restAjax.baseUrl,
|
||||
usercenterUrl: restAjax.baseUrl,
|
||||
newsUrl: restAjax.baseUrl,
|
||||
newsContentUrl: restAjax.baseUrl,
|
||||
newsContentUrl: restAjax.url,
|
||||
libraryUrl: restAjax.baseUrl,
|
||||
venueUrl: restAjax.baseUrl,
|
||||
activityUrl: restAjax.baseUrl,
|
||||
volunteerUrl: restAjax.baseUrl,
|
||||
activityUrl: restAjax.baseUrl,
|
||||
volunteerUrl: restAjax.baseUrl,
|
||||
liveUrl: restAjax.baseUrl,
|
||||
liveUrl: restAjax.ulr+'live/',
|
||||
liveRecordUrl: restAjax.baseUrl,
|
||||
socialUrl: restAjax.baseUrl,
|
||||
areaCode: '540200000000',
|
||||
areaName: '日喀则市',
|
||||
areaId: '640675',
|
||||
shopUrl: restAjax.url + "xzshop",
|
||||
restAjax: restAjax,
|
||||
shopImgUrl: restAjax.url + "xzshop/route/file/download/true/",
|
||||
|
12
app.json
12
app.json
@ -40,7 +40,8 @@
|
||||
"pages/serviceActivityDetail/serviceActivityDetail",
|
||||
"pages/shop/shopcategory"
|
||||
],
|
||||
"subPackages": [{
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "subpages/",
|
||||
"pages": [
|
||||
"goodslist/goodslist",
|
||||
@ -51,9 +52,11 @@
|
||||
"addshopaddress/addshopaddress",
|
||||
"editshopaddress/editshopaddress",
|
||||
"orderconfirm/orderconfirm",
|
||||
"addresschoose/addresschoose"
|
||||
"addresschoose/addresschoose",
|
||||
"webcontentview/webcontent"
|
||||
]
|
||||
}],
|
||||
}
|
||||
],
|
||||
"window": {
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarBackgroundColor": "#9F1512",
|
||||
@ -64,7 +67,8 @@
|
||||
"color": "#BBBBBB",
|
||||
"borderStyle": "black",
|
||||
"selectedColor": "#000000",
|
||||
"list": [{
|
||||
"list": [
|
||||
{
|
||||
"pagePath": "pages/index/index",
|
||||
"iconPath": "images/index.png",
|
||||
"text": "首页",
|
||||
|
@ -30,7 +30,9 @@ Page({
|
||||
liveList: []
|
||||
},
|
||||
usercenterUrl: app.usercenterUrl,
|
||||
isConfirm: false
|
||||
isConfirm: false,
|
||||
mainFuncList: [],
|
||||
mainNewTab: [],
|
||||
},
|
||||
doLogin: function () {
|
||||
var self = this;
|
||||
@ -60,6 +62,63 @@ Page({
|
||||
}
|
||||
})
|
||||
},
|
||||
//获取首页功能
|
||||
getMainFunc() {
|
||||
var _self = this;
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/list/areamenu/release/{areaCode}', [_self.data.news.newsUrl, app.areaCode]),
|
||||
null,
|
||||
null,
|
||||
function (code, data) {
|
||||
console.log(data)
|
||||
_self.setData({
|
||||
mainFuncList: data
|
||||
})
|
||||
},
|
||||
function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
//获取首页新闻动态
|
||||
getMainNewsTab() {
|
||||
var _self = this;
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/list/areaplate/release/{areaCode}', [_self.data.news.newsUrl, app.areaCode]),
|
||||
null,
|
||||
null,
|
||||
function (code, data) {
|
||||
if (data && data.length > 0) {
|
||||
_self.setData({
|
||||
mainNewTab: data
|
||||
})
|
||||
data.forEach(el => {
|
||||
_self.doGetNewsList(el.newsDirectoriesId);
|
||||
});
|
||||
}
|
||||
},
|
||||
function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
//获取新闻
|
||||
doGetNewsList(id) {
|
||||
var _self = this;
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [_self.data.news.newsUrl, app.areaCode]), {
|
||||
newsDirectoriesId: id,
|
||||
page: 1,
|
||||
rows: 5
|
||||
}, null, function (code, data) {
|
||||
_self.data.mainNewTab.forEach(el => {
|
||||
if (el.newsDirectoriesId == id) {
|
||||
el.newsList = data.rows
|
||||
}
|
||||
});
|
||||
_self.setData({
|
||||
mainNewTab: _self.data.mainNewTab
|
||||
})
|
||||
}, function (code, data) {
|
||||
console.log(data)
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
doGetBanner: function () {
|
||||
var self = this;
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), {
|
||||
@ -110,20 +169,20 @@ Page({
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
doGetNewsList: function () {
|
||||
var self = this;
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), {
|
||||
newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167',
|
||||
page: 1,
|
||||
rows: 5
|
||||
}, null, function (code, data) {
|
||||
self.setData({
|
||||
'news.newsList': data.rows
|
||||
})
|
||||
}, function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
// doGetNewsList: function () {
|
||||
// var self = this;
|
||||
// app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), {
|
||||
// newsDirectoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167',
|
||||
// page: 1,
|
||||
// rows: 5
|
||||
// }, null, function (code, data) {
|
||||
// self.setData({
|
||||
// 'news.newsList': data.rows
|
||||
// })
|
||||
// }, function (code, data) {
|
||||
// app.dialog.msg(data.msg);
|
||||
// });
|
||||
// },
|
||||
doGetLiveList: function () {
|
||||
var self = this;
|
||||
app.restAjax.get(app.restAjax.path('{liveUrl}/app/liveplan/listpageliveplanrelease', [self.data.live.liveUrl]), {
|
||||
@ -137,11 +196,33 @@ Page({
|
||||
app.dialog.msg(data.msg);
|
||||
});
|
||||
},
|
||||
|
||||
goNewsDetail: function (event) {
|
||||
wx.navigateTo({
|
||||
url: '../newsDetail/newsDetail?templateRecordUrl=' + event.currentTarget.dataset.templateRecordUrl,
|
||||
})
|
||||
},
|
||||
openNewsDetail(e) {
|
||||
console.log(e.currentTarget.dataset.item)
|
||||
//判断是跳转到列表 详情 webview
|
||||
var item = e.currentTarget.dataset.item;
|
||||
if (item.directoriesView == '0') {
|
||||
//跳转webview
|
||||
wx.navigateTo({
|
||||
url: '/subpages/webcontentview/webcontent?url=' + item.directoriesTarget2,
|
||||
})
|
||||
} else if (item.directoriesView == '1') {
|
||||
//跳转列表
|
||||
wx.navigateTo({
|
||||
url: '/pages/newsList/newsList?id=' + item.newsDirectoriesId,
|
||||
})
|
||||
} else {
|
||||
//跳转无二级页面
|
||||
wx.navigateTo({
|
||||
url: '/pages/newsList/newsList?id=' + item.newsDirectoriesId,
|
||||
})
|
||||
}
|
||||
},
|
||||
goNewsList: function (event) {
|
||||
wx.navigateTo({
|
||||
url: '../newsList/newsList?type=' + event.currentTarget.dataset.type,
|
||||
@ -240,58 +321,11 @@ Page({
|
||||
})
|
||||
self.doLogin();
|
||||
self.doGetBanner();
|
||||
self.doGetNewsList();
|
||||
self.doGetLiveList();
|
||||
self.doGetVenueList();
|
||||
self.doGetActivityList();
|
||||
self.getMainFunc();
|
||||
self.getMainNewsTab();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -1,19 +1,17 @@
|
||||
<view class="swiper-box">
|
||||
<swiper indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" >
|
||||
<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">
|
||||
<image 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">
|
||||
<view class="tab-box" bindtap="goNewsList" data-type="2">
|
||||
<image src="../../images/tab6.png"></image>
|
||||
<view class="tab-title">展览展示</view>
|
||||
</view>
|
||||
<view class="tab-box" bindtap="goNewsList" data-type="1">
|
||||
<image src="../../images/tab7.png"></image>
|
||||
<view class="tab-title">文化动态</view>
|
||||
<block wx:for="{{mainFuncList}}" wx:key="index">
|
||||
<view class="tab-box" bindtap="openNewsDetail" data-item="{{item}}">
|
||||
<image src="{{item.directoriesPhoto==''? '../../images/tab6.png':news.newsUrl+'/route/file/download/true/'+item.directoriesPhoto}}"></image>
|
||||
<view class="tab-title">{{item.directoriesName}}</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="tab-box" bindtap="goVolunteer">
|
||||
<image src="../../images/tab1.png"></image>
|
||||
<view class="tab-title">志愿者服务</view>
|
||||
@ -34,18 +32,6 @@
|
||||
<image src="../../images/tab5.png"></image>
|
||||
<view class="tab-title">直播点播</view>
|
||||
</view>
|
||||
<view class="tab-box" bindtap="goTrain">
|
||||
<image src="../../images/tab5.png"></image>
|
||||
<view class="tab-title">在线培训</view>
|
||||
</view>
|
||||
<view class="tab-box" bindtap="goTravel">
|
||||
<image src="../../images/tab6.png"></image>
|
||||
<view class="tab-title">文化旅游</view>
|
||||
</view>
|
||||
<view class="tab-box" bindtap="goResource">
|
||||
<image src="../../images/tab4.png"></image>
|
||||
<view class="tab-title">数图资源</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="recommend">
|
||||
<view class="public-title">
|
||||
@ -64,15 +50,17 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="news">
|
||||
<view class="news" wx:if="{{mainNewTab.length>0}}">
|
||||
<block wx:for="{{mainNewTab}}" wx:key="i" wx:for-item="it" wx:for-index="i">
|
||||
<view class="public-title">
|
||||
<view class="title-text">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
文化动态
|
||||
{{it.directoriesName}}
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:for="{{news.newsList}}" wx:for-index="idx" wx:for-item="item" wx:key="newsList">
|
||||
<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-title">{{item.newsContentTitle}}</view>
|
||||
<view class="news-small-pic">
|
||||
@ -104,13 +92,13 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="news-row-img">
|
||||
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}" ></image>
|
||||
<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-title">{{item.newsContentTitle}}</view>
|
||||
<view class="news-big-pic">
|
||||
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}" ></image>
|
||||
<image src="{{news.newsUrl}}/route/file/download/true/{{item.newsContentCoverList[0].contentCoverId}}"></image>
|
||||
</view>
|
||||
<view class="news-info">
|
||||
<text>来源:{{item.newsContentResource}}</text>
|
||||
@ -144,6 +132,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
<view class="broadcast">
|
||||
<view class="public-title">
|
||||
|
@ -1,36 +1,45 @@
|
||||
.swiper-box, .swiper-img, swiper{
|
||||
.swiper-box,
|
||||
.swiper-img,
|
||||
swiper {
|
||||
width: 100%;
|
||||
height: 330rpx;
|
||||
}
|
||||
.tab{
|
||||
|
||||
.tab {
|
||||
padding: 30rpx;
|
||||
display: flex;
|
||||
border-bottom: 5px solid #FBFBFB;
|
||||
flex-wrap: nowrap;
|
||||
overflow-x: scroll;
|
||||
}
|
||||
.tab-box{
|
||||
|
||||
.tab-box {
|
||||
flex-shrink: 0;
|
||||
text-align: center;
|
||||
width: 25%;
|
||||
}
|
||||
.tab-box image{
|
||||
|
||||
.tab-box image {
|
||||
width: 65rpx;
|
||||
height: 65rpx;
|
||||
}
|
||||
.tab-title{
|
||||
|
||||
.tab-title {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.recommend{
|
||||
|
||||
.recommend {
|
||||
padding: 30rpx;
|
||||
border-bottom: 5px solid #FBFBFB;
|
||||
}
|
||||
.recommend-container{
|
||||
|
||||
.recommend-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.recommend-box{
|
||||
|
||||
.recommend-box {
|
||||
flex-shrink: 0;
|
||||
width: 220rpx;
|
||||
height: 130rpx;
|
||||
@ -39,14 +48,18 @@
|
||||
position: relative;
|
||||
margin-right: 30rpx;
|
||||
}
|
||||
.recommend-box image{
|
||||
|
||||
.recommend-box image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.public-title{
|
||||
|
||||
.public-title {
|
||||
text-align: center;
|
||||
padding: 10rpx 0rpx;
|
||||
}
|
||||
.title-text{
|
||||
|
||||
.title-text {
|
||||
display: inline-block;
|
||||
font-size: 32rpx;
|
||||
color: #9F1512;
|
||||
@ -54,78 +67,97 @@
|
||||
position: relative;
|
||||
margin-bottom: 15rpx;
|
||||
}
|
||||
.title-text image{
|
||||
|
||||
.title-text image {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 15rpx;
|
||||
height: 100%;
|
||||
}
|
||||
.selected-l{
|
||||
|
||||
.selected-l {
|
||||
left: 0;
|
||||
}
|
||||
.selected-r{
|
||||
|
||||
.selected-r {
|
||||
right: 0;
|
||||
}
|
||||
.news{
|
||||
|
||||
.news {
|
||||
padding: 30rpx;
|
||||
border-bottom: 5px solid #FBFBFB;
|
||||
}
|
||||
.news-box{
|
||||
|
||||
.news-box {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.news-title{
|
||||
|
||||
.news-title {
|
||||
color: #242424;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.news-info{
|
||||
|
||||
.news-info {
|
||||
color: #949494;
|
||||
margin-top: 15rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.news-info text{
|
||||
|
||||
.news-info text {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.news-big-pic, .news-small-pic{
|
||||
|
||||
.news-big-pic,
|
||||
.news-small-pic {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.news-big-pic image{
|
||||
|
||||
.news-big-pic image {
|
||||
width: 100%;
|
||||
height: 380rpx;
|
||||
}
|
||||
.news-small-pic image{
|
||||
|
||||
.news-small-pic image {
|
||||
width: 30%;
|
||||
height: 150rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.transverse-news{
|
||||
|
||||
.transverse-news {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.news-row-img{
|
||||
|
||||
.news-row-img {
|
||||
width: 30%;
|
||||
height: 150rpx;
|
||||
}
|
||||
.news-row-img image{
|
||||
|
||||
.news-row-img image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.news-row-info{
|
||||
|
||||
.news-row-info {
|
||||
width: 68%;
|
||||
}
|
||||
.broadcast{
|
||||
|
||||
.broadcast {
|
||||
margin-top: 15rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
.broadcast-container{
|
||||
|
||||
.broadcast-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.broadcast-box{
|
||||
|
||||
.broadcast-box {
|
||||
flex-shrink: 0;
|
||||
width: 49%;
|
||||
border-radius: 10rpx;
|
||||
@ -134,24 +166,27 @@
|
||||
margin-bottom: 15rpx;
|
||||
position: relative;
|
||||
}
|
||||
.broadcast-box image{
|
||||
|
||||
.broadcast-box image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.broadcast-text{
|
||||
|
||||
.broadcast-text {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
padding: 5rpx 10rpx;
|
||||
font-size: 26rpx;
|
||||
background: rgba(0,0,0,0.6);
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
color: #fff;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.broadcast-status{
|
||||
|
||||
.broadcast-status {
|
||||
position: absolute;
|
||||
top: 10rpx;
|
||||
right: 10rpx;
|
||||
@ -161,7 +196,8 @@
|
||||
font-size: 26rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.set-phone{
|
||||
|
||||
.set-phone {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
@ -170,7 +206,8 @@
|
||||
background: rgba(0, 0, 0, .6);
|
||||
z-index: 100;
|
||||
}
|
||||
.set-phone-box{
|
||||
|
||||
.set-phone-box {
|
||||
width: 96%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
@ -181,19 +218,23 @@
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.tips{
|
||||
|
||||
.tips {
|
||||
font-size: 28rpx;
|
||||
color: #000;
|
||||
}
|
||||
.phone-input{
|
||||
|
||||
.phone-input {
|
||||
margin: 25rpx 0;
|
||||
}
|
||||
.code-input{
|
||||
|
||||
.code-input {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 25rpx;
|
||||
}
|
||||
.code-input input{
|
||||
|
||||
.code-input input {
|
||||
width: 70%;
|
||||
height: 55rpx;
|
||||
border: 1px solid #dedede;
|
||||
@ -202,7 +243,8 @@
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.phone-input input{
|
||||
|
||||
.phone-input input {
|
||||
width: 100%;
|
||||
height: 55rpx;
|
||||
border: 1px solid #dedede;
|
||||
@ -211,25 +253,30 @@
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.get-code, .got-code{
|
||||
|
||||
.get-code,
|
||||
.got-code {
|
||||
font-size: 28rpx;
|
||||
background: rgba(159,21,18,.1);
|
||||
background: rgba(159, 21, 18, .1);
|
||||
color: #9F1512;
|
||||
width: 28%;
|
||||
line-height: 55rpx;
|
||||
text-align: center;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.got-code{
|
||||
|
||||
.got-code {
|
||||
background: #fff;
|
||||
color: #4a4d52;
|
||||
border: 1px solid #eaeaea;
|
||||
}
|
||||
.set-phone-btn-box{
|
||||
|
||||
.set-phone-btn-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.set-phone-btn{
|
||||
|
||||
.set-phone-btn {
|
||||
width: 100%;
|
||||
height: 65rpx;
|
||||
display: flex;
|
||||
@ -240,21 +287,25 @@
|
||||
background: #9F1512;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.voice-box{
|
||||
|
||||
.voice-box {
|
||||
padding-right: 30px;
|
||||
position: relative;
|
||||
}
|
||||
.voice-box iamge{
|
||||
|
||||
.voice-box iamge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width:25rpx;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
}
|
||||
.news-big-pic{
|
||||
|
||||
.news-big-pic {
|
||||
position: relative;
|
||||
}
|
||||
.news-big-pic image.play-btn{
|
||||
|
||||
.news-big-pic image.play-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
|
@ -10,27 +10,32 @@ Page({
|
||||
newsDictionaries: [],
|
||||
newsList: [],
|
||||
},
|
||||
directoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167',
|
||||
dirId: '', //tab Id
|
||||
currentNewsDictionariesId: '',
|
||||
currentPage: 1,
|
||||
rows: 10,
|
||||
areaId: ''
|
||||
areaId: app.areaCode,
|
||||
defaultAreaId: app.areaCode
|
||||
},
|
||||
doGetNewsDictionariesList: function() {
|
||||
doGetNewsDictionariesList: function () {
|
||||
var self = this;
|
||||
app.dialog.loading('正在加载');
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listnewsdirectoriesrelease', [self.data.news.newsUrl]), {
|
||||
directoriesParentId: self.data.directoriesParentId,
|
||||
}, null, function(code, data) {
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newsdirectories/listsub/areaauth/release/{newsDirectoriesId}/{areaCode}', [self.data.news.newsUrl, self.data.dirId, app.areaCode]),
|
||||
null,
|
||||
null,
|
||||
function (code, data) {
|
||||
self.setData({
|
||||
'news.newsDictionaries': data
|
||||
'news.newsDictionaries': data,
|
||||
currentNewsDictionariesId: self.data.dirId
|
||||
})
|
||||
self.doGetNewsList(1);
|
||||
}, function(code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
}, function() {});
|
||||
},
|
||||
doClickDictionaries: function(event) {
|
||||
function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
},
|
||||
function () {});
|
||||
},
|
||||
doClickDictionaries: function (event) {
|
||||
var self = this;
|
||||
console.log(event.currentTarget.dataset.newsDirectoriesId)
|
||||
self.setData({
|
||||
@ -38,30 +43,29 @@ Page({
|
||||
});
|
||||
self.doGetNewsList(1);
|
||||
},
|
||||
doClearCurrentNewsDictionariesId: function() {
|
||||
//全部类型
|
||||
doClearCurrentNewsDictionariesId: function () {
|
||||
var self = this;
|
||||
self.setData({
|
||||
currentNewsDictionariesId: ''
|
||||
currentNewsDictionariesId: self.data.dirId
|
||||
});
|
||||
self.doGetNewsList(1);
|
||||
},
|
||||
doGetNewsList: function(page, lv) {
|
||||
doGetNewsList: function (page, lv) {
|
||||
var self = this;
|
||||
app.dialog.loading('正在加载');
|
||||
console.log(self.data.currentNewsDictionariesId)
|
||||
var info = {
|
||||
newsDirectoriesParentId: self.data.directoriesParentId,
|
||||
newsDirectoriesId: self.data.currentNewsDictionariesId ? self.data.currentNewsDictionariesId : '',
|
||||
newsDirectoriesId: self.data.currentNewsDictionariesId,
|
||||
page: page,
|
||||
rows: self.data.rows
|
||||
}
|
||||
var tempAreaCode = app.areaCode;
|
||||
if (lv) {
|
||||
lv = 'area' + lv
|
||||
info[lv] = self.data.areaId
|
||||
tempAreaCode = self.data.areaId;
|
||||
}
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease', [self.data.news.newsUrl]), info, null, function(code, data) {
|
||||
app.restAjax.get(app.restAjax.path('{newsUrl}/app/newscontent/listpagenewscontentrelease/{areaCode}', [self.data.news.newsUrl, tempAreaCode]), info, null, function (code, data) {
|
||||
var newsArray;
|
||||
if(page <= 1) {
|
||||
if (page <= 1) {
|
||||
newsArray = data.rows;
|
||||
} else {
|
||||
newsArray = self.data.news.newsList;
|
||||
@ -72,26 +76,27 @@ Page({
|
||||
'news.newsList': newsArray
|
||||
})
|
||||
console.log(self.data.news.newsList)
|
||||
if(data.rows.length == 0) {
|
||||
if (data.rows.length == 0) {
|
||||
app.dialog.msg('暂无数据');
|
||||
return;
|
||||
}
|
||||
}, function(code, data) {
|
||||
}, function (code, data) {
|
||||
app.dialog.msg(data.msg);
|
||||
}, function() {
|
||||
}, function () {
|
||||
wx.stopPullDownRefresh();
|
||||
wx.hideLoading();
|
||||
});
|
||||
},
|
||||
goNewsDetail: function (event) {
|
||||
wx.navigateTo({
|
||||
url: '../newsDetail/newsDetail?templateRecordUrl='+ event.currentTarget.dataset.templateRecordUrl,
|
||||
url: '../newsDetail/newsDetail?templateRecordUrl=' + event.currentTarget.dataset.templateRecordUrl,
|
||||
})
|
||||
},
|
||||
getAreaList: function () {
|
||||
var self = this;
|
||||
app.restAjax.get(app.restAjax.path(app.usercenterUrl + '/app/area/listallbyparentidrelease/640675', []),
|
||||
self.data.pages, null, function (code, data) {
|
||||
self.data.pages, null,
|
||||
function (code, data) {
|
||||
if (code == '200') {
|
||||
self.setData({
|
||||
areaList: data
|
||||
@ -110,7 +115,7 @@ Page({
|
||||
},
|
||||
loadAll: function () {
|
||||
this.setData({
|
||||
areaId: ''
|
||||
areaId: app.areaCode
|
||||
})
|
||||
this.doGetNewsList(1)
|
||||
},
|
||||
@ -119,65 +124,11 @@ Page({
|
||||
*/
|
||||
onLoad: function (options) {
|
||||
var self = this;
|
||||
if(options.type == 1) {
|
||||
self.setData({
|
||||
directoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167'
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
directoriesParentId: 'f1d5d313-f728-4dda-9843-1116d97e17b0'
|
||||
});
|
||||
}
|
||||
dirId: options.id
|
||||
})
|
||||
self.doGetNewsDictionariesList();
|
||||
self.getAreaList();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload: function () {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function () {
|
||||
this.doGetNewsList(1);
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom: function () {
|
||||
this.doGetNewsList(this.data.currentPage + 1);
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage: function () {
|
||||
|
||||
}
|
||||
})
|
@ -1,29 +1,30 @@
|
||||
<view class="top-tab">
|
||||
<view class="type">
|
||||
<view class="tab-box {{!currentNewsDictionariesId ? 'active' : ''}}" bindtap="doClearCurrentNewsDictionariesId">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
全部
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
<view class="tab-box {{currentNewsDictionariesId==dirId ? 'active' : ''}}" bindtap="doClearCurrentNewsDictionariesId">
|
||||
<image src="../../images/selected-l.png" mode="scaleToFill" wx:if="{{dirId==currentNewsDictionariesId}}"></image>
|
||||
<view class="txt">全部</view>
|
||||
<image src="../../images/selected-r.png" mode="scaleToFill" wx:if="{{dirId==currentNewsDictionariesId}}"></image>
|
||||
</view>
|
||||
<view class="tab-box {{ item.newsDirectoriesId == currentNewsDictionariesId ? 'active' : ''}}" wx:for="{{news.newsDictionaries}}" wx:for-index="index" wx:for-item="item" wx:key="newsDictionaries" bindtap="doClickDictionaries" data-news-directories-id="{{item.newsDirectoriesId}}">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
{{item.directoriesName}}
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
<image src="../../images/selected-l.png" mode="scaleToFill" wx:if="{{item.newsDirectoriesId==currentNewsDictionariesId}}"></image>
|
||||
<view class="txt">{{item.directoriesName}}</view>
|
||||
<image src="../../images/selected-r.png" mode="scaleToFill" wx:if="{{item.newsDirectoriesId==currentNewsDictionariesId}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="type">
|
||||
<view class="tab-box {{defaultAreaId == areaId?'active': ''}}" bindtap="loadAll">
|
||||
<image src="../../images/selected-l.png" mode="scaleToFill" wx:if="{{areaId==defaultAreaId}}"></image>
|
||||
<view class="txt">全部</view>
|
||||
<image src="../../images/selected-r.png" mode="scaleToFill" wx:if="{{areaId==defaultAreaId}}"></image>
|
||||
</view>
|
||||
<view class="tab-box {{item.areaCode == areaId?'active': ''}}" wx:for="{{areaList}}" wx:key="index" data-area="{{item.areaCode}}" data-level="{{item.areaLevel}}" bindtap="changeArea">
|
||||
<image src="../../images/selected-l.png" mode="scaleToFill" wx:if="{{areaId==item.areaCode}}"></image>
|
||||
<view class="txt">{{item.areaName}}</view>
|
||||
<image src="../../images/selected-r.png" mode="scaleToFill" wx:if="{{areaId==item.areaCode}}"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="area">
|
||||
<view class="area-box {{'' == areaId?'active': ''}}" bindtap="loadAll">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
全部
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
<view class="area-box {{item.areaId == areaId?'active': ''}}" wx:for="{{areaList}}" wx:key="index" data-area="{{item.areaId}}" data-level="{{item.areaLevel}}" bindtap="changeArea">
|
||||
<image src="../../images/selected-l.png" class="selected-l"></image>
|
||||
{{item.areaName}}
|
||||
<image src="../../images/selected-r.png" class="selected-r"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<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'}}">
|
||||
|
@ -1,17 +1,102 @@
|
||||
.top-tab{
|
||||
.top-tab {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: #fff;
|
||||
overflow-x: auto;
|
||||
overflow-x: hidden;
|
||||
z-index: 100;
|
||||
box-shadow: 10rpx 10rpx 15rpx #f0f0f0;
|
||||
}
|
||||
.type{
|
||||
|
||||
.type {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
/* 隐藏滚动条 */
|
||||
scrollbar-width: none;
|
||||
/* firefox */
|
||||
-ms-overflow-style: none;
|
||||
/* IE 10+ */
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.tab-box{
|
||||
display: inline-flex;
|
||||
|
||||
.tab-box {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 25%;
|
||||
position: relative;
|
||||
height: 90rpx;
|
||||
font-size: 30rpx;
|
||||
color: #242424;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.tab-box.active {
|
||||
color: #9F1512;
|
||||
}
|
||||
|
||||
.tab-box image {
|
||||
width: 20rpx;
|
||||
height: 40rpx;
|
||||
/* position: absolute;
|
||||
width: 15rpx;
|
||||
height: 40rpx;
|
||||
top: 50%;
|
||||
margin-top: -20rpx;
|
||||
display: none; */
|
||||
}
|
||||
|
||||
.tab-box .txt {
|
||||
padding: 0rpx 10rpx;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tab-box.active image {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tab-box image.selected-l {
|
||||
left: 20rpx;
|
||||
}
|
||||
|
||||
.tab-box image.selected-r {
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.area {
|
||||
display: flex;
|
||||
/* z-index: 100;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
position: fixed;
|
||||
top: 90rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-bottom: 1px solid #DDD;
|
||||
background: #fff; */
|
||||
}
|
||||
|
||||
.area-box {
|
||||
/* display: flex;
|
||||
width: fit-content;
|
||||
flex-direction: row;
|
||||
height: 90rpx; */
|
||||
/* line-height: 90rpx;
|
||||
text-align: center; */
|
||||
/* align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 30rpx; */
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 30%;
|
||||
@ -21,10 +106,12 @@
|
||||
color: #242424;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.tab-box.active{
|
||||
|
||||
.area-box.active {
|
||||
color: #9F1512;
|
||||
}
|
||||
.tab-box image{
|
||||
|
||||
.area-box image {
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 40rpx;
|
||||
@ -32,108 +119,76 @@
|
||||
margin-top: -20rpx;
|
||||
display: none;
|
||||
}
|
||||
.tab-box.active image{
|
||||
|
||||
.area-box.active image {
|
||||
display: block;
|
||||
}
|
||||
.tab-box image.selected-l{
|
||||
|
||||
.area-box image.selected-l {
|
||||
left: 20rpx;
|
||||
}
|
||||
.tab-box image.selected-r{
|
||||
|
||||
.area-box image.selected-r {
|
||||
right: 20rpx;
|
||||
}
|
||||
.area{
|
||||
z-index: 100;
|
||||
overflow-x: auto;
|
||||
white-space: nowrap;
|
||||
position: fixed;
|
||||
top: 90rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-bottom: 1px solid #DDD;
|
||||
background: #fff;
|
||||
}
|
||||
.area-box{
|
||||
display: inline-flex;
|
||||
width: 30%;
|
||||
height: 90rpx;
|
||||
/* line-height: 90rpx;
|
||||
text-align: center; */
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 20px;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
.area-box.active{
|
||||
color: #9F1512;
|
||||
}
|
||||
.area-box image{
|
||||
position: absolute;
|
||||
width: 15rpx;
|
||||
height: 40rpx;
|
||||
top: 50%;
|
||||
margin-top: -20rpx;
|
||||
display: none;
|
||||
}
|
||||
.area-box.active image{
|
||||
display: block;
|
||||
}
|
||||
.area-box image.selected-l{
|
||||
left: 20rpx;
|
||||
}
|
||||
.area-box image.selected-r{
|
||||
right: 20rpx;
|
||||
}
|
||||
.news{
|
||||
|
||||
.news {
|
||||
padding: 30rpx;
|
||||
border-bottom: 5px solid #FBFBFB;
|
||||
margin-top: 180rpx;
|
||||
}
|
||||
.news-box{
|
||||
|
||||
.news-box {
|
||||
padding: 30rpx 0;
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.news-title{
|
||||
|
||||
.news-title {
|
||||
color: #242424;
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.news-info{
|
||||
|
||||
.news-info {
|
||||
color: #949494;
|
||||
margin-top: 15rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.news-info text{
|
||||
|
||||
.news-info text {
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.voice-box{
|
||||
|
||||
.voice-box {
|
||||
padding-right: 30px;
|
||||
position: relative;
|
||||
}
|
||||
.voice-box iamge{
|
||||
|
||||
.voice-box iamge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width:25rpx;
|
||||
width: 25rpx;
|
||||
height: 25rpx;
|
||||
}
|
||||
.news-big-pic, .news-small-pic{
|
||||
|
||||
.news-big-pic,
|
||||
.news-small-pic {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.news-big-pic{
|
||||
|
||||
.news-big-pic {
|
||||
position: relative;
|
||||
}
|
||||
.news-big-pic image{
|
||||
|
||||
.news-big-pic image {
|
||||
width: 100%;
|
||||
height: 380rpx;
|
||||
}
|
||||
.news-big-pic image.play-btn{
|
||||
|
||||
.news-big-pic image.play-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
@ -141,23 +196,28 @@
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
.news-small-pic image{
|
||||
|
||||
.news-small-pic image {
|
||||
width: 30%;
|
||||
height: 150rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.transverse-news{
|
||||
|
||||
.transverse-news {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.news-row-img{
|
||||
|
||||
.news-row-img {
|
||||
width: 30%;
|
||||
height: 150rpx;
|
||||
}
|
||||
.news-row-img image{
|
||||
|
||||
.news-row-img image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.news-row-info{
|
||||
|
||||
.news-row-info {
|
||||
width: 68%;
|
||||
}
|
19
subpages/webcontentview/webcontent.js
Normal file
19
subpages/webcontentview/webcontent.js
Normal file
@ -0,0 +1,19 @@
|
||||
// subpages/webcontentview/webcontent.js
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
webUrl: ""
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.setData({
|
||||
webUrl: options.url
|
||||
})
|
||||
},
|
||||
})
|
3
subpages/webcontentview/webcontent.json
Normal file
3
subpages/webcontentview/webcontent.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
2
subpages/webcontentview/webcontent.wxml
Normal file
2
subpages/webcontentview/webcontent.wxml
Normal file
@ -0,0 +1,2 @@
|
||||
<!--subpages/webcontentview/webcontent.wxml-->
|
||||
<web-view src="{{webUrl}}"></web-view>
|
1
subpages/webcontentview/webcontent.wxss
Normal file
1
subpages/webcontentview/webcontent.wxss
Normal file
@ -0,0 +1 @@
|
||||
/* subpages/webcontentview/webcontent.wxss */
|
@ -225,5 +225,7 @@ module.exports.params = getParamsArg;
|
||||
module.exports.path = buildPath;
|
||||
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://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/";
|
Loading…
Reference in New Issue
Block a user