main
JING 8 months ago
parent 9766d8d03f
commit 5a0fb9e82c
  1. 20
      pages/index/index.vue
  2. 81
      pages/user/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(){

@ -66,7 +66,7 @@
<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">
<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>
@ -94,10 +94,10 @@
<image src="/static/img/index/right.png" mode="widthFix"></image>
</view>
</view>
</view>
</view> -->
<view class="imgBox">
<!-- <view class="imgBox">
<view class="p_left">
<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>
@ -127,7 +127,22 @@
<image src="/static/img/index/right.png" mode="widthFix"></image>
</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,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(){

Loading…
Cancel
Save