|
@@ -216,6 +216,11 @@
|
|
|
}
|
|
|
this.updataLable();
|
|
|
},
|
|
|
+ customizedRecordId(newVal) {
|
|
|
+ if (newVal != null) {
|
|
|
+ this.getIdData();
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
filters:{
|
|
|
// spaceTypeFilter(type){
|
|
@@ -276,6 +281,9 @@
|
|
|
},
|
|
|
userId() {
|
|
|
return this.$store.state.userId;
|
|
|
+ },
|
|
|
+ customizedRecordId() {
|
|
|
+ return this.$store.state.customizedRecordId;
|
|
|
},
|
|
|
},
|
|
|
methods:{
|
|
@@ -1073,38 +1081,29 @@
|
|
|
submit() {
|
|
|
this.spaceAIHandle();
|
|
|
setTimeout(()=>{
|
|
|
- this.resultDataHandle();
|
|
|
+ if(this.customizedRecordId){//修改
|
|
|
+ this.updateHandle();
|
|
|
+ }else{//完全新增
|
|
|
+ this.resultDataHandle();
|
|
|
+ }
|
|
|
},200)
|
|
|
- //三个题都存在,则是完整的前测
|
|
|
- // if(this.queryObj && this.queryObj.id2 && this.queryObj.id3){
|
|
|
- // setTimeout(()=>{
|
|
|
- // this.resultDataHandle();
|
|
|
- // },200)
|
|
|
- // }else{
|
|
|
- // MessageBox.confirm('',{
|
|
|
- // title: '提示',
|
|
|
- // message: '感谢您的参与',
|
|
|
- // showCancelButton: true,
|
|
|
- // confirmButtonText:'返回首页',
|
|
|
- // cancelButtonText:'确认',
|
|
|
- // }).then(action => {
|
|
|
- // console.warn("***MessageBox-action***",action)
|
|
|
- // if(action == 'confirm'){
|
|
|
- // if(window.__wxjs_environment === 'miniprogram'){
|
|
|
- // this.pvCloseHandle();//小程序跳转会主动杀死关闭当前页面-不经过vue跳转关闭逻辑-所以需要主动触发关闭埋点
|
|
|
- // wx.miniProgram.redirectTo({url: '/pages/index/index?houseId='+this.houseId})
|
|
|
- // }else{
|
|
|
- // // this.$message.warning("敬请期待");
|
|
|
- // // this.showPop();
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }).catch(err=>{
|
|
|
- // console.warn("***MessageBox-err***",err)
|
|
|
- // if(err == 'cancel'){
|
|
|
- // // self.cancelHandle();
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
+ },
|
|
|
+ //获取作品信息
|
|
|
+ async getIdData(){
|
|
|
+ let userId = this.userId || '';
|
|
|
+ let params = {
|
|
|
+ id: this.customizedRecordId,
|
|
|
+ brandId: $config.brandId,
|
|
|
+ houseId: this.houseId,
|
|
|
+ userId,
|
|
|
+ type:'QIANCE',
|
|
|
+ };
|
|
|
+ const res = await requestConfig('getCustomizedRecord', params);
|
|
|
+ if (res.success && res.list && res.list[0]) {
|
|
|
+ let single = res.list[0];
|
|
|
+ this.form = single;
|
|
|
+ // this.hardboundEffect = this.form.layoutImgCustomized? [this.form.layoutImgCustomized] : [];//赋值轮播图
|
|
|
+ }
|
|
|
},
|
|
|
//提交结果数据处理
|
|
|
async resultDataHandle(){
|
|
@@ -1149,6 +1148,10 @@
|
|
|
}
|
|
|
expand.push(_dt);
|
|
|
})
|
|
|
+ let mainImage = '';
|
|
|
+ if(thirdData && thirdData.length>0){
|
|
|
+ mainImage = thirdData[1] ? thirdData[1].hardboundEffect[0] : thirdData[0].hardboundEffect[0];
|
|
|
+ }
|
|
|
houseData.houseJson = spaceList.concat(thirdData);
|
|
|
// houseData.expand = expand;
|
|
|
let param = {
|
|
@@ -1162,6 +1165,7 @@
|
|
|
layoutStruct:[houseData],
|
|
|
type:'QIANCE',
|
|
|
expand:JSON.stringify(expand),
|
|
|
+ mainImage:mainImage,
|
|
|
}
|
|
|
if(this.landDataId){
|
|
|
param.landDataId = this.landDataId;
|
|
@@ -1190,6 +1194,74 @@
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
+ //修改结果数据处理
|
|
|
+ async updateHandle(){
|
|
|
+ // let firstData = JSON.parse(getStorage('firstData'));
|
|
|
+ // let secondData = JSON.parse(getStorage('secondData'));
|
|
|
+ // let thirdData = JSON.parse(getStorage('thirdData'));
|
|
|
+ let curHouseObj = JSON.parse(getStorage('curHouseObj'));
|
|
|
+ let spaceList = JSON.parse(getStorage('spaceList'));
|
|
|
+ let shottingImg = getStorage('shottingImg');
|
|
|
+ let expand = [];//扩展数据
|
|
|
+ let checkIndexList = [];
|
|
|
+ let otherlist = [];
|
|
|
+ let userId = this.userId ? this.userId : '';
|
|
|
+ let houseData = {
|
|
|
+ "layoutId": curHouseObj.id,
|
|
|
+ "layoutName": curHouseObj.name,
|
|
|
+ "layoutArea": curHouseObj.houseArea,
|
|
|
+ "floor": 1,
|
|
|
+ "layoutImgCustomized": shottingImg,
|
|
|
+ "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.expand = expand;
|
|
|
+ let param = {
|
|
|
+ "brandId": $config.brandId,
|
|
|
+ "houseId": this.houseId || curHouseObj.houseId,
|
|
|
+ "userId": userId,
|
|
|
+ "floot": 1,
|
|
|
+ "spaceName": curHouseObj.name,
|
|
|
+ "spaceStructure": '',
|
|
|
+ "curFloor":1,
|
|
|
+ layoutStruct:[houseData],
|
|
|
+ type:'QIANCE',
|
|
|
+ expand:this.form.expand,
|
|
|
+ // mainImage:this.form.mainImage,
|
|
|
+ }
|
|
|
+ if(this.landDataId){
|
|
|
+ param.landDataId = this.landDataId;
|
|
|
+ }
|
|
|
+ if(this.houseName){
|
|
|
+ param.houseName = this.houseName;
|
|
|
+ }
|
|
|
+ console.warn("submitHouse-update-param: ", param);
|
|
|
+ // setStorage('envData',checkIndexList);
|
|
|
+ const loading = this.$loading({
|
|
|
+ lock: true,
|
|
|
+ text: '提交中...',
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
+ });
|
|
|
+ let res = await requestConfig("saveCustomizedRecord", param);
|
|
|
+ loading.close();
|
|
|
+ if(res && res.success && res.single){//提交成功
|
|
|
+ let data = {
|
|
|
+ houseId:this.houseId || curHouseObj.houseId,
|
|
|
+ id:res.single,
|
|
|
+ }
|
|
|
+ router.push({
|
|
|
+ name: "webgl_rxdz_text_customize",
|
|
|
+ query:data
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
showToast(title,time=3000){
|
|
|
this.myloading = false;
|