|
@@ -2,246 +2,201 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- const util = require('@/utils/util.js').default;
|
|
|
+ const util = require('@/utils/util.js').default;
|
|
|
const config = require('@/services/urlConfig.js');
|
|
|
import router from "@/router";
|
|
|
import touchHandle from '@/mixins/touchHandle.js';
|
|
|
import commonPageMethod from '@/mixins/commonPageMethod.js';
|
|
|
-// const app = getApp(); //获取应用实例
|
|
|
-// import requestConfig from '@/static/lib/requestConfig.js';
|
|
|
-// import commonPageMethod from '@/common/commonPageMethod.js';
|
|
|
-// import commonMethod from '@/common/commonMethod.js';
|
|
|
-export default {
|
|
|
- mixins: [touchHandle,commonPageMethod],
|
|
|
- /**
|
|
|
- * 页面的初始数据
|
|
|
- */
|
|
|
- data() {
|
|
|
- return {
|
|
|
- pvId: 'p_2cmina_21012301',
|
|
|
- locusBehaviorName: "角色偏好",
|
|
|
- locusValue: "",
|
|
|
- locusName: "",
|
|
|
- pvCurPageName: "submit_ret",
|
|
|
- pvCurPageParams: null,
|
|
|
- navbar: {
|
|
|
- showCapsule: 1,
|
|
|
- title: '角色偏好',
|
|
|
- titleColor: '#fff',
|
|
|
- navPadding: 0,
|
|
|
- navPaddingBg:'transparent',
|
|
|
- navBarColor: 'transparent',
|
|
|
- navBackColor: 'transparent',
|
|
|
- haveCallback: false, // 如果是 true 会接手 navbarBackClk
|
|
|
- fromShare: false,
|
|
|
- fromProject: 0,
|
|
|
- shareToken: "",
|
|
|
- pageName: this.pvCurPageName,
|
|
|
- },
|
|
|
- houseId: $config.houseIdHs,
|
|
|
+ // const app = getApp(); //获取应用实例
|
|
|
+ // import requestConfig from '@/static/lib/requestConfig.js';
|
|
|
+ // import commonPageMethod from '@/common/commonPageMethod.js';
|
|
|
+ // import commonMethod from '@/common/commonMethod.js';
|
|
|
+ export default {
|
|
|
+ mixins: [touchHandle, commonPageMethod],
|
|
|
+ /**
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ pvId: 'p_2cmina_21012301',
|
|
|
+ locusBehaviorName: "角色偏好",
|
|
|
+ locusValue: "",
|
|
|
+ locusName: "",
|
|
|
+ pvCurPageName: "role_set",
|
|
|
+ pvCurPageParams: null,
|
|
|
+ navbar: {
|
|
|
+ showCapsule: 1,
|
|
|
+ title: '角色偏好',
|
|
|
+ titleColor: '#fff',
|
|
|
+ navPadding: 0,
|
|
|
+ navPaddingBg: 'transparent',
|
|
|
+ navBarColor: 'transparent',
|
|
|
+ navBackColor: 'transparent',
|
|
|
+ haveCallback: false, // 如果是 true 会接手 navbarBackClk
|
|
|
+ fromShare: false,
|
|
|
+ fromProject: 0,
|
|
|
+ shareToken: "",
|
|
|
+ pageName: this.pvCurPageName,
|
|
|
+ },
|
|
|
+ houseId: $config.houseIdHs,
|
|
|
|
|
|
- shareUserId: null, // 分享者ID
|
|
|
- id: '',//方案库id
|
|
|
-
|
|
|
- currImgIdx:0,
|
|
|
- tabIndex: 0,
|
|
|
- // featureImgList: [],
|
|
|
- hardboundEffect: [],//当前swiper数据列表对象
|
|
|
- form: {},
|
|
|
- tabData:[],
|
|
|
- number: '',
|
|
|
- plotHeadDeafultImg: 'https://dm.static.elab-plus.com/mini-program/plotHeadDeafultImg.png', // 地块人物默认头像
|
|
|
- showPhoneModel:false,
|
|
|
- gsImage:'',
|
|
|
- layoutStruct:null,
|
|
|
- }
|
|
|
- },
|
|
|
- /**
|
|
|
- * 生命周期函数--监听页面加载
|
|
|
- */
|
|
|
- mounted(options) {
|
|
|
- console.log("***onLoad-webgl_rxdz_customize***", this.$route.query)
|
|
|
- const that = this;
|
|
|
- this.houseId = this.$route.query.houseId?this.$route.query.houseId:'';
|
|
|
- // this.spaceId = this.$route.query.spaceId?this.$route.query.spaceId:'';
|
|
|
- this.id = this.$route.query.id?this.$route.query.id:'6523d91af65c626211ee21c8';
|
|
|
- if(!this.id){
|
|
|
- this.showToast("没有数据!");
|
|
|
- return false;
|
|
|
- }else{
|
|
|
- this.getIdData();
|
|
|
- }
|
|
|
- },
|
|
|
- computed: {
|
|
|
- userId() {
|
|
|
- return this.$store.state.userId;
|
|
|
- },
|
|
|
- },
|
|
|
-
|
|
|
- methods: {
|
|
|
- swiperChangeImg(e){
|
|
|
- console.log("***swiperChangeImg***",e);
|
|
|
- this.currImgIdx = e.detail ? e.detail.current : e;
|
|
|
- this.gsImage = this.hardboundEffect[this.currImgIdx];//获取高斯模糊的图片
|
|
|
- },
|
|
|
- rightScroll(){//右滑
|
|
|
- if(this.currImgIdx <= (this.hardboundEffect.length - 1) && this.currImgIdx > 0){
|
|
|
- this.$refs.carousel.prev();
|
|
|
- }
|
|
|
- },
|
|
|
- leftScroll(){//继续生成
|
|
|
- if(this.currImgIdx != this.hardboundEffect.length - 1){
|
|
|
- if(this.currImgIdx<this.hardboundEffect.length - 1){
|
|
|
- this.$refs.carousel.next();
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- navigateFuc(){
|
|
|
- if(window.__wxjs_environment === 'miniprogram'){
|
|
|
- wx.miniProgram.navigateTo({url: '/pages/transfer/transfer?event=openCustomerServiceChat&houseId='+this.houseId})
|
|
|
- }else{
|
|
|
- this.$message.warning("敬请期待");
|
|
|
+ id: '', //方案库id
|
|
|
+ allSelect:false,//是否所有大类都选择了
|
|
|
+ currImgIdx: 0,
|
|
|
+ // featureImgList: [],
|
|
|
+ showPhoneModel: false,
|
|
|
+ tabIndex: 0, //当前在第几个tab
|
|
|
+ optionIndex: -1, //选项选中的序号
|
|
|
+ optionResponseList: [], //选项数据
|
|
|
+ roleList: [], //角色数据,单独
|
|
|
+ tabData: [{
|
|
|
+ id: 1,
|
|
|
+ fatherContent: '选择角色',
|
|
|
+ checkedIndex: -1, //当前选中的序号
|
|
|
+ subName: '选择你的人物角色',
|
|
|
+ optionResponseList: [{
|
|
|
+ id: 1,
|
|
|
+ text: '- 爱生活 -',
|
|
|
+ content: '角色',
|
|
|
+ imageUrl: 'https://dm.static.elab-plus.com/miniProgram/role/timg17.png',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id: 2,
|
|
|
+ text: '- 爱时尚 -',
|
|
|
+ content: '角色',
|
|
|
+ imageUrl: 'https://dm.static.elab-plus.com/miniProgram/role/demo2.jpg',
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ }],
|
|
|
}
|
|
|
},
|
|
|
- optionChange(){
|
|
|
- if(window.__wxjs_environment === 'miniprogram'){
|
|
|
- wx.miniProgram.redirectTo({url: '/pages/index/index?houseId='+$config.xcxHouseId})
|
|
|
- }else{
|
|
|
- this.$message.warning("敬请期待");
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ mounted(options) {
|
|
|
+ console.log("***onLoad-webgl_rxdz_customize***", this.$route.query)
|
|
|
+ const that = this;
|
|
|
+ this.houseId = this.$route.query.houseId ? this.$route.query.houseId : '';
|
|
|
+ // this.spaceId = this.$route.query.spaceId?this.$route.query.spaceId:'';
|
|
|
+ this.id = this.$route.query.id ? this.$route.query.id : '109';
|
|
|
+ this.roleList = this.tabData[0].optionResponseList; //单独获取角色数据
|
|
|
+ this.optionResponseList = this.tabData[0].optionResponseList; //单独获取角色数据
|
|
|
+ this.queryTestcaseSingle();
|
|
|
},
|
|
|
- tabDataHandle(expand){
|
|
|
- let tmp = expand;
|
|
|
- if(!tmp || !tmp.landImg || !tmp.baseImg){
|
|
|
- return false
|
|
|
- }
|
|
|
- let data = {
|
|
|
- name : "我的地块",
|
|
|
- imgUrl : tmp.landImg,
|
|
|
- hardboundEffect:[tmp.landImg],
|
|
|
- gsImage:tmp.landImg,
|
|
|
- area:'',
|
|
|
- }
|
|
|
- this.tabData.push(data);
|
|
|
- data = {
|
|
|
- name : "我的房子",
|
|
|
- imgUrl : tmp.baseImg,
|
|
|
- hardboundEffect:[tmp.baseImg,tmp.bgPrototypeImg],
|
|
|
- gsImage:tmp.baseImg,
|
|
|
- area:'',
|
|
|
- }
|
|
|
- this.tabData.push(data)
|
|
|
+ computed: {
|
|
|
+ userId() {
|
|
|
+ return this.$store.state.userId;
|
|
|
+ },
|
|
|
},
|
|
|
- async getIdData(){
|
|
|
- let userId = this.userId || '';
|
|
|
- let params = {
|
|
|
- id: this.id,
|
|
|
- brandId: $config.brandId,
|
|
|
- houseId:this.houseId,
|
|
|
- userId,
|
|
|
- };
|
|
|
- if(this.shareUserId){//分享时 不带用户id
|
|
|
- delete params.userId
|
|
|
- }
|
|
|
- // params.userId = this.userId;
|
|
|
- const res = await requestConfig('getCustomizedRecord', params);
|
|
|
- if (res.success ) {
|
|
|
- let single = res.list[0];
|
|
|
- this.tabIndex = 0;//表明是户型首图
|
|
|
- this.tabData = [];
|
|
|
- if(single.expand){
|
|
|
- single.expand = JSON.parse(single.expand);
|
|
|
- this.tabDataHandle(single.expand)
|
|
|
+
|
|
|
+ methods: {
|
|
|
+ swiperChangeImg(e) {
|
|
|
+ console.log("***swiperChangeImg***", e);
|
|
|
+ this.currImgIdx = e.detail ? e.detail.current : e;
|
|
|
+ // this.optionIndex = this.currImgIdx;
|
|
|
+ // this.tabData[0].checkedIndex = this.currImgIdx;
|
|
|
+ },
|
|
|
+ rightScroll() { //右滑
|
|
|
+ if (this.currImgIdx <= (this.roleList.length - 1) && this.currImgIdx > 0) {
|
|
|
+ this.$refs.carousel.prev();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ leftScroll() { //继续生成
|
|
|
+ if (this.currImgIdx != this.roleList.length - 1) {
|
|
|
+ if (this.currImgIdx < this.roleList.length - 1) {
|
|
|
+ this.$refs.carousel.next();
|
|
|
+ }
|
|
|
}
|
|
|
- this.layoutStruct = JSON.parse(JSON.stringify(single));
|
|
|
- // this.number = single.landCode
|
|
|
- this.form = single.layoutStruct.find(it=>it.floor==single.curFloor);
|
|
|
+ },
|
|
|
|
|
|
- this.hardboundEffect = this.form.layoutImgCustomized? [this.form.layoutImgCustomized] : [];//赋值轮播图
|
|
|
- let data = {
|
|
|
- name : this.form.layoutName,
|
|
|
- imgUrl : this.form.layoutImgCustomized,
|
|
|
- hardboundEffect:[this.form.layoutImgCustomized],
|
|
|
- gsImage:this.form.layoutImgCustomized,
|
|
|
- area:'',
|
|
|
+ async queryTestcaseSingle() {
|
|
|
+ let userId = this.userId || '';
|
|
|
+ let params = {
|
|
|
+ id: this.id,
|
|
|
+ brandId: $config.brandId,
|
|
|
+ houseId: this.houseId,
|
|
|
+ userId,
|
|
|
+ };
|
|
|
+ // params.userId = this.userId;
|
|
|
+ const res = await requestConfig('queryTestcaseSingle', params);
|
|
|
+ if (res.success) {
|
|
|
+ let single = res.single;
|
|
|
+ single.fullSubQuestionList.forEach(it => it.checkedIndex = -1); //增加当前题目用户选择的需要,默认不选中
|
|
|
+ this.tabIndex = 0;
|
|
|
+ this.tabData = this.tabData.concat(single.fullSubQuestionList);
|
|
|
+ this.optionResponseList = this.tabData[this.tabIndex].optionResponseList; //选项数据
|
|
|
}
|
|
|
- this.tabData.push(data);
|
|
|
- this.form.houseJson = this.form.houseJson.filter((item)=>{
|
|
|
- return item.spaceName && item.spaceName.length>0 && item.spaceType!=11 && item.hardboundEffect && item.hardboundEffect[0]
|
|
|
- })
|
|
|
- this.form.houseJson.sort(function(a,b){return parseFloat((b.spaceWidth * b.spaceHeight) / 10000) -parseFloat((a.spaceWidth * a.spaceHeight) / 10000)});
|
|
|
- this.form.houseJson.forEach((item,index)=>{
|
|
|
- //获取面积
|
|
|
- let curSpaceArea = parseFloat((item.spaceWidth * item.spaceHeight) / 10000).toFixed(1);
|
|
|
- let data = {
|
|
|
- name : item.spaceName,
|
|
|
- imgUrl : item.hardboundEffect[0],
|
|
|
- hardboundEffect:item.hardboundEffect,
|
|
|
- gsImage:item.hardboundEffect[0],
|
|
|
- area:curSpaceArea,
|
|
|
+ },
|
|
|
+ //切换大类
|
|
|
+ changeTab(id) {
|
|
|
+ if (id == this.tabIndex) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.tabIndex = id;
|
|
|
+ this.optionResponseList = this.tabData[this.tabIndex].optionResponseList; //选项数据
|
|
|
+ this.optionIndex = this.tabData[this.tabIndex].checkedIndex; //获取用户已经选中的选项
|
|
|
+ let param = {
|
|
|
+ type: 'CLK', //埋点类型
|
|
|
+ clkId: 'clk_2cmina_24012301', //点击ID
|
|
|
+ clkName: 'tab_clk', //点击前往的页面名称
|
|
|
+ clkParams: {
|
|
|
+ type: this.tabData[this.tabIndex].fatherContent,
|
|
|
+ locusName: "大类选择",
|
|
|
}
|
|
|
- this.tabData.push(data);
|
|
|
- })
|
|
|
- this.gsImage = this.form.layoutImgCustomized;//获取高斯模糊的图片
|
|
|
- }
|
|
|
- },
|
|
|
- changeTab(id){
|
|
|
- if(id == this.tabIndex){
|
|
|
- return
|
|
|
- }
|
|
|
- this.tabIndex = id;
|
|
|
- this.currImgIdx = 0;
|
|
|
- this.hardboundEffect = this.tabData[id].hardboundEffect? this.tabData[id].hardboundEffect : [];//赋值轮播图
|
|
|
- this.gsImage = this.tabData[id].gsImage;//获取高斯模糊的图片
|
|
|
- let param = {
|
|
|
- type: 'CLK', //埋点类型
|
|
|
- clkId: 'clk_2cmina_23080421', //点击ID
|
|
|
- clkName: 'roomretpic_clk', //点击前往的页面名称
|
|
|
- clkParams: {
|
|
|
- type: this.tabData[this.tabIndex].name,
|
|
|
- locusName: "房间名称",
|
|
|
- }
|
|
|
- };
|
|
|
- util.trackRequest(param);
|
|
|
- },
|
|
|
-
|
|
|
- catchTouchMove: function() {
|
|
|
- return false;
|
|
|
- },
|
|
|
-
|
|
|
- toMode(){
|
|
|
- let data = {
|
|
|
- houseId:this.houseId,
|
|
|
- id:this.id,
|
|
|
- }
|
|
|
- router.push({
|
|
|
- name: "webgl_rxdz_look",
|
|
|
- query:data
|
|
|
- });
|
|
|
- let param = {
|
|
|
- type: 'CLK', //埋点类型
|
|
|
- clkId: 'clk_2cmina_23080420', //点击ID
|
|
|
- clkName: 'checkroom_clk', //点击前往的页面名称
|
|
|
- clkParams: {
|
|
|
- locusName: "查看户型",
|
|
|
+ };
|
|
|
+ util.trackRequest(param);
|
|
|
+ },
|
|
|
+ //切换选项
|
|
|
+ changeOption(id) {
|
|
|
+ if (id == this.optionIndex) {
|
|
|
+ return false;
|
|
|
}
|
|
|
- };
|
|
|
- util.trackRequest(param);
|
|
|
- },
|
|
|
- showToast(title){
|
|
|
- this.$store.state.loading = true;
|
|
|
- this.$store.state.loadingMsg = title || "";
|
|
|
- setTimeout(()=>{
|
|
|
- this.$store.state.loading = false;
|
|
|
- }, 1500);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+ this.optionIndex = id;
|
|
|
+ this.tabData[this.tabIndex].checkedIndex = this.optionIndex;
|
|
|
+ if (this.tabIndex == 0) { //当前为角色时,则需要同步变更上面的
|
|
|
+ this.currImgIdx = id;
|
|
|
+ this.$refs.carousel.setActiveItem(this.currImgIdx);
|
|
|
+ }
|
|
|
+ this.allSelect = !this.tabData.some(it=>it.checkedIndex==-1);
|
|
|
+ console.warn("***changeOption***", this.tabData,this.allSelect)
|
|
|
+ let param = {
|
|
|
+ type: 'CLK', //埋点类型
|
|
|
+ clkId: 'clk_2cmina_24012302', //点击ID
|
|
|
+ clkName: 'option_clk', //点击前往的页面名称
|
|
|
+ clkParams: {
|
|
|
+ type: this.optionResponseList[this.optionIndex].content,
|
|
|
+ locusName: "选项选择",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ util.trackRequest(param);
|
|
|
+ },
|
|
|
+
|
|
|
+ catchTouchMove: function() {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ toMode() {
|
|
|
+ // let data = {
|
|
|
+ // houseId:this.houseId,
|
|
|
+ // id:this.id,
|
|
|
+ // }
|
|
|
+ // router.push({
|
|
|
+ // name: "webgl_rxdz_look",
|
|
|
+ // query:data
|
|
|
+ // });
|
|
|
+ let param = {
|
|
|
+ type: 'CLK', //埋点类型
|
|
|
+ clkId: 'clk_2cmina_24012303', //点击ID
|
|
|
+ clkName: 'confirm_clk', //点击前往的页面名称
|
|
|
+ clkParams: {
|
|
|
+ locusName: "确定个人偏好",
|
|
|
+ }
|
|
|
+ };
|
|
|
+ util.trackRequest(param);
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
@import "./webgl_rxdz_role.scss";
|
|
|
-</style>
|
|
|
-<style lang="css" scoped>
|
|
|
- /* @import "@/common/css/common.css"; */
|
|
|
</style>
|