main
JING 10 months ago
parent 9766d8d03f
commit 5a0fb9e82c
  1. 18
      pages/index/index.vue
  2. 77
      pages/user/index.vue

@ -113,7 +113,7 @@
// adImg:'/static/img/index/banner.png', // adImg:'/static/img/index/banner.png',
// } // }
], ],
sceneList:[], //
specs_list:[],// specs_list:[],//
album_list:[],// album_list:[],//
cartoon_list:[],// cartoon_list:[],//
@ -133,8 +133,7 @@
var _this = this; var _this = this;
//banner //banner
_this.getBannerList(); _this.getBannerList();
//
_this.getSceneMenu();
// //
_this.getHotList(); _this.getHotList();
//1 //1
@ -189,20 +188,7 @@
_this.$user.session('app_config',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(){ getHotList(){

@ -66,7 +66,7 @@
<view class="datalist"> <view class="datalist">
<view class="picBox" @click="goTo('/pages/user/photo/detail')"> <!-- <view class="picBox" @click="goTo('/pages/user/photo/detail')">
<view class="p_left"> <view class="p_left">
<image class="p_bg" src="/static/img/user/pic_bg.png" mode="aspectFill"></image> <image class="p_bg" src="/static/img/user/pic_bg.png" mode="aspectFill"></image>
<image class="p_pic" src="/static/img/user/ing.png" mode="widthFix"></image> <image class="p_pic" src="/static/img/user/ing.png" mode="widthFix"></image>
@ -94,10 +94,10 @@
<image src="/static/img/index/right.png" mode="widthFix"></image> <image src="/static/img/index/right.png" mode="widthFix"></image>
</view> </view>
</view> </view>
</view> </view> -->
<view class="imgBox"> <!-- <view class="imgBox">
<view class="p_left"> <view class="p_left">
<image class="p_bg" src="/static/img/index/zj_icon.png" mode="aspectFill"></image> <image class="p_bg" src="/static/img/index/zj_icon.png" mode="aspectFill"></image>
<image class="p_pic" src="/static/img/user/ing.png" mode="widthFix"></image> <image class="p_pic" src="/static/img/user/ing.png" mode="widthFix"></image>
@ -127,6 +127,21 @@
<image src="/static/img/index/right.png" mode="widthFix"></image> <image src="/static/img/index/right.png" mode="widthFix"></image>
</view> </view>
</view> </view>
</view> -->
<view class="imgBox" v-for="(item,index) in dataList" :key="index">
<view class="p_left">
<image class="p_bg" src="/static/img/index/zj_icon.png" mode="aspectFill"></image>
</view>
<view class="p_center">
<view class="p_title">一寸照</view>
<view class="p_desc">25×35mm | 295×413px</view>
</view>
<view class="p_right">
<view class="distance">
<image src="/static/img/index/right.png" mode="widthFix"></image>
</view>
</view>
</view> </view>
@ -172,14 +187,19 @@ export default {
avatar:'/static/img/user/avatar.png', avatar:'/static/img/user/avatar.png',
nick_name:'点击登录', nick_name:'点击登录',
}, },
sceneList:[], //
tabList: [ tabList: [
{ {
type:1,
name: '证件照合成', name: '证件照合成',
}, { }, {
type:2,
name: '证件照换色', name: '证件照换色',
}, { }, {
type:3,
name: 'AI写真' name: 'AI写真'
}, { }, {
type:4,
name: '卡通风格' name: '卡通风格'
} }
], ],
@ -187,6 +207,9 @@ export default {
// //
portraitList:[], portraitList:[],
//
page: 1,
dataList:[],
}; };
}, },
onPageScroll(e) { onPageScroll(e) {
@ -205,9 +228,17 @@ export default {
onShow() { onShow() {
var _this =this; var _this =this;
_this.getUserInfo(); _this.getUserInfo();
//
//_this.getSceneMenu();
// //
_this.getPortraitList(); _this.getPortraitList();
},
onReachBottom () {
this.page++;
this.loadDataList();
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
@ -282,6 +313,46 @@ export default {
var _this =this; var _this =this;
console.log(e); console.log(e);
_this.current = e.index; _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(){ getPortraitList(){

Loading…
Cancel
Save