Commit 24269642 by jscat

nyx weapp: udpate

1. /live/live页面, 当sortType为同一类型时, 不强制刷新
parent 3f7ab116
...@@ -615,7 +615,7 @@ Page({ ...@@ -615,7 +615,7 @@ Page({
}, },
// 开始搜索 //获取活动
onGetActivities: function () { onGetActivities: function () {
var _this = this; var _this = this;
...@@ -624,6 +624,7 @@ Page({ ...@@ -624,6 +624,7 @@ Page({
var strCategory = _this.__data__.category[curIndex].order var strCategory = _this.__data__.category[curIndex].order
var strSearch = _this.__data__.strSearch var strSearch = _this.__data__.strSearch
var activityType = _this.__data__.activityType var activityType = _this.__data__.activityType
_this.getActivities(0, 1, 4, strCity, activityType, strCategory, strSearch); _this.getActivities(0, 1, 4, strCity, activityType, strCategory, strSearch);
}, },
......
...@@ -544,22 +544,35 @@ Page({ ...@@ -544,22 +544,35 @@ Page({
}, },
// 开始搜索 //获取lives
onGetLives: function (e) { onGetLives: function () {
var _this = this; var _this = this;
var sortType = e == undefined ? _this.__data__.sortType : e.currentTarget.dataset.id
var sortType = _this.__data__.sortType
var strSearch = _this.__data__.strSearch var strSearch = _this.__data__.strSearch
var strCity = _this.__data__.city var strCity = _this.__data__.city
var liveType = _this.__data__.liveType var liveType = _this.__data__.liveType
_this.getLives(0, 1, 4, strCity, liveType, strSearch);
_this.getLives(0, 1, 4, strCity, liveType, strSearch);
_this.setData({ _this.setData({ strSearch, sortType })
strSearch: strSearch,
sortType: sortType,
})
}, },
//获取lives
onSwitchType: function (e) {
var _this = this;
var sortType = e == undefined ? _this.__data__.sortType : e.currentTarget.dataset.id
var strSearch = _this.__data__.strSearch
var strCity = _this.__data__.city
var liveType = _this.__data__.liveType
if(sortType != _this.__data__.sortType)
{
_this.setData({ sortType })
_this.onGetLives();
}
},
}) })
//通过Promise方式为wx.request添加同步操作 //通过Promise方式为wx.request添加同步操作
......
...@@ -42,19 +42,19 @@ ...@@ -42,19 +42,19 @@
<view class="workbench"> <view class="workbench">
<view class="list"> <view class="list">
<block> <block>
<view class="items" bindtap="onGetLives" data-id="01"> <view class="items" bindtap="onSwitchType" data-id="01">
<image src="../../icon/member/schedule.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image> <image src="../../icon/member/schedule.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">人气: 100</text> <text style="font-size:28rpx;">人气: 100</text>
</view> </view>
</block> </block>
<!-- todo 0828 我的活动暂时也不实现 --> <!-- todo 0828 我的活动暂时也不实现 -->
<view class="items" bindtap="onGetLives" data-id="02"> <view class="items" bindtap="onSwitchType" data-id="02">
<image src="../../icon/activity/order.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image> <image src="../../icon/activity/order.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">热度: 1.2k</text> <text style="font-size:28rpx;">热度: 1.2k</text>
</view> </view>
<view class="items" bindtap="onGetLives" data-id="03"> <view class="items" bindtap="onSwitchType" data-id="03">
<image src="../../icon/my/fav.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image> <image src="../../icon/my/fav.png" style="margin-top:10rpx; margin-bottom:-10rpx"></image>
<text style="font-size:28rpx;">关注: 12.5k</text> <text style="font-size:28rpx;">关注: 12.5k</text>
</view> </view>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论