目前系统还未存入您的面部档案信息,
+请先前往创建需要生成写真的面部档案
+创建成功后再次生成
`, + style: { + // 字符串的形式 + + p: 'font-weight: 400;font-size: 28rpx;color: #555555;line-height: 60rpx;', + + }, + + //选择面部档案 + selectList:[], + selectIndex:0,//默认选第一个 + show_btn:false, + + + photo_list: [ 'https://img30.360buyimg.com/sku/jfs/t1/221254/4/39390/74349/661e039aF46114279/48532008a0001dd0.jpg', @@ -116,19 +148,26 @@ has_face : 1 ,//是否已有模板 及数量 show_3:false, show_2:false, - show_btn:false, + face_list :[], select_index:0, select_id:'' } }, - - mounted() { - - }, - onLoad() { - this.getFace() + onLoad(option) { + //数据 + var _this =this; + var id = option.id; + if(_this.$com.isNull(id)) + { + uni.navigateBack({ + delta:1, + }) + } + _this.album_id = id; + _this.geAlbumtDetail(); + //_this.getFace() }, onShow() { @@ -157,9 +196,113 @@ selectThis(index,id){ this.select_id = id; this.select_index = index; - } - + }, + geAlbumtDetail() + { + var _this =this; + var post = { + id:_this.album_id, + }; + _this.$api.get('api/album/details',post,function(rs){ + console.log(rs); + var Data = rs; + Data.face = _this.$api.ossurl(Data.face); + var back_image = Data.back_image; + back_image.forEach((item, index) => { + back_image[index] = _this.$api.ossurl(item); + }); + Data.back_image = back_image; + _this.album = Data; + _this.show_btn = true; + }); + }, + checkHave() + { + var _this =this; + _this.getPortraitList(); + }, + //获取面部档案 + getPortraitList(){ + var _this =this; + var post = {}; + _this.$api.get('api/portrait/list', post, function(res) { + + var d = res; + console.log(d); + if(d.length == 0) + { + _this.tips_show = true; + } + else + { + var selectList = d; + selectList.forEach((item, index) => { + selectList[index].model_image = item.model_image ? _this.$api.ossurl(item.model_image): '/static/img/index/p_bg.png'; + selectList[index].model_image_thumbnail = item.model_image_thumbnail ? _this.$api.ossurl(item.model_image_thumbnail) : '/static/img/index/p_bg.png'; + }); + _this.selectList = selectList; + _this.selectIndex = 0; + _this.select_show = true; + } + }); + }, + //选择面部档案 + selectPortrait(index,item) + { + var _this =this; + if(item.status == 3) + { + _this.selectIndex = index; + } + }, + open(key) { + console.log('open',key); + }, + close(key) { + var _this = this; + _this[key] = false; + + }, + //自定义 确认 + submit(key){ + var _this =this; + + switch(key) + { + //显示提示信息 跳转到创建面部档案 + case 'tips_show': + _this.close(key); + uni.navigateTo({ + url:'/pagesA/merge/face_1' + }); + break; + //选择面部档案 跳转到选择模板信息 + case 'select_show': + _this.portrait_id = _this.selectList[_this.selectIndex].id; + _this.close(key); + var album_id = _this.album_id; + var portrait_id = _this.portrait_id; + var post = { + album_id:album_id, + portrait_id:portrait_id, + }; + _this.$com.showLoading('保存图片中'); + _this.$api.post('api/album/append', post,function(rs){ + console.log(rs); + _this.$com.hideLoading(); + uni.navigateTo({ + url:"/pagesA/merge/success" + }); + + }); + break; + + } + + + + }, } } @@ -167,4 +310,96 @@ \ No newline at end of file