|
@@ -491,35 +491,35 @@
|
|
|
},
|
|
|
|
|
|
//点赞喜欢
|
|
|
- changeAIImg() {
|
|
|
- // let lastPage = getCurrentPages()[getCurrentPages().length - 2] ? getCurrentPages()[getCurrentPages().length - 2].$vm : null;
|
|
|
- this.checked = !this.checked;//变更选项
|
|
|
- this.aiImagesList[this.currentIndex].checked = this.checked;
|
|
|
- console.warn("***changeAIImg***",this.checked,this.aiData)
|
|
|
- // if(this.aiData){//给上一个页面回传生成的数据
|
|
|
- // let space = this.aiData.find(it=>{
|
|
|
- // return it.spaceId == this.spaceObj.spaceId
|
|
|
- // })
|
|
|
- // if(space){
|
|
|
- // space.aiImagesList[this.currentIndex].checked = this.checked;
|
|
|
- // }
|
|
|
- // }
|
|
|
- if(this.checked){
|
|
|
- let param = {
|
|
|
- type: 'CLK', //埋点类型
|
|
|
- clkId: 'clk_2cmina_23080418', //点击ID
|
|
|
- clkName: 'chooseprogramme_clk', //点击前往的页面名称
|
|
|
- behaviorName:"点赞喜欢",
|
|
|
- clkParams: {
|
|
|
- locusName: "选定风格/视角",
|
|
|
- style:this.styleList[this.curStyleIndex].styleName,
|
|
|
- img:this.aiImagesList[this.currentIndex].image,
|
|
|
- locusValue:this.aiImagesList[this.currentIndex].image,
|
|
|
- }
|
|
|
- };
|
|
|
- util.trackRequest(param);
|
|
|
- }
|
|
|
- },
|
|
|
+ // changeAIImg() {
|
|
|
+ // // let lastPage = getCurrentPages()[getCurrentPages().length - 2] ? getCurrentPages()[getCurrentPages().length - 2].$vm : null;
|
|
|
+ // this.checked = !this.checked;//变更选项
|
|
|
+ // this.aiImagesList[this.currentIndex].checked = this.checked;
|
|
|
+ // console.warn("***changeAIImg***",this.checked,this.aiData)
|
|
|
+ // // if(this.aiData){//给上一个页面回传生成的数据
|
|
|
+ // // let space = this.aiData.find(it=>{
|
|
|
+ // // return it.spaceId == this.spaceObj.spaceId
|
|
|
+ // // })
|
|
|
+ // // if(space){
|
|
|
+ // // space.aiImagesList[this.currentIndex].checked = this.checked;
|
|
|
+ // // }
|
|
|
+ // // }
|
|
|
+ // if(this.checked){
|
|
|
+ // let param = {
|
|
|
+ // type: 'CLK', //埋点类型
|
|
|
+ // clkId: 'clk_2cmina_23080418', //点击ID
|
|
|
+ // clkName: 'chooseprogramme_clk', //点击前往的页面名称
|
|
|
+ // behaviorName:"点赞喜欢",
|
|
|
+ // clkParams: {
|
|
|
+ // locusName: "选定风格/视角",
|
|
|
+ // style:this.styleList[this.curStyleIndex].styleName,
|
|
|
+ // img:this.aiImagesList[this.currentIndex].image,
|
|
|
+ // locusValue:this.aiImagesList[this.currentIndex].image,
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+ // util.trackRequest(param);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
rightScroll(){//右滑
|
|
|
if(this.currentIndex <= (this.aiImagesList.length - 1) && this.currentIndex > 0){
|
|
|
// this.currentIndex --;
|
|
@@ -578,12 +578,17 @@
|
|
|
//获取AI风格列表
|
|
|
async getAiBeautyFamily() {
|
|
|
// const spaceName = this.spaceTypes[this.spaceObj.spaceType - 1].title;
|
|
|
- let res = await requestConfig("getHardboundEffects", {
|
|
|
+ let params = {
|
|
|
// "houseId": this.$route.query.houseId || this.$store.state.houseId,
|
|
|
// "spaceType": this.spaceObj.layoutSpaceType || this.spaceObj.spaceType,
|
|
|
"spaceType": 2,
|
|
|
- "spaceName": this.spaceObj.layoutSpaceName || this.spaceObj.spaceName,
|
|
|
- });
|
|
|
+ "spaceName": this.spaceObj.layoutSpaceName || this.spaceObj.spaceName,
|
|
|
+ // "spaceName": spaceTypes[this.spaceObj.spaceType - 1] || this.spaceObj.layoutSpaceName || this.spaceObj.spaceName,
|
|
|
+ }
|
|
|
+ // if(params.spaceName == "自定义"){
|
|
|
+ // params.spaceName = this.spaceObj.spaceName
|
|
|
+ // }
|
|
|
+ let res = await requestConfig("getHardboundEffects",params);
|
|
|
this.styleList = [];
|
|
|
// alert("***getAiBeautyFamily-res***"+JSON.stringify(res))
|
|
|
if (res.success) {
|
|
@@ -617,6 +622,7 @@
|
|
|
async aiSubmit(type) {
|
|
|
if(!this.styleList || this.styleList.length==0 || this.curStyleIndex==-1
|
|
|
|| !this.styleList[this.curStyleIndex].prompt || !this.styleList[this.curStyleIndex].negativePrompt){
|
|
|
+ console.warn('aiSubmit-没有提示词不能生图:', this.styleList)
|
|
|
return false;
|
|
|
}
|
|
|
// 防止连续点击处理
|
|
@@ -1094,7 +1100,7 @@
|
|
|
let aiStyleName = this.styleList[this.curStyleIndex].styleName;
|
|
|
let _data = {
|
|
|
image:newImage,
|
|
|
- checked:false,
|
|
|
+ checked:true,
|
|
|
list:[newImage],
|
|
|
spaceId:this.curSpaceId,//记录下当前生成的AI图是哪个空间的,因为会切换空间
|
|
|
styleIndex:this.curStyleIndex,//记录下当前生成的AI图是哪个风格的
|
|
@@ -1123,7 +1129,35 @@
|
|
|
}
|
|
|
};
|
|
|
util.trackRequest(param);
|
|
|
+ this.insertDataToLayoutStruct(_data);
|
|
|
},
|
|
|
+ insertDataToLayoutStruct(_data){
|
|
|
+ console.warn("***insertDataToLayoutStruct***",_data)
|
|
|
+ let curHouseObj = this.$parent.curHouseObj;//当前户型数据对象
|
|
|
+ let wallList = this.$parent.wallList;//当前户型墙体数据列表对象
|
|
|
+ let curLayoutStruct = JSON.parse(getStorage('curLayoutStruct')) ;//获取楼层的数据-户型数组
|
|
|
+ let layoutStruct = curLayoutStruct.find(it=>{
|
|
|
+ return it.id == curHouseObj.id
|
|
|
+ })
|
|
|
+ // layoutStruct.houseJson = str;
|
|
|
+ // layoutStruct.houseArea = this.sumArea;
|
|
|
+ let spaceList = JSON.parse(layoutStruct.houseJson);//houseJson是字符串需要序列号处理
|
|
|
+ let space = spaceList.find(space=>space.spaceId == _data.spaceId);//寻找AI生成图所在的空间
|
|
|
+ if(space){
|
|
|
+ if(space.hardboundEffect){
|
|
|
+ space.hardboundEffect.push(_data.image)
|
|
|
+ }else{
|
|
|
+ space.hardboundEffect = [_data.image];
|
|
|
+ }
|
|
|
+ //更新当前空间的墙体数据
|
|
|
+ let wall = wallList.find(it=>it.id==space.wallId);
|
|
|
+ if(wall){//找到当前空间的墙体数据
|
|
|
+ space.wallList = JSON.stringify(wall);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ layoutStruct.houseJson = JSON.stringify(spaceList);
|
|
|
+ setStorage('curLayoutStruct', curLayoutStruct);//把楼层的数据存入缓存中
|
|
|
+ },
|
|
|
//空间数据整理
|
|
|
spaceAIHandle(){
|
|
|
let curHouseObj = this.$parent.curHouseObj;//当前户型数据对象
|
|
@@ -1197,6 +1231,7 @@
|
|
|
let curHouseObj = JSON.parse(getStorage('curHouseObj'));
|
|
|
let spaceList = JSON.parse(getStorage('spaceList'));
|
|
|
let shottingImg = getStorage('shottingImg');
|
|
|
+ let curLayoutStruct = JSON.parse(getStorage('curLayoutStruct')) ;//获取楼层的数据-户型数组
|
|
|
let expand = [];//扩展数据
|
|
|
let checkIndexList = [];
|
|
|
let otherlist = [];
|
|
@@ -1245,11 +1280,30 @@
|
|
|
"spaceName": curHouseObj.name,
|
|
|
"spaceStructure": '',
|
|
|
"curFloor":1,
|
|
|
- layoutStruct:[houseData],
|
|
|
+ layoutStruct:[],
|
|
|
type:'QIANCE',
|
|
|
expand:JSON.stringify(expand),
|
|
|
mainImage:mainImage,
|
|
|
}
|
|
|
+ let seletcIndex = curLayoutStruct.findIndex(it=>it.id==curHouseObj.id);
|
|
|
+ //处理每一个楼层
|
|
|
+ curLayoutStruct.forEach((layoutStruct,index)=>{
|
|
|
+ let houseData1;
|
|
|
+ if(index==seletcIndex){
|
|
|
+ houseData1 = houseData
|
|
|
+ }else{
|
|
|
+ houseData1 = {
|
|
|
+ "layoutId": layoutStruct.id,
|
|
|
+ "layoutName": layoutStruct.name,
|
|
|
+ "layoutArea": layoutStruct.houseArea,
|
|
|
+ "floor": layoutStruct.houseFloor || (index+1),
|
|
|
+ "layoutImgCustomized": layoutStruct.shottingImg || shottingImg,
|
|
|
+ "style": layoutStruct.style || "",
|
|
|
+ "houseJson": JSON.parse(layoutStruct.houseJson),
|
|
|
+ };
|
|
|
+ }
|
|
|
+ param.layoutStruct.push(houseData1)
|
|
|
+ })
|
|
|
if(this.landDataId){
|
|
|
param.landDataId = this.landDataId;
|
|
|
}
|
|
@@ -1283,6 +1337,7 @@
|
|
|
// let firstData = JSON.parse(getStorage('firstData'));
|
|
|
// let secondData = JSON.parse(getStorage('secondData'));
|
|
|
// let thirdData = JSON.parse(getStorage('thirdData'));
|
|
|
+ let curLayoutStruct = JSON.parse(getStorage('curLayoutStruct')) ;//获取楼层的数据-户型数组
|
|
|
let curHouseObj = JSON.parse(getStorage('curHouseObj'));
|
|
|
let spaceList = JSON.parse(getStorage('spaceList'));
|
|
|
let shottingImg = getStorage('shottingImg');
|
|
@@ -1290,23 +1345,17 @@
|
|
|
let checkIndexList = [];
|
|
|
let otherlist = [];
|
|
|
let userId = this.userId ? this.userId : '';
|
|
|
- let houseData = {
|
|
|
- "layoutId": curHouseObj.id,
|
|
|
- "layoutName": this.form.layoutStruct[0].layoutName || curHouseObj.name,
|
|
|
- "layoutArea": this.form.layoutStruct[0].layoutArea || curHouseObj.houseArea,
|
|
|
- "floor": 1,
|
|
|
- "layoutImgCustomized": shottingImg,
|
|
|
- "style": this.form.layoutStruct[0].style || "",
|
|
|
- "houseJson": []
|
|
|
- }
|
|
|
-
|
|
|
- // let mainImage = '';
|
|
|
- // if(thirdData && thirdData.length>0){
|
|
|
- // mainImage = thirdData[1] ? thirdData[1].hardboundEffect[0] : thirdData[0].hardboundEffect[0];
|
|
|
- // }
|
|
|
- // houseData.houseJson = spaceList.concat(this.form.layoutStruct[0].houseJson);
|
|
|
- houseData.houseJson = this.form.layoutStruct[0].houseJson.concat(spaceList);
|
|
|
- // houseData.expand = expand;
|
|
|
+ //单层空间
|
|
|
+ // let houseData = {
|
|
|
+ // "layoutId": curHouseObj.id,
|
|
|
+ // "layoutName": this.form.layoutStruct[0].layoutName || curHouseObj.name,
|
|
|
+ // "layoutArea": this.form.layoutStruct[0].layoutArea || curHouseObj.houseArea,
|
|
|
+ // "floor": 1,
|
|
|
+ // "layoutImgCustomized": shottingImg,
|
|
|
+ // "style": this.form.layoutStruct[0].style || "",
|
|
|
+ // "houseJson": []
|
|
|
+ // }
|
|
|
+ // houseData.houseJson = this.form.layoutStruct[0].houseJson.concat(spaceList);
|
|
|
let param = {
|
|
|
id:this.customizedRecordId,
|
|
|
"brandId": $config.brandId,
|
|
@@ -1317,11 +1366,39 @@
|
|
|
"spaceName": curHouseObj.name,
|
|
|
"spaceStructure": '',
|
|
|
"curFloor":1,
|
|
|
- layoutStruct:[houseData],
|
|
|
+ layoutStruct:[],
|
|
|
type:'QIANCE',
|
|
|
expand:this.form.expand,
|
|
|
// mainImage:this.form.mainImage,
|
|
|
}
|
|
|
+ let seletcIndex = curLayoutStruct.findIndex(it=>it.id==curHouseObj.id);
|
|
|
+ //处理每一个楼层
|
|
|
+ curLayoutStruct.forEach((layoutStruct,index)=>{
|
|
|
+ let houseData1;
|
|
|
+ if(index==seletcIndex){
|
|
|
+ houseData1 = {
|
|
|
+ "layoutId": curHouseObj.id,
|
|
|
+ "layoutName": this.form.layoutStruct[0].layoutName || curHouseObj.name,
|
|
|
+ "layoutArea": this.form.layoutStruct[0].layoutArea || curHouseObj.houseArea,
|
|
|
+ "floor": (index+1),
|
|
|
+ "layoutImgCustomized": shottingImg,
|
|
|
+ "style": this.form.layoutStruct[0].style || "",
|
|
|
+ "houseJson": []
|
|
|
+ }
|
|
|
+ houseData1.houseJson = this.form.layoutStruct[0].houseJson.concat(spaceList);
|
|
|
+ }else{
|
|
|
+ houseData1 = {
|
|
|
+ "layoutId": layoutStruct.id,
|
|
|
+ "layoutName": layoutStruct.name,
|
|
|
+ "layoutArea": layoutStruct.houseArea,
|
|
|
+ "floor": layoutStruct.houseFloor || (index+1),
|
|
|
+ "layoutImgCustomized": layoutStruct.shottingImg || shottingImg,
|
|
|
+ "style": layoutStruct.style || "",
|
|
|
+ "houseJson": JSON.parse(layoutStruct.houseJson),
|
|
|
+ };
|
|
|
+ }
|
|
|
+ param.layoutStruct.push(houseData1)
|
|
|
+ })
|
|
|
if(this.landDataId){
|
|
|
param.landDataId = this.landDataId;
|
|
|
}
|