|
@@ -3,9 +3,16 @@
|
|
|
</template>
|
|
|
<script>
|
|
|
const util = require('@/utils/util.js').default;
|
|
|
- import { MessageBox } from 'mint-ui';
|
|
|
- import { Indicator } from 'mint-ui';
|
|
|
- import { Toast } from 'mint-ui';
|
|
|
+ import {
|
|
|
+ MessageBox
|
|
|
+ } from 'mint-ui';
|
|
|
+ import {
|
|
|
+ Indicator
|
|
|
+ } from 'mint-ui';
|
|
|
+ import {
|
|
|
+ Toast
|
|
|
+ } from 'mint-ui';
|
|
|
+ import lottie from "lottie-web"; //lottie
|
|
|
// import commonMethod from '@/common/commonMethod.js';
|
|
|
// import touchHandle from '@/mixins/touchHandle.js';
|
|
|
// import requestConfig from '@/static/lib/requestConfig';
|
|
@@ -13,21 +20,38 @@
|
|
|
export default {
|
|
|
data: function() {
|
|
|
return {
|
|
|
- leftList:[],
|
|
|
- rightList:[],
|
|
|
- musicList:[],//音乐列表
|
|
|
- dataList:[],
|
|
|
- tabIndex:0,//当前选中的tab序号
|
|
|
- selectIndex:-1,
|
|
|
- peopleIndex:-1,
|
|
|
- petIndex:-1,
|
|
|
- musicIndex:-1,
|
|
|
- specialIndex:0,
|
|
|
- specialImg:'https://dm.static.elab-plus.com/miniProgram/ai-icon.png',
|
|
|
+ leftList: [],
|
|
|
+ rightList: [],
|
|
|
+ musicList: [], //音乐列表
|
|
|
+ dataList: [],
|
|
|
+ tabIndex: 0, //当前选中的tab序号
|
|
|
+ selectIndex: -1,
|
|
|
+ peopleIndex: -1,
|
|
|
+ petIndex: -1,
|
|
|
+ musicIndex: -1,
|
|
|
+ specialIndex: 0,
|
|
|
+ specialList:[
|
|
|
+ {
|
|
|
+ id:1,
|
|
|
+ url:'https://dm.static.elab-plus.com/miniProgram/lottieJson/gold.json',
|
|
|
+ title:'金光闪闪',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id:2,
|
|
|
+ url:'https://dm.static.elab-plus.com/miniProgram/lottieJson/fireworks.json',
|
|
|
+ title:'烟花',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ id:3,
|
|
|
+ url:'https://dm.static.elab-plus.com/miniProgram/lottieJson/coloreRibbon.json',
|
|
|
+ title:'彩带',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ hasRedBox:false, //是否添加了红包
|
|
|
}
|
|
|
},
|
|
|
- props:{
|
|
|
-
|
|
|
+ props: {
|
|
|
+
|
|
|
},
|
|
|
// mixins: [touchHandle],
|
|
|
async mounted() {
|
|
@@ -39,85 +63,112 @@
|
|
|
this.getDatalist(3);
|
|
|
},
|
|
|
// 页面被展示时执行
|
|
|
- onPageShow: function() {
|
|
|
-
|
|
|
+ onPageShow: function() {
|
|
|
+
|
|
|
},
|
|
|
//页面被隐藏时执行
|
|
|
- onPageHide: function() {
|
|
|
- // console.warn("***detached-hide***")
|
|
|
- },
|
|
|
- methods:{
|
|
|
- resolveIndex(index){
|
|
|
+ onPageHide: function() {
|
|
|
+ // console.warn("***detached-hide***")
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ resolveIndex(index) {
|
|
|
this.selectIndex = index || 0;
|
|
|
},
|
|
|
- specialChange(index){
|
|
|
- if(this.specialIndex == index){
|
|
|
+ specialChange(index) {
|
|
|
+ if (this.specialIndex == index) {
|
|
|
return false;
|
|
|
}
|
|
|
this.specialIndex = index;
|
|
|
- this.specialImg = 'https://dm.static.elab-plus.com/miniProgram/ai-icon.png';
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 播放lottie动画
|
|
|
+ lottie.destroy("markLoading");
|
|
|
+ var element = document.getElementById("special-img");
|
|
|
+ this.anim = lottie.loadAnimation({
|
|
|
+ container: element,
|
|
|
+ name: "markLoading",
|
|
|
+ renderer: "svg",
|
|
|
+ loop: true,
|
|
|
+ autoplay: true,
|
|
|
+ path: this.specialList[this.specialIndex].url, //动画json
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
-
|
|
|
- tabChange(index){
|
|
|
- if(this.tabIndex == index){
|
|
|
+
|
|
|
+ tabChange(index) {
|
|
|
+ if (this.tabIndex == index) {
|
|
|
return false;
|
|
|
}
|
|
|
- if(this.$parent.repeatFlag == true){
|
|
|
+ if (this.$parent.repeatFlag == true) {
|
|
|
Toast({
|
|
|
message: '加载中...请稍后再试',
|
|
|
});
|
|
|
return false
|
|
|
}
|
|
|
this.tabIndex = index;
|
|
|
- this.$emit("tabChange",this.tabIndex);//通知页面,户型大类发生了变更
|
|
|
+ this.$emit("tabChange", this.tabIndex); //通知页面,户型大类发生了变更
|
|
|
+ if(this.tabIndex==2 && this.specialIndex>-1){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 播放lottie动画
|
|
|
+ lottie.destroy("markLoading");
|
|
|
+ var element = document.getElementById("special-img");
|
|
|
+ this.anim = lottie.loadAnimation({
|
|
|
+ container: element,
|
|
|
+ name: "markLoading",
|
|
|
+ renderer: "svg",
|
|
|
+ loop: true,
|
|
|
+ autoplay: true,
|
|
|
+ path: this.specialList[this.specialIndex].url, //动画json
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
//AI数字人切换
|
|
|
- selectAction(selItem,index) {
|
|
|
- console.log('点击动作111:', selItem,index)
|
|
|
- if(this.tabIndex==0){
|
|
|
- if(this.peopleIndex == index){//取消选中
|
|
|
- this.aiPeopleChange(this.leftList[this.peopleIndex],'canel')
|
|
|
+ selectAction(selItem, index) {
|
|
|
+ console.log('点击动作111:', selItem, index)
|
|
|
+ if (this.tabIndex == 0) {
|
|
|
+ if (this.peopleIndex == index) { //取消选中
|
|
|
+ this.aiPeopleChange(this.leftList[this.peopleIndex], 'canel')
|
|
|
this.peopleIndex = -1;
|
|
|
return false
|
|
|
}
|
|
|
- }else if(this.tabIndex==1){
|
|
|
- if(this.petIndex == index){//取消选中
|
|
|
- this.aiPeopleChange(this.rightList[this.petIndex],'canel')
|
|
|
+ } else if (this.tabIndex == 1) {
|
|
|
+ if (this.petIndex == index) { //取消选中
|
|
|
+ this.aiPeopleChange(this.rightList[this.petIndex], 'canel')
|
|
|
this.petIndex = -1;
|
|
|
return false
|
|
|
}
|
|
|
- }else if(this.tabIndex==3){
|
|
|
- if(this.musicIndex == index){//取消选中
|
|
|
- this.aiPeopleChange(this.musicList[this.musicIndex],'canel')
|
|
|
+ } else if (this.tabIndex == 3) {
|
|
|
+ if (this.musicIndex == index) { //取消选中
|
|
|
+ this.aiPeopleChange(this.musicList[this.musicIndex], 'canel')
|
|
|
this.musicIndex = -1;
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
- if(this.$parent.repeatFlag == true){
|
|
|
+ if (this.$parent.repeatFlag == true) {
|
|
|
Toast({
|
|
|
message: '加载中...请稍后再试',
|
|
|
});
|
|
|
return false
|
|
|
}
|
|
|
- if(this.tabIndex==0){
|
|
|
+ if (this.tabIndex == 0) {
|
|
|
this.peopleIndex = index;
|
|
|
- this.aiPeopleChange(this.leftList[this.peopleIndex],'add')
|
|
|
- }else if(this.tabIndex==1){
|
|
|
+ this.aiPeopleChange(this.leftList[this.peopleIndex], 'add')
|
|
|
+ } else if (this.tabIndex == 1) {
|
|
|
this.petIndex = index;
|
|
|
- this.aiPeopleChange(this.rightList[this.petIndex],'add')
|
|
|
- }else if(this.tabIndex==3){
|
|
|
+ this.aiPeopleChange(this.rightList[this.petIndex], 'add')
|
|
|
+ } else if (this.tabIndex == 3) {
|
|
|
this.musicIndex = index;
|
|
|
- this.aiPeopleChange(this.musicList[this.musicIndex],'add')
|
|
|
+ this.aiPeopleChange(this.musicList[this.musicIndex], 'add')
|
|
|
}
|
|
|
},
|
|
|
// 获取瀑布流数据
|
|
|
async getDatalist(type) {
|
|
|
let typeName = "Virtual_Human";
|
|
|
- if(type==0){
|
|
|
+ if (type == 0) {
|
|
|
typeName = "Virtual_Human";
|
|
|
- }else if(type==1){
|
|
|
+ } else if (type == 1) {
|
|
|
typeName = "Virtual_Pet";
|
|
|
- }else if(type==3){
|
|
|
+ } else if (type == 3) {
|
|
|
typeName = "Virtual_Music";
|
|
|
Indicator.close();
|
|
|
}
|
|
@@ -129,11 +180,11 @@
|
|
|
this.selectIndex = 0;
|
|
|
if (res && res.success && res.list) {
|
|
|
let list = res.list;
|
|
|
- if(type==0){
|
|
|
+ if (type == 0) {
|
|
|
this.leftList = list;
|
|
|
- }else if(type==1){
|
|
|
+ } else if (type == 1) {
|
|
|
this.rightList = list;
|
|
|
- }else if(type==3){
|
|
|
+ } else if (type == 3) {
|
|
|
this.musicList = list;
|
|
|
}
|
|
|
}
|
|
@@ -144,9 +195,17 @@
|
|
|
// hideOrShowActor(type){
|
|
|
// this.$emit('hideOrShowActor',type);//隐藏所有视角
|
|
|
// },
|
|
|
- //种子户型变更-户型大类变更
|
|
|
- aiPeopleChange(item,type){
|
|
|
- this.$emit("aiPeopleChange", item,type,this.tabIndex);//通知页面,户型大类发生了变更
|
|
|
+ addRedBox(){//添加红包
|
|
|
+ this.$emit("redBox",'add');
|
|
|
+ this.hasRedBox = true;
|
|
|
+ },
|
|
|
+ removeRedBox(){//去除红包
|
|
|
+ this.$emit("redBox",'canel');
|
|
|
+ this.hasRedBox = false;
|
|
|
+ },
|
|
|
+ //AI数字人切换
|
|
|
+ aiPeopleChange(item, type) {
|
|
|
+ this.$emit("aiPeopleChange", item, type, this.tabIndex); //通知页面,AI数字人切换了
|
|
|
},
|
|
|
//发布全景
|
|
|
mynavigateFuc(e) {
|
|
@@ -161,16 +220,18 @@
|
|
|
};
|
|
|
util.trackRequest(param);
|
|
|
let _ps = JSON.stringify(this.$parent.getPosition());
|
|
|
- let _scale = this.$parent.scale;
|
|
|
- console.warn("_ps",_ps,_scale)
|
|
|
- if(window.__wxjs_environment === 'miniprogram'){
|
|
|
- wx.miniProgram.navigateTo({url: '/extraPackage/pages/aiPublishPage/aiPublishPage?houseId='+(this.$route.query.houseId || '')
|
|
|
- + '&coordinate=' + encodeURIComponent(_ps)
|
|
|
- // + '&scale=' + encodeURIComponent(_scale)
|
|
|
- + '&scale=' + _scale
|
|
|
- + '&bgUrl=' + this.$parent.bgUrl
|
|
|
- + '&videoUrl=' + encodeURIComponent(this.dataList[this.selectIndex].url)})
|
|
|
- }else{
|
|
|
+ console.warn("_ps", _ps, this.$parent.peopleScale,this.$parent.petScale)
|
|
|
+ if (window.__wxjs_environment === 'miniprogram') {
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
+ url: '/extraPackage/pages/aiPublishPage/aiPublishPage?houseId=' + (this.$route.query
|
|
|
+ .houseId || '') +
|
|
|
+ '&coordinate=' + encodeURIComponent(_ps) +
|
|
|
+ '&peopleScale=' + this.$parent.peopleScale +
|
|
|
+ '&petScale=' + this.$parent.petScale +
|
|
|
+ '&bgUrl=' + this.$parent.bgUrl +
|
|
|
+ '&videoUrl=' + encodeURIComponent(this.dataList[this.selectIndex].url)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
Toast({
|
|
|
message: '敬请期待',
|
|
|
});
|
|
@@ -181,6 +242,6 @@
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
- @import "./viewAI.scss";
|
|
|
+ @import "./viewAI.scss";
|
|
|
/* @import "@/common/css/common.css"; */
|
|
|
-</style>
|
|
|
+</style>
|