|
|
@@ -8,7 +8,7 @@
|
|
|
<block wx:if="{{!!Data.subject_info}}">
|
|
|
<black class="movieInfoBlock">
|
|
|
<view class="movieInfo">
|
|
|
- <image class="movieInfo__poster" src="{{Data.subject_info.pic}}" mode="widthFix" lazy-load="false"/>
|
|
|
+ <image class="movieInfo__poster" src="{{Data.subject_info.pic}}" mode="widthFix" lazy-load="false" />
|
|
|
<view class="movieInfo__detail">
|
|
|
<view class="movieInfo__name">{{Data.subject_info.title}}</view>
|
|
|
<view wx:if="{{!!Data.subject_info.title_en}}" class="movieInfo__title_en">{{Data.subject_info.title_en}}</view>
|
|
|
@@ -20,7 +20,7 @@
|
|
|
<view wx:if="{{!!Data.subject_info.director}}" class="movieInfo__p">导演:{{Data.subject_info.director}}</view>
|
|
|
<view wx:if="{{!!Data.subject_info.actors.length}}" class="movieInfo__p">主演:<text wx:for="{{Data.subject_info.actors}}" wx:key="index">{{item}}</text></view>
|
|
|
</view>
|
|
|
- <view class="bg" style="background-image:linear-gradient(15deg, #fff 70%, rgba(225,225,225,0) 120%),url({{Data.subject_info.pic}})"/>
|
|
|
+ <view class="bg" style="background-image:linear-gradient(15deg, #fff 70%, rgba(225,225,225,0) 120%),url({{Data.subject_info.pic}})" />
|
|
|
</view>
|
|
|
|
|
|
<!-- 影片简介 -->
|
|
|
@@ -41,14 +41,14 @@
|
|
|
<!-- regions bar -->
|
|
|
<view wx:if="{{!!regions[1]}}" class="thisShell {{onMore?'onMore':''}}">
|
|
|
<view class="{{hasTop ? 'hasTop' : ''}}">
|
|
|
- <view wx:if="{{regions.length>4}}" class="more-cities"><b @tap.stop="bindMore">更多</b><i class="ico_arr"/></view>
|
|
|
+ <view wx:if="{{regions.length>4}}" class="more-cities"><b @tap.stop="bindMore">更多</b><i class="ico_arr" /></view>
|
|
|
<scroll-view
|
|
|
scroll-x
|
|
|
scroll-y
|
|
|
scroll-left="{{scrollLeft}}"
|
|
|
scroll-with-animation="{{scrollAnim}}"
|
|
|
class="weui-navbar">
|
|
|
- <view class="scrollHack"/>
|
|
|
+ <view class="scrollHack" />
|
|
|
<view
|
|
|
wx:for="{{regions}}"
|
|
|
wx:key="{{key}}"
|
|
|
@@ -58,7 +58,7 @@
|
|
|
@tap="tabClick">
|
|
|
<view class="weui-navbar__title">{{item}}</view>
|
|
|
</view>
|
|
|
- <view class="scrollHack"/>
|
|
|
+ <view class="scrollHack" />
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -66,14 +66,14 @@
|
|
|
<!-- -->
|
|
|
<view class="cinemas__list__wrapper">
|
|
|
<view wx:if="{{!!locateFail}}" class="blackMargin">
|
|
|
- <icon type="ico-Empty2" class=""/>
|
|
|
+ <icon type="ico-Empty2" class="" />
|
|
|
<button
|
|
|
@tap="goToSelectCity"
|
|
|
type="default" plain size="mini"
|
|
|
class="select_city">定位失败,请手动选择城市</button>
|
|
|
</view>
|
|
|
<view wx:if="{{!!Data && (Data.cinemas.length == 0)}}" class="blackMargin">
|
|
|
- <icon type="ico-Empty2" class=""/>
|
|
|
+ <icon type="ico-Empty2" class="" />
|
|
|
<view>没有符合条件的影院</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -98,18 +98,17 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import wepy from 'wepy'
|
|
|
-import { fetchCinemas } from '../../utils/api.js'
|
|
|
+import wepy from 'wepy';
|
|
|
+import { fetchCinemas } from '../../utils/api.js';
|
|
|
|
|
|
export default class Cinemas extends wepy.page {
|
|
|
config = {
|
|
|
navigationBarTitleText: '影片详情'
|
|
|
};
|
|
|
- components = {
|
|
|
- };
|
|
|
+ components = {};
|
|
|
data = {
|
|
|
top: 100,
|
|
|
- batch_id: null,
|
|
|
+ couponId: null,
|
|
|
usable_num: 0,
|
|
|
Data: null,
|
|
|
|
|
|
@@ -130,7 +129,7 @@ export default class Cinemas extends wepy.page {
|
|
|
loc: null,
|
|
|
regions: [], // 区们
|
|
|
region: '', // 当前区
|
|
|
- nav: ['定位中...','区域选择'],
|
|
|
+ nav: ['定位中...', '区域选择'],
|
|
|
curStatus: 0,
|
|
|
areaIndex: 0,
|
|
|
cinemas__nav__item: 'cinemas__nav__item',
|
|
|
@@ -146,281 +145,270 @@ export default class Cinemas extends wepy.page {
|
|
|
// 点击其它区域隐藏
|
|
|
handleClickScroller() {
|
|
|
if (this.curStatus == 0) return;
|
|
|
- this.curStatus = 0
|
|
|
- this.cinemas__nav__item = 'cinemas__nav__item'
|
|
|
+ this.curStatus = 0;
|
|
|
+ this.cinemas__nav__item = 'cinemas__nav__item';
|
|
|
}
|
|
|
// 点击弹层空白处消失
|
|
|
handleAreaContainerClick() {
|
|
|
// let target = e.target;
|
|
|
// if (e.tagName == 'Li') return;
|
|
|
- this.curStatus = 0
|
|
|
- this.cinemas__nav__item = 'cinemas__nav__item'
|
|
|
-
|
|
|
+ this.curStatus = 0;
|
|
|
+ this.cinemas__nav__item = 'cinemas__nav__item';
|
|
|
}
|
|
|
|
|
|
methods = {
|
|
|
- goToSelectCity(){
|
|
|
-
|
|
|
+ goToSelectCity() {
|
|
|
// if(!this.$parent.globalData.locateFail){
|
|
|
|
|
|
// }
|
|
|
|
|
|
- let subject_id = this.subject_id
|
|
|
+ let subject_id = this.subject_id;
|
|
|
// bind_cinemas==true 绑定影院
|
|
|
- let bind_cinema = !!this.Data ? this.Data.bind_cinema : false
|
|
|
- let batch_id = this.batch_id
|
|
|
+ let bind_cinema = !!this.Data ? this.Data.bind_cinema : false;
|
|
|
+ let couponId = this.couponId;
|
|
|
|
|
|
- let url = `/pages/locoation/locoation?subject_id=${subject_id}&bind_cinema=${bind_cinema}&batch_id=${batch_id}&loc=choose`
|
|
|
+ let url = `/pages/locoation/locoation?subject_id=${subject_id}&bind_cinema=${bind_cinema}&couponId=${couponId}&loc=choose`;
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
});
|
|
|
},
|
|
|
goToitem(e) {
|
|
|
- let batch_id = this.batch_id
|
|
|
- let subject_id = this.subject_id
|
|
|
- let cinema_id = e.target.dataset.cinema_id
|
|
|
- let usable_num = this.usable_num
|
|
|
- let subjectOnly = this.subjectOnly==0 ? `&subjectOnly=${this.subjectOnly}`: ''
|
|
|
- let url = `/pages/session/session?batch_id=${batch_id}&subject_id=${subject_id}&cinema_id=${cinema_id}&usable_num=${usable_num}${subjectOnly}`
|
|
|
+ let couponId = this.couponId;
|
|
|
+ let subject_id = this.subject_id;
|
|
|
+ let cinema_id = e.target.dataset.cinema_id;
|
|
|
+ let usable_num = this.usable_num;
|
|
|
+ let subjectOnly = this.subjectOnly == 0 ? `&subjectOnly=${this.subjectOnly}` : '';
|
|
|
+ let url = `/pages/session/session?couponId=${couponId}&subject_id=${subject_id}&cinema_id=${cinema_id}&usable_num=${usable_num}${subjectOnly}`;
|
|
|
wx.navigateTo({
|
|
|
url
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 简介
|
|
|
onOff(e) {
|
|
|
- if(e.target.dataset.suffix=='•••'){
|
|
|
+ if (e.target.dataset.suffix == '•••') {
|
|
|
// let i = parseInt(e.target.dataset.id.replace(/[^0-9]/ig,''))
|
|
|
- this.Data.subject_info.synopsisOnOff = !this.Data.subject_info.synopsisOnOff
|
|
|
+ this.Data.subject_info.synopsisOnOff = !this.Data.subject_info.synopsisOnOff;
|
|
|
}
|
|
|
},
|
|
|
- bindMore(){
|
|
|
- this.onMore = !this.onMore
|
|
|
+ bindMore() {
|
|
|
+ this.onMore = !this.onMore;
|
|
|
// this.forbiddenScroll = !this.forbiddenScroll
|
|
|
- if(!!this.onMore){
|
|
|
- this.scrollAnim = false
|
|
|
- this.scrollLeft = this.scrollLeft - 0.1
|
|
|
- } else{
|
|
|
- this.scrollAnim = true
|
|
|
- this.scrollLeft = this.scrollLeft + 0.1
|
|
|
+ if (!!this.onMore) {
|
|
|
+ this.scrollAnim = false;
|
|
|
+ this.scrollLeft = this.scrollLeft - 0.1;
|
|
|
+ } else {
|
|
|
+ this.scrollAnim = true;
|
|
|
+ this.scrollLeft = this.scrollLeft + 0.1;
|
|
|
}
|
|
|
- this.$apply()
|
|
|
+ this.$apply();
|
|
|
},
|
|
|
async tabClick(e) {
|
|
|
// 点击更多入口
|
|
|
- if(this.onMore){
|
|
|
- this.onMore=!this.onMore
|
|
|
+ if (this.onMore) {
|
|
|
+ this.onMore = !this.onMore;
|
|
|
setTimeout(() => {
|
|
|
wx.createSelectorQuery()
|
|
|
.select('.weui-bar__item_on')
|
|
|
- .boundingClientRect((rect)=>{
|
|
|
- let left = rect.left - this.sliderLeft
|
|
|
- this.sliderOffset = left<-2 ? -2 : left
|
|
|
- let scrollLeft = this.sliderOffset - (this.windowWidth/2-75 || 116.5)
|
|
|
- this.scrollLeft = scrollLeft<-2 ? 0 : scrollLeft
|
|
|
- this.$apply()
|
|
|
- }).exec()
|
|
|
- }, 200)
|
|
|
-
|
|
|
- } else{
|
|
|
- let left = e.currentTarget.offsetLeft - this.sliderLeft
|
|
|
- this.sliderOffset = left<-2 ? -2 : left
|
|
|
- let scrollLeft = this.sliderOffset - (this.windowWidth/2-75 || 116.5)
|
|
|
- this.scrollLeft = scrollLeft<-2 ? 0 : scrollLeft
|
|
|
+ .boundingClientRect(rect => {
|
|
|
+ let left = rect.left - this.sliderLeft;
|
|
|
+ this.sliderOffset = left < -2 ? -2 : left;
|
|
|
+ let scrollLeft = this.sliderOffset - (this.windowWidth / 2 - 75 || 116.5);
|
|
|
+ this.scrollLeft = scrollLeft < -2 ? 0 : scrollLeft;
|
|
|
+ this.$apply();
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ }, 200);
|
|
|
+ } else {
|
|
|
+ let left = e.currentTarget.offsetLeft - this.sliderLeft;
|
|
|
+ this.sliderOffset = left < -2 ? -2 : left;
|
|
|
+ let scrollLeft = this.sliderOffset - (this.windowWidth / 2 - 75 || 116.5);
|
|
|
+ this.scrollLeft = scrollLeft < -2 ? 0 : scrollLeft;
|
|
|
}
|
|
|
- this.activeIndex = e.currentTarget.id
|
|
|
-
|
|
|
- let id = e.currentTarget.id
|
|
|
- this.region = id==0 ? '' : this.regions[id]
|
|
|
- this.start = 0
|
|
|
- console.log('region::',this.region)
|
|
|
+ this.activeIndex = e.currentTarget.id;
|
|
|
+
|
|
|
+ let id = e.currentTarget.id;
|
|
|
+ this.region = id == 0 ? '' : this.regions[id];
|
|
|
+ this.start = 0;
|
|
|
+ console.log('region::', this.region);
|
|
|
|
|
|
let queryData = {
|
|
|
- batch_id: this.batch_id,
|
|
|
+ couponId: this.couponId,
|
|
|
subject_id: this.subject_id,
|
|
|
- region: id==0 ? '' : this.regions[id],
|
|
|
+ region: id == 0 ? '' : this.regions[id],
|
|
|
start: 0,
|
|
|
limit: 20,
|
|
|
+ city_id: this.loc.id,
|
|
|
...this.loc
|
|
|
+ };
|
|
|
+ let fetchData = await fetchCinemas(queryData);
|
|
|
+ this.total = fetchData.data.total;
|
|
|
+
|
|
|
+ console.log(queryData.limit, queryData.start, this.total, queryData.limit + queryData.start <= this.total);
|
|
|
+ if (queryData.limit + queryData.start <= this.total) {
|
|
|
+ this.isMax = false;
|
|
|
+ } else {
|
|
|
+ this.isMax = true;
|
|
|
}
|
|
|
- let fetchData = await fetchCinemas(queryData)
|
|
|
- this.total = fetchData.data.total
|
|
|
-
|
|
|
- console.log(
|
|
|
- queryData.limit,queryData.start,this.total,
|
|
|
- queryData.limit + queryData.start <= this.total
|
|
|
- )
|
|
|
- if(queryData.limit + queryData.start <= this.total){
|
|
|
- this.isMax = false
|
|
|
- } else{
|
|
|
- this.isMax = true
|
|
|
- }
|
|
|
- this.Data.cinemas = fetchData.data.cinemas
|
|
|
+ this.Data.cinemas = fetchData.data.cinemas;
|
|
|
// this.fetchData(0, 20)
|
|
|
- this.$apply()
|
|
|
- },
|
|
|
- }
|
|
|
+ this.$apply();
|
|
|
+ }
|
|
|
+ };
|
|
|
// 获取影院列表数据
|
|
|
- async fetchData(start, limit, show){
|
|
|
-
|
|
|
+ async fetchData(start, limit, show) {
|
|
|
let current_city = this.$parent.globalData.location.current_city,
|
|
|
choose_city = this.$parent.globalData.location.choose_city,
|
|
|
- choose_city1 = !!current_city ? {lat:current_city.lat, lng:current_city.lng, ...choose_city} : choose_city
|
|
|
-
|
|
|
- let locateFail = this.locateFail
|
|
|
+ choose_city1 = !!current_city ? { lat: current_city.lat, lng: current_city.lng, ...choose_city } : choose_city;
|
|
|
+
|
|
|
+ let locateFail = this.locateFail;
|
|
|
// console.log('choose_city::',choose_city)
|
|
|
|
|
|
- this.loc = choose_city ? choose_city1 : current_city
|
|
|
- this.nav[0] = !!this.loc ? this.loc.city : '城市选择'
|
|
|
+ this.loc = choose_city ? choose_city1 : current_city;
|
|
|
+ this.nav[0] = !!this.loc ? this.loc.city : '城市选择';
|
|
|
// console.log('locateFail::',locateFail !=null && !!locateFail, !!this.loc)
|
|
|
- if(locateFail !=null && !!locateFail){
|
|
|
- return
|
|
|
+ if (locateFail != null && !!locateFail) {
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
let data = {
|
|
|
- batch_id: this.batch_id,
|
|
|
+ couponId: this.couponId,
|
|
|
subject_id: this.subject_id,
|
|
|
subject_info: this.subject_info,
|
|
|
region: this.region,
|
|
|
start: start,
|
|
|
limit: limit,
|
|
|
+ city_id: this.loc.id,
|
|
|
...this.loc
|
|
|
- }
|
|
|
-
|
|
|
- let fetchData = await fetchCinemas(data)
|
|
|
+ };
|
|
|
|
|
|
- if(!!this.Data && !show){
|
|
|
- this.Data.cinemas = [
|
|
|
- ...this.Data.cinemas,
|
|
|
- ...fetchData.data.cinemas,
|
|
|
- ]
|
|
|
- } else{
|
|
|
- this.Data = fetchData.data
|
|
|
+ let fetchData = await fetchCinemas(data);
|
|
|
+
|
|
|
+ if (!!this.Data && !show) {
|
|
|
+ this.Data.cinemas = [...this.Data.cinemas, ...fetchData.data.cinemas];
|
|
|
+ } else {
|
|
|
+ this.Data = fetchData.data;
|
|
|
}
|
|
|
|
|
|
// 简介内容长度判断
|
|
|
- !!this.Data.subject_info.synopsis && (
|
|
|
+ !!this.Data.subject_info.synopsis &&
|
|
|
setTimeout(() => {
|
|
|
wx.createSelectorQuery()
|
|
|
.select('.movie__introduce')
|
|
|
- .boundingClientRect((rect)=>{
|
|
|
- this.Data.subject_info.synopsisLong = rect.height>=70 ? 1 : 0
|
|
|
- this.$apply()
|
|
|
- }).exec()
|
|
|
- }, 200)
|
|
|
- )
|
|
|
+ .boundingClientRect(rect => {
|
|
|
+ this.Data.subject_info.synopsisLong = rect.height >= 70 ? 1 : 0;
|
|
|
+ this.$apply();
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ }, 200);
|
|
|
// 滚动吸顶高度
|
|
|
- !!this.Data.subject_info && (setTimeout(() => {
|
|
|
- wx.createSelectorQuery()
|
|
|
- .select('.movieInfoBlock')
|
|
|
- .boundingClientRect((rect)=>{
|
|
|
- this.mobileDistance = rect.height + 20
|
|
|
- this.$apply()
|
|
|
- }).exec()
|
|
|
- }, 200))
|
|
|
-
|
|
|
- this.start = fetchData.data.start
|
|
|
- this.limit = fetchData.data.limit
|
|
|
- this.total = fetchData.data.total
|
|
|
-
|
|
|
- if(this.limit + this.start < this.total){
|
|
|
- this.isMax = false
|
|
|
- } else{
|
|
|
- this.isMax = true
|
|
|
+ !!this.Data.subject_info &&
|
|
|
+ setTimeout(() => {
|
|
|
+ wx.createSelectorQuery()
|
|
|
+ .select('.movieInfoBlock')
|
|
|
+ .boundingClientRect(rect => {
|
|
|
+ this.mobileDistance = rect.height + 20;
|
|
|
+ this.$apply();
|
|
|
+ })
|
|
|
+ .exec();
|
|
|
+ }, 200);
|
|
|
+
|
|
|
+ this.start = fetchData.data.start;
|
|
|
+ this.limit = fetchData.data.limit;
|
|
|
+ this.total = fetchData.data.total;
|
|
|
+
|
|
|
+ if (this.limit + this.start < this.total) {
|
|
|
+ this.isMax = false;
|
|
|
+ } else {
|
|
|
+ this.isMax = true;
|
|
|
}
|
|
|
- console.log(fetchData.data.regions)
|
|
|
- this.regions = fetchData.data.regions ? ['不限区域', ...fetchData.data.regions] : ['不限区域']
|
|
|
+ console.log(fetchData.data.regions);
|
|
|
+ this.regions = fetchData.data.regions ? ['不限区域', ...fetchData.data.regions] : ['不限区域'];
|
|
|
|
|
|
- let timestamp = Date.parse(new Date())
|
|
|
+ let timestamp = Date.parse(new Date());
|
|
|
// let expiration = timestamp + 6*1000
|
|
|
- let expiration = timestamp + 7200000
|
|
|
- wx.setStorageSync('data_location', this.curCity)
|
|
|
- wx.setStorageSync('data_location_expiration', expiration)
|
|
|
+ let expiration = timestamp + 7200000;
|
|
|
+ wx.setStorageSync('data_location', this.curCity);
|
|
|
+ wx.setStorageSync('data_location_expiration', expiration);
|
|
|
|
|
|
- this.$apply()
|
|
|
+ this.$apply();
|
|
|
}
|
|
|
async onLoad(options) {
|
|
|
- let timestamp = Date.parse(new Date())
|
|
|
- let expiration = wx.getStorageSync('data_location_expiration')
|
|
|
- let app_data = wx.getStorageSync('data_location')
|
|
|
+ let timestamp = Date.parse(new Date());
|
|
|
+ let expiration = wx.getStorageSync('data_location_expiration');
|
|
|
+ let app_data = wx.getStorageSync('data_location');
|
|
|
|
|
|
- this.batch_id = options.batch_id
|
|
|
- this.subject_id = options.subject_id
|
|
|
- this.subject_info = options.subject_info
|
|
|
- this.usable_num = options.usable_num
|
|
|
- this.subjectOnly = options.subjectOnly
|
|
|
-
|
|
|
- this.$apply()
|
|
|
+ this.couponId = options.couponId;
|
|
|
+ this.subject_id = options.subject_id;
|
|
|
+ this.subject_info = options.subject_info;
|
|
|
+ this.usable_num = options.usable_num;
|
|
|
+ this.subjectOnly = options.subjectOnly;
|
|
|
|
|
|
+ this.$apply();
|
|
|
}
|
|
|
- async onShow(){
|
|
|
- this.onMore = false
|
|
|
- this.scrollAnim = true
|
|
|
- if(this.$parent.globalData.loc == 'choose' && this.$parent.globalData.From == 'lockoation'){
|
|
|
- this.region = ''
|
|
|
- this.start = 0
|
|
|
- this.areaIndex = 0
|
|
|
- this.$apply()
|
|
|
+ async onShow() {
|
|
|
+ this.onMore = false;
|
|
|
+ this.scrollAnim = true;
|
|
|
+ if (this.$parent.globalData.loc == 'choose' && this.$parent.globalData.From == 'lockoation') {
|
|
|
+ this.region = '';
|
|
|
+ this.start = 0;
|
|
|
+ this.areaIndex = 0;
|
|
|
+ this.$apply();
|
|
|
}
|
|
|
- let choose_city = this.$parent.globalData.location.choose_city
|
|
|
+ let choose_city = this.$parent.globalData.location.choose_city;
|
|
|
let start = 0,
|
|
|
limit = this.limit,
|
|
|
- total = this.total
|
|
|
-
|
|
|
- let locateFail = this.locateFail = this.$parent.globalData.locateFail
|
|
|
+ total = this.total;
|
|
|
|
|
|
+ let locateFail = (this.locateFail = this.$parent.globalData.locateFail);
|
|
|
|
|
|
// 由排期页返回时不加载数据
|
|
|
- if(this.$parent.globalData.From != 'session'){
|
|
|
-
|
|
|
+ if (this.$parent.globalData.From != 'session') {
|
|
|
// 首页入口时-定位失败时
|
|
|
- if(locateFail !=null){
|
|
|
- this.fetchData(start, limit, 'show')
|
|
|
- return
|
|
|
+ if (locateFail != null) {
|
|
|
+ this.fetchData(start, limit, 'show');
|
|
|
+ return;
|
|
|
}
|
|
|
// 首页入口时-定位成功时
|
|
|
// !!this.$parent.globalData.location.current_city && this.fetchData(start, limit, 'show')
|
|
|
-
|
|
|
+
|
|
|
// 非首页入口时
|
|
|
- this.$parent.observable.on("location",
|
|
|
- async ()=>{
|
|
|
- this.fetchData(start, limit, 'show')
|
|
|
- })
|
|
|
+ this.$parent.observable.on('location', async () => {
|
|
|
+ this.fetchData(start, limit, 'show');
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
onPageScroll(e) {
|
|
|
if (e.scrollTop >= this.mobileDistance) {
|
|
|
- this.hasTop = true
|
|
|
- this.$apply()
|
|
|
- return
|
|
|
+ this.hasTop = true;
|
|
|
+ this.$apply();
|
|
|
+ return;
|
|
|
}
|
|
|
- this.hasTop = false
|
|
|
- this.$apply()
|
|
|
+ this.hasTop = false;
|
|
|
+ this.$apply();
|
|
|
}
|
|
|
// 上拉加载
|
|
|
async onReachBottom(e) {
|
|
|
- await this.lower(e)
|
|
|
+ await this.lower(e);
|
|
|
}
|
|
|
async lower(e) {
|
|
|
- if( !!this.lowerLoader || !!this.isMax || !this.Data.cinemas.length){
|
|
|
- return
|
|
|
+ if (!!this.lowerLoader || !!this.isMax || !this.Data.cinemas.length) {
|
|
|
+ return;
|
|
|
}
|
|
|
|
|
|
if (this.limit + this.start <= this.total) {
|
|
|
- await this.fetchData(this.limit + this.start, this.limit)
|
|
|
+ await this.fetchData(this.limit + this.start, this.limit);
|
|
|
// this.isMax = false
|
|
|
- this.lowerLoader = true
|
|
|
- }else{
|
|
|
- this.isMax = true
|
|
|
- this.lowerLoader = false
|
|
|
- return
|
|
|
+ this.lowerLoader = true;
|
|
|
+ } else {
|
|
|
+ this.isMax = true;
|
|
|
+ this.lowerLoader = false;
|
|
|
+ return;
|
|
|
}
|
|
|
// console.log('到底::',this.limit + this.start <= this.total, 'isMax::',this.isMax)
|
|
|
- setTimeout( () => {
|
|
|
- this.lowerLoader = false
|
|
|
- }, 100 )
|
|
|
- this.$apply()
|
|
|
-
|
|
|
+ setTimeout(() => {
|
|
|
+ this.lowerLoader = false;
|
|
|
+ }, 100);
|
|
|
+ this.$apply();
|
|
|
}
|
|
|
}
|
|
|
</script>
|