|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
<view class="bannerBox"> |
|
|
|
|
<u-swiper |
|
|
|
|
:list="banner" |
|
|
|
|
keyName="adImg" |
|
|
|
|
keyName="image" |
|
|
|
|
:showTitle="false" |
|
|
|
|
:autoplay="true" |
|
|
|
|
circular |
|
|
|
@ -187,11 +187,12 @@ |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
banner: [ |
|
|
|
|
{ |
|
|
|
|
adImg:'/static/img/index/banner.png', |
|
|
|
|
} |
|
|
|
|
// { |
|
|
|
|
// adImg:'/static/img/index/banner.png', |
|
|
|
|
// } |
|
|
|
|
], |
|
|
|
|
notice:'', |
|
|
|
|
sceneList:[], //场景 |
|
|
|
|
hotList:[],//热门 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed:{ |
|
|
|
@ -199,8 +200,12 @@ |
|
|
|
|
}, |
|
|
|
|
onLoad() { |
|
|
|
|
var _this = this; |
|
|
|
|
//首页信息 |
|
|
|
|
_this.getHomeInfo(); |
|
|
|
|
//banner信息 |
|
|
|
|
_this.getBannerList(); |
|
|
|
|
//场景信息 |
|
|
|
|
_this.getSceneMenu(); |
|
|
|
|
//热门 |
|
|
|
|
_this.getHotList(); |
|
|
|
|
//延时1秒请求,保证成功 |
|
|
|
|
setTimeout(function(res){ |
|
|
|
|
_this.getUploadConfig(); |
|
|
|
@ -227,31 +232,58 @@ |
|
|
|
|
url: url, |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//获取门店信息 |
|
|
|
|
getHomeInfo(){ |
|
|
|
|
//获取banner信息 |
|
|
|
|
getBannerList(){ |
|
|
|
|
var _this =this; |
|
|
|
|
//post 请求例子 |
|
|
|
|
/* _this.$api.post('ycl/home', {},function(res){ |
|
|
|
|
console.log(res); |
|
|
|
|
var d = res; |
|
|
|
|
var banner = d.adList |
|
|
|
|
banner.forEach((item, index) => { |
|
|
|
|
item.title = item.adName; |
|
|
|
|
}) |
|
|
|
|
_this.banner = banner; |
|
|
|
|
_this.notice = d.notice; |
|
|
|
|
_this.$user.session('servicePhone',d.servicePhone); |
|
|
|
|
}); */ |
|
|
|
|
_this.$api.get('api/home/banner/list', {},function(res){ |
|
|
|
|
console.log('banner原始',res); |
|
|
|
|
var banner = res; |
|
|
|
|
banner.forEach((item, index) => { |
|
|
|
|
banner[index].image = _this.$api.ossurl(item.image); |
|
|
|
|
}); |
|
|
|
|
console.log('banner修正',banner); |
|
|
|
|
_this.banner = banner; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//获取上传配置并缓存 |
|
|
|
|
getUploadConfig(){ |
|
|
|
|
var _this = this; |
|
|
|
|
var post = {}; |
|
|
|
|
_this.$api.get('/api/fileDeploy', post,function(res){ |
|
|
|
|
_this.$api.get('api/fileDeploy', post,function(res){ |
|
|
|
|
console.log(res); |
|
|
|
|
_this.$user.session('app_config',res); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//合照场景 |
|
|
|
|
getSceneMenu(){ |
|
|
|
|
var _this =this; |
|
|
|
|
_this.$api.get('api/photo/scene_list', {},function(res){ |
|
|
|
|
console.log('场景原始',res); |
|
|
|
|
var sceneList = res; |
|
|
|
|
sceneList.forEach((item, index) => { |
|
|
|
|
sceneList[index].image = _this.$api.ossurl(item.image); |
|
|
|
|
}); |
|
|
|
|
console.log('场景修正',sceneList); |
|
|
|
|
_this.sceneList = sceneList; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
//合照热门 |
|
|
|
|
getHotList(){ |
|
|
|
|
var _this =this; |
|
|
|
|
_this.$api.get('api/photo/hot_list', {},function(res){ |
|
|
|
|
console.log('热门原始',res); |
|
|
|
|
var hotList = res; |
|
|
|
|
hotList.forEach((item, index) => { |
|
|
|
|
hotList[index].image = _this.$api.ossurl(item.image); |
|
|
|
|
}); |
|
|
|
|
console.log('热门修正',hotList); |
|
|
|
|
_this.hotList = hotList; |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//滚动监控 |
|
|
|
|