处理问题

This commit is contained in:
wenc000 2020-07-15 14:45:24 +08:00
parent 42ba6dd036
commit 36b60563b6
7 changed files with 39 additions and 23 deletions

View File

@ -6,6 +6,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
activityUrl: app.activityUrl,
dataMap: {}, dataMap: {},
token: '' token: ''
}, },
@ -65,24 +66,18 @@ Page({
url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id url = '/wxminiapp/activitylibrary/getactivitylibrarybyid/' + id
self.getToken() self.getToken()
} }
app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), app.restAjax.get(app.restAjax.path(app.activityUrl + url, []), {}, {
{}, {
headers: { headers: {
token: self.data.token token: self.data.token
} }
}, function(code, data) { }, function(code, data) {
if('200' == code) { data.activityImageArray = data.activityImage.split(',');
data.activityImage = app.activityUrl + '/route/file/downloadfile/true/' + data.activityImage;
self.setData({ self.setData({
dataMap: data dataMap: data
}) })
console.log(self.data.dataMap) }, function(code, data) {
} app.dialog.msg(data.msg);
}, function() { });
}, function() {
})
}) })
}, },

View File

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

View File

@ -1,5 +1,9 @@
<view class="activity-img"> <view class="activity-img">
<image src="{{dataMap.activityImage}}"></image> <swiper indicator-dots="false" autoplay="true" >
<swiper-item class="swiper-item" wx:for="{{dataMap.activityImageArray}}" wx:for-index="idx" wx:for-item="item" wx:key="activityImageArray">
<image src="{{activityUrl}}/route/file/downloadfile/true/{{item}}"></image>
</swiper-item>
</swiper>
</view> </view>
<view class="activity-detail"> <view class="activity-detail">
<view class="activity-title">{{dataMap.activityTitle}}</view> <view class="activity-title">{{dataMap.activityTitle}}</view>

View File

@ -2,6 +2,9 @@
width: 100%; width: 100%;
height: 480rpx; height: 480rpx;
} }
swiper {
height: 100%;
}
.activity-detail{ .activity-detail{
position: absolute; position: absolute;
left: 0; left: 0;

View File

@ -70,6 +70,9 @@ Page({
page: 1, page: 1,
rows: 3 rows: 3
}, null, function(code, data) { }, null, function(code, data) {
for(var i = 0, item; item = data.rows[i++];) {
item.venuePanoramaArray = item.venuePanorama.split(',');
}
self.setData({ self.setData({
'venue.venueList': data.rows 'venue.venueList': data.rows
}); });
@ -83,6 +86,9 @@ Page({
page: 1, page: 1,
rows: 3 rows: 3
}, null, function(code, data) { }, null, function(code, data) {
for(var i = 0, item; item = data.rows[i++];) {
item.activityImageArray = item.activityImage.split(',');
}
self.setData({ self.setData({
'activity.activityList': data.rows 'activity.activityList': data.rows
}); });
@ -142,6 +148,11 @@ Page({
url: '../venue/venue', url: '../venue/venue',
}) })
}, },
goVenueDetail: function(event) {
wx.navigateTo({
url: '../venueDetail/venueDetail?venuesInfoId=' + event.currentTarget.dataset.venuesInfoId,
})
},
goBroadcastDetail: function (event) { goBroadcastDetail: function (event) {
wx.navigateTo({ wx.navigateTo({
url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId, url: '../broadcastDetail/broadcastDetail?livePlanId='+ event.currentTarget.dataset.livePlanId,
@ -152,6 +163,11 @@ Page({
url: '../activity/activity', url: '../activity/activity',
}) })
}, },
goActivityDetail: function(event) {
wx.navigateTo({
url: '../activityDetail/activityDetail?id=' + event.currentTarget.dataset.activityLibraryId
})
},
goHeritage: function () { goHeritage: function () {
wx.switchTab({ wx.switchTab({
url: '../heritage/heritage', url: '../heritage/heritage',

View File

@ -44,11 +44,11 @@
</view> </view>
</view> </view>
<view class="recommend-container"> <view class="recommend-container">
<view class="recommend-box" wx:for="{{venue.venueList}}" wx:for-index="index" wx:for-item="item" wx:key="venueList"> <view class="recommend-box" wx:for="{{venue.venueList}}" bindtap="goVenueDetail" data-venues-info-Id="{{item.venuesInfoId}}" wx:for-index="index" wx:for-item="item" wx:key="venueList">
<image src="{{venue.venueUrl}}/route/file/downloadfile/true/{{item.venuePanorama}}"></image> <image src="{{venue.venueUrl}}/route/file/downloadfile/true/{{item.venuePanoramaArray[0]}}"></image>
</view> </view>
<view class="recommend-box" wx:for="{{activity.activityList}}" wx:for-index="index" wx:for-item="item" wx:key="activityList"> <view class="recommend-box" wx:for="{{activity.activityList}}" bindtap="goActivityDetail" data-activity-library-id="{{item.activityLibraryId}}" wx:for-index="index" wx:for-item="item" wx:key="activityList">
<image src="{{activity.activityUrl}}/route/file/downloadfile/true/{{item.activityImage}}"></image> <image src="{{activity.activityUrl}}/route/file/downloadfile/true/{{item.activityImageArray[0]}}"></image>
</view> </view>
</view> </view>
</view> </view>

View File

@ -52,10 +52,6 @@ Page({
page: page, page: page,
rows: self.data.rows rows: self.data.rows
}, null, function(code, data) { }, null, function(code, data) {
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
var newsArray; var newsArray;
if(page <= 1) { if(page <= 1) {
newsArray = data.rows; newsArray = data.rows;
@ -67,6 +63,10 @@ Page({
currentPage: page, currentPage: page,
'news.newsList': newsArray 'news.newsList': newsArray
}) })
if(data.rows.length == 0) {
app.dialog.msg('暂无数据');
return;
}
}, function(code, data) { }, function(code, data) {
app.dialog.msg(data.msg); app.dialog.msg(data.msg);
}, function() { }, function() {
@ -84,7 +84,6 @@ Page({
*/ */
onLoad: function (options) { onLoad: function (options) {
var self = this; var self = this;
console.log(options);
if(options.type == 1) { if(options.type == 1) {
self.setData({ self.setData({
directoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167' directoriesParentId: 'f497904b-7727-4832-891c-604c36ae4167'