优化代码
This commit is contained in:
+24
-8
@@ -94,20 +94,34 @@
|
||||
// 初始化左右盒子高度
|
||||
"leftH": 0,
|
||||
"rightH": 0,
|
||||
'tip': '',
|
||||
'swiper': '',
|
||||
'pics': ''
|
||||
tip: {},
|
||||
swiper: {
|
||||
background: [],
|
||||
indicatorDots: true,
|
||||
autoplay: true,
|
||||
interval: 2000,
|
||||
duration: 500,
|
||||
vertical: false,
|
||||
circular: true
|
||||
},
|
||||
pics:[]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
const app = getApp();
|
||||
const gData = app.globalData;
|
||||
this.getDataByOnline();
|
||||
this.tip = gData.homePageData.tip;
|
||||
this.swiper = gData.homePageData.swiper;
|
||||
this.pics = gData.homePageData.pics;
|
||||
this.showPics();
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
const that = this;
|
||||
this.leftList = [];
|
||||
this.rightList = [];
|
||||
this.tip = {};
|
||||
this.swiper = {};
|
||||
//this.swiper = {};
|
||||
this.pics = '';
|
||||
setTimeout(function() {
|
||||
that.getDataByOnline();
|
||||
@@ -128,14 +142,15 @@
|
||||
methods: {
|
||||
getDataByOnline() {
|
||||
const that = this;
|
||||
uni.request({
|
||||
//console.log("tip:",this.tip);
|
||||
/*uni.request({
|
||||
url: 'https://www.lailab.cn/miniprogram/data.php?type=all',
|
||||
success(rst) {
|
||||
that.tip = rst.data.tip;
|
||||
that.swiper = rst.data.swiper;
|
||||
that.showPics();
|
||||
},
|
||||
});
|
||||
});*/
|
||||
},
|
||||
doList() {
|
||||
const that = this;
|
||||
@@ -179,7 +194,7 @@
|
||||
},
|
||||
showPics() {
|
||||
const that = this;
|
||||
uni.request({
|
||||
/*uni.request({
|
||||
url: "https://www.lailab.cn/miniprogram/pics.php?page=" + that.picPage + "&size=" + that
|
||||
.picSize,
|
||||
success(rst) {
|
||||
@@ -187,7 +202,8 @@
|
||||
that.pics = rst.data;
|
||||
that.doList();
|
||||
}
|
||||
})
|
||||
})*/
|
||||
that.doList()
|
||||
},
|
||||
showImg(pic) {
|
||||
uni.navigateTo({
|
||||
|
||||
Reference in New Issue
Block a user