|
@@ -57,6 +57,8 @@ Page({
|
|
|
url: '/pages/tousujianyi/tousujianyi'
|
|
|
}
|
|
|
],
|
|
|
+ currentIndex:0,
|
|
|
+ noticeList:[],
|
|
|
// 活动信息
|
|
|
activity: {
|
|
|
title: '净水器活动',
|
|
@@ -66,7 +68,6 @@ Page({
|
|
|
},
|
|
|
|
|
|
onLoad() {
|
|
|
- // debugger;
|
|
|
let refresh= app.globalData.refresh;
|
|
|
if(refresh==1){
|
|
|
wx.showLoading({
|
|
@@ -77,7 +78,6 @@ Page({
|
|
|
return;
|
|
|
}
|
|
|
const _this = this;
|
|
|
- // debugger;
|
|
|
wx.request({
|
|
|
url: app.globalData.interfaceUrls.homePageInfo+app.globalData.currentAccountInfo.usernumber,
|
|
|
method: 'GET',
|
|
@@ -90,7 +90,11 @@ Page({
|
|
|
success (res) {
|
|
|
wx.hideLoading();
|
|
|
let apiReturnData=res.data;
|
|
|
- // debugger;
|
|
|
+ app.globalData.notices= apiReturnData.data.swNotificationAnnouncementDos;
|
|
|
+ let data= apiReturnData.data.swNotificationAnnouncementDos.filter(data=>{
|
|
|
+ return data.homepageslider=='1';
|
|
|
+ });
|
|
|
+
|
|
|
_this.setData({
|
|
|
billInfo:{
|
|
|
totalAmount:apiReturnData.data.duFees, // 总计应缴
|
|
@@ -102,6 +106,8 @@ Page({
|
|
|
accountNumber: apiReturnData.data.usernumber,
|
|
|
address: apiReturnData.data.address
|
|
|
},
|
|
|
+ noticeList :data,
|
|
|
+ isScrolling: true,
|
|
|
})
|
|
|
},
|
|
|
fail(error) {
|
|
@@ -206,17 +212,25 @@ Page({
|
|
|
},
|
|
|
|
|
|
startNoticeScroll: function() {
|
|
|
- const content = this.data.noticeList[this.data.currentIndex].content;
|
|
|
- const title = this.data.noticeList[this.data.currentIndex].title;
|
|
|
+ if(this.data.noticeList.length==0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let data= (this.data.noticeList||[]).filter(data=>{
|
|
|
+ return data.homepageslider=='1';
|
|
|
+ });
|
|
|
+
|
|
|
+ const content = data[this.data.currentIndex].scrollingcontent;
|
|
|
+ const title = data[this.data.currentIndex].noticetitle;
|
|
|
const duration = (title.length + content.length) * 0.3;
|
|
|
|
|
|
this.setData({
|
|
|
scrollDuration: duration,
|
|
|
- isScrolling: true
|
|
|
+ isScrolling: true,
|
|
|
});
|
|
|
},
|
|
|
|
|
|
onScrollComplete: function() {
|
|
|
+ debugger;
|
|
|
this.setData({
|
|
|
isScrolling: false
|
|
|
});
|