diff --git a/pages/index/index.vue b/pages/index/index.vue index d09ae94..0313a62 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -113,7 +113,7 @@ // adImg:'/static/img/index/banner.png', // } ], - sceneList:[], //场景 + specs_list:[],//证件 album_list:[],//写真 cartoon_list:[],//卡通 @@ -133,8 +133,7 @@ var _this = this; //banner信息 _this.getBannerList(); - //场景信息 - _this.getSceneMenu(); + //热门 _this.getHotList(); //延时1秒请求,保证成功 @@ -189,20 +188,7 @@ _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(){ diff --git a/pages/user/index.vue b/pages/user/index.vue index 262e3a2..aa6e48c 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -66,7 +66,7 @@ - + - + + + + + + + + 一寸照 + 25×35mm | 295×413px + + + + + + + @@ -172,21 +187,29 @@ export default { avatar:'/static/img/user/avatar.png', nick_name:'点击登录', }, + sceneList:[], //场景 tabList: [ { + type:1, name: '证件照合成', }, { + type:2, name: '证件照换色', }, { + type:3, name: 'AI写真' }, { + type:4, name: '卡通风格' } ], current:0, //档案 - portraitList:[], + portraitList:[], + //分页 + page: 1, + dataList:[], }; }, onPageScroll(e) { @@ -205,9 +228,17 @@ export default { onShow() { var _this =this; _this.getUserInfo(); + //场景信息 + //_this.getSceneMenu(); //面部档案 _this.getPortraitList(); + }, + onReachBottom () { + + this.page++; + this.loadDataList(); + }, onShareAppMessage() { return { @@ -282,6 +313,46 @@ export default { var _this =this; console.log(e); _this.current = e.index; + var type = _this.tabList[_this.current].type; + switch(type) + { + case 1: + _this.loadDataList('api/photo_synthesis/list'); + break; + case 2: + _this.loadDataList('/api/photo_back_color/list'); + break; + case 3: + + break; + case 4: + + break; + } + }, + loadDataList(url) + { + var _this = this; + var post = {page:_this.page,limit:10}; + _this.$api.post(url, post, function(res) { + //console.log(res); + var d = res; + _this.dataList = _this.dataList.concat(d.data); + + }); + }, + //合照场景 + 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].name = item.title; + }); + _this.tabList = sceneList; + + }); }, //档案 getPortraitList(){