@@ -16,6 +16,7 @@ pnpm-debug.log* | |||||
# Editor directories and files | # Editor directories and files | ||||
.idea | .idea | ||||
.vscode | .vscode | ||||
.zip | |||||
*.suo | *.suo | ||||
*.ntvs* | *.ntvs* | ||||
*.njsproj | *.njsproj | ||||
@@ -43,7 +43,7 @@ export function doFindInviteCode() { | |||||
*/ | */ | ||||
export function getVoiceList(data) { | export function getVoiceList(data) { | ||||
return request({ | return request({ | ||||
url: `/api/mouldPatch/voiceList?pageNum=1&pageSize=10`, | |||||
url: `/api/mouldPatch/voiceList?pageNum=1&pageSize=20`, | |||||
method: 'post', | method: 'post', | ||||
data | data | ||||
}) | }) | ||||
@@ -58,4 +58,17 @@ export function getBackGroundList() { | |||||
url: `/api/mouldPatch/list?type=4&pageNum=1&pageSize=10`, | url: `/api/mouldPatch/list?type=4&pageNum=1&pageSize=10`, | ||||
method: 'get', | method: 'get', | ||||
}) | }) | ||||
} | |||||
/** | |||||
* @description:保存或修改用户作品 | |||||
* @param {object} data | |||||
* @return data | |||||
*/ | |||||
export function saveOrUpdateUserVideo(data) { | |||||
return request({ | |||||
url: `/api/userVideo/saveOrUpdate`, | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | } |
@@ -47,4 +47,15 @@ export function doUpdateInviteCode(inviteCodeData) { | |||||
method: 'post', | method: 'post', | ||||
data: inviteCodeData | data: inviteCodeData | ||||
}) | }) | ||||
} | |||||
/** | |||||
* @description 退出登录 | |||||
* @returns data | |||||
*/ | |||||
export function doLoginOut() { | |||||
return request({ | |||||
url: `/api/user/loginOut`, | |||||
method: 'get', | |||||
}) | |||||
} | } |
@@ -1,14 +1,13 @@ | |||||
<template> | <template> | ||||
<div class="tailBox"> | <div class="tailBox"> | ||||
<div class="title">联系我们</div> | |||||
<!-- <div class="title">联系我们</div> --> | |||||
<!-- <div class="taillong"> | <!-- <div class="taillong"> | ||||
<img src="../../assets/img/LOGO1.png" alt> | <img src="../../assets/img/LOGO1.png" alt> | ||||
</div> --> | </div> --> | ||||
<div class="tiemBox"> | |||||
<!-- <div class="tiemBox"> | |||||
<div class="contentBox"> | <div class="contentBox"> | ||||
<!-- <div class="taolIconText">{{characters ==1?'联系我们':'Contact us'}}</div> --> | |||||
<div class="contentInput"> | <div class="contentInput"> | ||||
<input type="text" :placeholder="characters ==1?'姓名':'Name'" v-model="userName"> | <input type="text" :placeholder="characters ==1?'姓名':'Name'" v-model="userName"> | ||||
</div> | </div> | ||||
@@ -22,11 +21,19 @@ | |||||
<div class="subBtn" @click="submit()">{{characters ==1?'提交':'Submit'}}</div> | <div class="subBtn" @click="submit()">{{characters ==1?'提交':'Submit'}}</div> | ||||
</div> | </div> | ||||
</div> | |||||
<div class="tailText"> <img src="../../assets/img/logoh.png" alt=""></div> | |||||
</div> --> | |||||
<div class="tailText"><img src="../../assets/img/logoh.png" alt="" /></div> | |||||
<div class="tailText">TEL:86 152 1093 7300</div> | <div class="tailText">TEL:86 152 1093 7300</div> | ||||
<div class="tailText">{{characters ==1?'北京市海淀区中关村南大街12号农业科学院信息楼311室':'311, Information Building, Academy of Agricultural Sciences, No. 12 Zhongguancun South Street, Haidian District, Beijing'}}</div> | |||||
<div class="tailText">© 2021 Copyright 北京邃芒科技有限公司 版权所有 京ICP备2021007416号</div> | |||||
<div class="tailText"> | |||||
{{ | |||||
characters == 1 | |||||
? "北京市海淀区中关村南大街12号农业科学院信息楼311室" | |||||
: "311, Information Building, Academy of Agricultural Sciences, No. 12 Zhongguancun South Street, Haidian District, Beijing" | |||||
}} | |||||
</div> | |||||
<div class="tailText"> | |||||
© 2021 Copyright 北京邃芒科技有限公司 版权所有 京ICP备2021007416号 | |||||
</div> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
@@ -36,26 +43,26 @@ export default { | |||||
return { | return { | ||||
userName: "", | userName: "", | ||||
phone: "", | phone: "", | ||||
email: "" | |||||
email: "", | |||||
}; | }; | ||||
}, | }, | ||||
methods: { | methods: { | ||||
submit() { | submit() { | ||||
let phone = /^1[35789]\d{9}$/; | let phone = /^1[35789]\d{9}$/; | ||||
if (this.userName == "") { | if (this.userName == "") { | ||||
Toast.fail ( | |||||
Toast.fail( | |||||
this.characters == 1 ? "请输入姓名" : "Please enter your name" | this.characters == 1 ? "请输入姓名" : "Please enter your name" | ||||
); | ); | ||||
return; | return; | ||||
} else if (!phone.test(this.phone)) { | } else if (!phone.test(this.phone)) { | ||||
Toast.fail ( | |||||
Toast.fail( | |||||
this.characters == 1 | this.characters == 1 | ||||
? "请输入手机号" | ? "请输入手机号" | ||||
: "Please enter your mobile phone number" | : "Please enter your mobile phone number" | ||||
); | ); | ||||
return; | return; | ||||
} else if (this.email == "") { | } else if (this.email == "") { | ||||
Toast.fail ( | |||||
Toast.fail( | |||||
this.characters == 1 ? "请输入邮箱" : "Please enter email address" | this.characters == 1 ? "请输入邮箱" : "Please enter email address" | ||||
); | ); | ||||
return; | return; | ||||
@@ -63,17 +70,17 @@ export default { | |||||
let params = { | let params = { | ||||
mallName: this.email, //邮箱 | mallName: this.email, //邮箱 | ||||
applicant: this.userName, //姓名 | applicant: this.userName, //姓名 | ||||
phone: this.phone //电话 | |||||
phone: this.phone, //电话 | |||||
}; | }; | ||||
this.$axios({ | this.$axios({ | ||||
method: "post", | method: "post", | ||||
url: "/api/callback/wxMallApply/add", | url: "/api/callback/wxMallApply/add", | ||||
headers: { | headers: { | ||||
"Content-Type": "application/json;charset=UTF-8" | |||||
"Content-Type": "application/json;charset=UTF-8", | |||||
}, | }, | ||||
data: params | |||||
data: params, | |||||
}) | }) | ||||
.then(res => { | |||||
.then((res) => { | |||||
this.email = ""; | this.email = ""; | ||||
this.userName = ""; | this.userName = ""; | ||||
this.phone = ""; | this.phone = ""; | ||||
@@ -81,24 +88,23 @@ export default { | |||||
this.characters == 1 ? "提交成功" : "submit successfully" | this.characters == 1 ? "提交成功" : "submit successfully" | ||||
); | ); | ||||
}) | }) | ||||
.catch(err => { | |||||
Toast.fail (err.message); | |||||
.catch((err) => { | |||||
Toast.fail(err.message); | |||||
}); | }); | ||||
} | |||||
}, | |||||
}, | }, | ||||
computed: { | computed: { | ||||
...mapState({ | ...mapState({ | ||||
characters: state => state.publicObj.characters | |||||
}) | |||||
} | |||||
characters: (state) => state.publicObj.characters, | |||||
}), | |||||
}, | |||||
}; | }; | ||||
</script> | </script> | ||||
<style lang="scss" scoped> | <style lang="scss" scoped> | ||||
.tailBox { | .tailBox { | ||||
overflow: hidden; | overflow: hidden; | ||||
.title{ | |||||
.title { | |||||
text-align: center; | text-align: center; | ||||
font-size: 18px; | font-size: 18px; | ||||
line-height: 30px; | line-height: 30px; | ||||
@@ -119,7 +125,7 @@ export default { | |||||
height: 50px; | height: 50px; | ||||
} | } | ||||
} | } | ||||
.tiemBox{ | |||||
.tiemBox { | |||||
overflow: hidden; | overflow: hidden; | ||||
margin-top: 20px; | margin-top: 20px; | ||||
} | } | ||||
@@ -144,7 +150,6 @@ export default { | |||||
} | } | ||||
} | } | ||||
.contentBox { | .contentBox { | ||||
margin: 10px auto; | margin: 10px auto; | ||||
.contentInput { | .contentInput { | ||||
width: 220px; | width: 220px; | ||||
@@ -254,7 +259,7 @@ export default { | |||||
font-weight: 400; | font-weight: 400; | ||||
color: #191919; | color: #191919; | ||||
margin-bottom: 4px; | margin-bottom: 4px; | ||||
img{ | |||||
img { | |||||
width: 110px; | width: 110px; | ||||
height: 30px; | height: 30px; | ||||
} | } | ||||
@@ -281,4 +286,3 @@ export default { | |||||
font-size: 12px; | font-size: 12px; | ||||
} | } | ||||
</style> | </style> | ||||
@@ -9,7 +9,7 @@ | |||||
<div class="categoryitem">{{characters==1?'创新技术':'technology'}}</div> | <div class="categoryitem">{{characters==1?'创新技术':'technology'}}</div> | ||||
<div class="categoryitem">{{characters==1?'解决方案':'Solutions'}}</div> | <div class="categoryitem">{{characters==1?'解决方案':'Solutions'}}</div> | ||||
<div class="categoryitem">{{characters==1?'精选案例':'Cases'}}</div> | <div class="categoryitem">{{characters==1?'精选案例':'Cases'}}</div> | ||||
<div class="categoryitem" @click="go('/aboutUe')">{{characters==1?'关于我们':'About us'}}</div> | |||||
<div class="categoryitem" @click="go('/aboutUs')">{{characters==1?'关于我们':'About us'}}</div> | |||||
</div>--> | </div>--> | ||||
<div class="cutBox"> | <div class="cutBox"> | ||||
<div class="en"> | <div class="en"> | ||||
@@ -59,7 +59,7 @@ | |||||
</div> | </div> | ||||
<div class="goItem">{{ characters == 1 ? "解决方案" : "Solutions" }}</div> | <div class="goItem">{{ characters == 1 ? "解决方案" : "Solutions" }}</div> | ||||
<!-- <div class="goItem">{{characters==1?'精选案例':'Cases'}}</div> --> | <!-- <div class="goItem">{{characters==1?'精选案例':'Cases'}}</div> --> | ||||
<div class="goItem" @click="go('/aboutUe')"> | |||||
<div class="goItem" @click="go('/aboutUs')"> | |||||
{{ characters == 1 ? "关于我们" : "About us" }} | {{ characters == 1 ? "关于我们" : "About us" }} | ||||
</div> | </div> | ||||
<div class="languageImgBox" @click="change(1)"> | <div class="languageImgBox" @click="change(1)"> | ||||
@@ -23,7 +23,7 @@ | |||||
muted="muted" | muted="muted" | ||||
loop="loop" | loop="loop" | ||||
/> | /> | ||||
<div class="titleBox" @click="showBox"> | |||||
<div class="titleBox" @click="goLogin"> | |||||
<div class="title_item1" v-if="characters == 1">打造自主数字人IP</div> | <div class="title_item1" v-if="characters == 1">打造自主数字人IP</div> | ||||
<div class="title_item2" v-if="characters == 1">沉淀数字资产</div> | <div class="title_item2" v-if="characters == 1">沉淀数字资产</div> | ||||
<!-- <div class="title_item3" v-if="characters==1">自动化实时创作过程 帮助您快速定义形象 多种类型</div> --> | <!-- <div class="title_item3" v-if="characters==1">自动化实时创作过程 帮助您快速定义形象 多种类型</div> --> | ||||
@@ -67,7 +67,7 @@ | |||||
: "supporting multiple languages and inputs, generating digital content, bring new intelligence experience far more exciting than before ." | : "supporting multiple languages and inputs, generating digital content, bring new intelligence experience far more exciting than before ." | ||||
}} | }} | ||||
</div> | </div> | ||||
<div class="title_btn" @click="showBox"> | |||||
<div class="title_btn" @click="goLogin"> | |||||
{{ characters == 1 ? "立刻体验" : "Try it now" }} | {{ characters == 1 ? "立刻体验" : "Try it now" }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -99,7 +99,7 @@ | |||||
: "Provide extremely expenses saving & extendable user experience in digital content producing process." | : "Provide extremely expenses saving & extendable user experience in digital content producing process." | ||||
}} | }} | ||||
</div> | </div> | ||||
<div class="title_btn" @click="showBox"> | |||||
<div class="title_btn" @click="goLogin"> | |||||
{{ characters == 1 ? "立刻体验" : "Try it now" }} | {{ characters == 1 ? "立刻体验" : "Try it now" }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -149,7 +149,7 @@ | |||||
: "MetaGene provides digital human with the interactive ability, the character will have intelligent interactive functions, help to deal with real world problems in the business and assistance in completing tasks." | : "MetaGene provides digital human with the interactive ability, the character will have intelligent interactive functions, help to deal with real world problems in the business and assistance in completing tasks." | ||||
}} | }} | ||||
</div> | </div> | ||||
<div class="read_btn" @click="showBox"> | |||||
<div class="read_btn" @click="goLogin"> | |||||
{{ characters == 1 ? "了解详情" : "Read more" }} | {{ characters == 1 ? "了解详情" : "Read more" }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -231,7 +231,7 @@ | |||||
}} | }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="bnt_look" @click="showBox"> | |||||
<div class="bnt_look" @click="goLogin"> | |||||
{{ characters == 1 ? "立刻体验" : "Try it now" }} | {{ characters == 1 ? "立刻体验" : "Try it now" }} | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -379,7 +379,7 @@ | |||||
{{ characters == 1 ? "解决方案" : "Solutions" }} | {{ characters == 1 ? "解决方案" : "Solutions" }} | ||||
</div> | </div> | ||||
<!-- <div class="goItem">{{characters==1?'精选案例':'Cases'}}</div> --> | <!-- <div class="goItem">{{characters==1?'精选案例':'Cases'}}</div> --> | ||||
<!-- @click="go('/aboutUe')" --> | |||||
<!-- @click="go('/aboutUs')" --> | |||||
<div class="goItem" @click="goView('module_9')"> | <div class="goItem" @click="goView('module_9')"> | ||||
{{ characters == 1 ? "关于我们" : "About us" }} | {{ characters == 1 ? "关于我们" : "About us" }} | ||||
</div> | </div> | ||||
@@ -17,9 +17,9 @@ const routes = [ | |||||
component: () => import("../components/home/home"), | component: () => import("../components/home/home"), | ||||
}, | }, | ||||
{ | { | ||||
path: '/aboutUe', | |||||
name: 'aboutUe', | |||||
component: () => import("../components/aboutUe/aboutUe"), | |||||
path: '/aboutUs', | |||||
name: 'aboutUs', | |||||
component: () => import("../components/aboutUs/aboutUs"), | |||||
}, | }, | ||||
{ | { | ||||
path: '/styleAdd', | path: '/styleAdd', | ||||
@@ -0,0 +1,8 @@ | |||||
/** | |||||
* @description:使用JSON进行深度拷贝 | |||||
*/ | |||||
const deepCopy = data => { | |||||
const copyData = JSON.stringify(data) | |||||
return JSON.parse(copyData) | |||||
} | |||||
export default deepCopy |
@@ -37,19 +37,22 @@ request.interceptors.response.use( | |||||
router.push("/login"); | router.push("/login"); | ||||
Toast.fail("登录过期,请重新登录!"); | Toast.fail("登录过期,请重新登录!"); | ||||
return | return | ||||
// 其他错误 | |||||
} else if (response.data.code == 404) { | |||||
Toast.fail("网络异常,请稍后再试"); | |||||
return Promise.reject(response.data) | |||||
} else if (response.data.code == 500) { | } else if (response.data.code == 500) { | ||||
Toast.fail("系统异常,请稍后再试"); | Toast.fail("系统异常,请稍后再试"); | ||||
return Promise.reject() | |||||
return Promise.reject(response.data) | |||||
// 其他错误 | |||||
} else { | } else { | ||||
Toast.fail(response.data.message); | |||||
return Promise.reject() | |||||
return Promise.reject(response.data) | |||||
} | } | ||||
} else { | } else { | ||||
// 正常返回 | // 正常返回 | ||||
return response.data | return response.data | ||||
// 抛出错误 | |||||
// return Promise.reject() | |||||
} | } | ||||
}, | }, | ||||
function (error) { | function (error) { | ||||
@@ -247,7 +247,7 @@ export default { | |||||
} | } | ||||
}, 1000); | }, 1000); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -264,7 +264,7 @@ export default { | |||||
localStorage.setItem("AccessToken", token); | localStorage.setItem("AccessToken", token); | ||||
this.checkInviteCode(); | this.checkInviteCode(); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -286,7 +286,7 @@ export default { | |||||
this.$router.push("/myPage"); | this.$router.push("/myPage"); | ||||
} | } | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -301,7 +301,7 @@ export default { | |||||
Toast.success("登录成功!"); | Toast.success("登录成功!"); | ||||
this.$router.push("/myPage"); | this.$router.push("/myPage"); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -110,7 +110,7 @@ export default { | |||||
console.log(res, "获取模板列表"); | console.log(res, "获取模板列表"); | ||||
this.modeList = res.data.list; | this.modeList = res.data.list; | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -122,7 +122,7 @@ export default { | |||||
const modelDetail = res.data; | const modelDetail = res.data; | ||||
this.goSetPaperWork(modelDetail); | this.goSetPaperWork(modelDetail); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -138,7 +138,7 @@ export default { | |||||
}, | }, | ||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -14,18 +14,16 @@ | |||||
v-if="soundList.length" | v-if="soundList.length" | ||||
v-for="(item, index) in soundList" | v-for="(item, index) in soundList" | ||||
:key="index" | :key="index" | ||||
@click="setIn('sound', item.id)" | |||||
@click="setParams('sound', item)" | |||||
:class="soundIndex == item.id ? 'active' : ''" | :class="soundIndex == item.id ? 'active' : ''" | ||||
> | > | ||||
<div | |||||
class="preview" | |||||
:class="soundIndex == item.id ? 'active' : ''" | |||||
:style="'background-color:' + item.color" | |||||
></div> | |||||
<div class="preview" :class="soundIndex == item.id ? 'active' : ''"> | |||||
<img :src="item.coverImg" alt="" /> | |||||
</div> | |||||
<div class="tag">{{ item.title }}</div> | <div class="tag">{{ item.title }}</div> | ||||
</div> | </div> | ||||
<div class="instead" v-if="!soundList.length">暂无可用声音</div> | |||||
<div class="instead" v-if="!soundList.length">{{ voiceAlert }}</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -37,14 +35,15 @@ | |||||
v-if="backGroundList.length" | v-if="backGroundList.length" | ||||
v-for="(item, index) in backGroundList" | v-for="(item, index) in backGroundList" | ||||
:key="index" | :key="index" | ||||
@click="setIn('backGround', item.id)" | |||||
@click="setParams('backGround', item.id)" | |||||
:class="backGroundIndex == item.id ? 'active' : ''" | :class="backGroundIndex == item.id ? 'active' : ''" | ||||
> | > | ||||
<div | <div | ||||
class="preview" | class="preview" | ||||
:class="backGroundIndex == item.id ? 'active' : ''" | :class="backGroundIndex == item.id ? 'active' : ''" | ||||
:style="'background-color:' + item.color" | |||||
></div> | |||||
> | |||||
<img :src="item.coverImg" alt="" /> | |||||
</div> | |||||
<div class="tag">{{ item.title }}</div> | <div class="tag">{{ item.title }}</div> | ||||
</div> | </div> | ||||
@@ -86,10 +85,10 @@ | |||||
<script> | <script> | ||||
import Vue from "vue"; | import Vue from "vue"; | ||||
import { Toast } from "vant"; | import { Toast } from "vant"; | ||||
import baseUrl from "../../api/baseUrl"; | |||||
import { mapState, mapActions } from "vuex"; | import { mapState, mapActions } from "vuex"; | ||||
import HeadTop from "./../../components/common/head.vue"; | import HeadTop from "./../../components/common/head.vue"; | ||||
import scrollToID from "../../utils/scrollToID"; | import scrollToID from "../../utils/scrollToID"; | ||||
import deepCopy from "../../utils/deepCopy"; | |||||
import { | import { | ||||
doCreateVideo, | doCreateVideo, | ||||
@@ -97,6 +96,7 @@ import { | |||||
getVoiceList, | getVoiceList, | ||||
getBackGroundList, | getBackGroundList, | ||||
doFindInviteCode, | doFindInviteCode, | ||||
saveOrUpdateUserVideo, | |||||
} from "../../api/generateVideo"; | } from "../../api/generateVideo"; | ||||
Vue.use(Toast); | Vue.use(Toast); | ||||
@@ -109,50 +109,27 @@ export default { | |||||
isShowCover: false, | isShowCover: false, | ||||
isShowMessageCover: false, | isShowMessageCover: false, | ||||
show: false, | show: false, | ||||
voiceAlert: "暂无可用声音", | |||||
soundIndex: "", | soundIndex: "", | ||||
backGroundIndex: "", | backGroundIndex: "", | ||||
coverImg: "", | coverImg: "", | ||||
id: "", | id: "", | ||||
paperwork: "", | paperwork: "", | ||||
saveData: {}, // 来自填写文案页面保存的数据 | |||||
timerOver: false, | timerOver: false, | ||||
soundList: [ | |||||
{ | |||||
id: 1, | |||||
color: "red", | |||||
title: "红色", | |||||
}, | |||||
{ | |||||
id: 2, | |||||
color: "orange", | |||||
title: "橙色", | |||||
}, | |||||
{ | |||||
id: 3, | |||||
color: "yellow", | |||||
title: "黄色", | |||||
}, | |||||
{ | |||||
id: 4, | |||||
color: "green", | |||||
title: "绿色", | |||||
}, | |||||
{ | |||||
id: 5, | |||||
color: "aqua", | |||||
title: "青色", | |||||
}, | |||||
{ | |||||
id: 6, | |||||
color: "blue", | |||||
title: "蓝色", | |||||
}, | |||||
{ | |||||
id: 7, | |||||
color: "purple", | |||||
title: "紫色", | |||||
}, | |||||
], | |||||
soundList: [], | |||||
backGroundList: [], | backGroundList: [], | ||||
// 声音参数 | |||||
soundParams: { | |||||
voiceMouldId: "", | |||||
voiceMouldSmId: "", | |||||
}, | |||||
// 背景参数 | |||||
backGroundParams: { | |||||
backgroundMouldId: "", | |||||
backgroundMouldSmId: "", | |||||
}, | |||||
}; | }; | ||||
}, | }, | ||||
computed: { | computed: { | ||||
@@ -168,30 +145,40 @@ export default { | |||||
this.$router.push(url); | this.$router.push(url); | ||||
}, | }, | ||||
setIn(type, num) { | |||||
setParams(type, item) { | |||||
const num = item.id; | |||||
// 更换声音 | // 更换声音 | ||||
if (type == "sound") { | if (type == "sound") { | ||||
// 第一次选中 | // 第一次选中 | ||||
if (this.soundIndex == "") { | if (this.soundIndex == "") { | ||||
this.soundIndex = num; | this.soundIndex = num; | ||||
this.soundParams.voiceMouldId = item.id; | |||||
this.soundParams.voiceMouldSmId = item.mouldSmId; | |||||
// 取消选中 | // 取消选中 | ||||
} else if (num == this.soundIndex) { | } else if (num == this.soundIndex) { | ||||
this.soundIndex = ""; | this.soundIndex = ""; | ||||
// 有选中的情况下选择其他项 | // 有选中的情况下选择其他项 | ||||
} else { | } else { | ||||
this.soundIndex = num; | this.soundIndex = num; | ||||
this.soundParams.voiceMouldId = item.id; | |||||
this.soundParams.voiceMouldSmId = item.mouldSmId; | |||||
} | } | ||||
console.log(this.soundParams, "选择声音参数"); | |||||
// 更换背景 | // 更换背景 | ||||
} else if (type == "backGround") { | } else if (type == "backGround") { | ||||
// 第一次选中 | // 第一次选中 | ||||
if (this.backGroundIndex == "") { | if (this.backGroundIndex == "") { | ||||
this.backGroundIndex = num; | this.backGroundIndex = num; | ||||
this.backGroundParams.voiceMouldId = item.id; | |||||
this.backGroundParams.voiceMouldSmId = item.mouldSmId; | |||||
// 取消选中 | // 取消选中 | ||||
} else if (num == this.backGroundIndex) { | } else if (num == this.backGroundIndex) { | ||||
this.backGroundIndex = ""; | this.backGroundIndex = ""; | ||||
// 有选中的情况下选择其他项 | // 有选中的情况下选择其他项 | ||||
} else { | } else { | ||||
this.backGroundIndex = num; | this.backGroundIndex = num; | ||||
this.backGroundParams.voiceMouldId = item.id; | |||||
this.backGroundParams.voiceMouldSmId = item.mouldSmId; | |||||
} | } | ||||
} | } | ||||
}, | }, | ||||
@@ -217,7 +204,7 @@ export default { | |||||
/** | /** | ||||
* @description:生成视频 | * @description:生成视频 | ||||
*/ | */ | ||||
async createVideo() { | |||||
async createVideo(data) { | |||||
try { | try { | ||||
const res = await doCreateVideo(data); | const res = await doCreateVideo(data); | ||||
console.log(res, "生成视频"); | console.log(res, "生成视频"); | ||||
@@ -233,7 +220,7 @@ export default { | |||||
} | } | ||||
}, 1000); | }, 1000); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -248,8 +235,9 @@ export default { | |||||
try { | try { | ||||
const res = await getVoiceList(data); | const res = await getVoiceList(data); | ||||
console.log(res, "获取声音列表"); | console.log(res, "获取声音列表"); | ||||
this.soundList = res.data.list; | |||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -261,8 +249,9 @@ export default { | |||||
try { | try { | ||||
const res = await getBackGroundList(); | const res = await getBackGroundList(); | ||||
console.log(res, "获取背景列表"); | console.log(res, "获取背景列表"); | ||||
this.backGroundList = res.data.list; | |||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -292,7 +281,7 @@ export default { | |||||
return; | return; | ||||
} | } | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -307,13 +296,34 @@ export default { | |||||
const status = res.data.status; | const status = res.data.status; | ||||
// 当没有邀请码时 | // 当没有邀请码时 | ||||
if (status == 1) { | if (status == 1) { | ||||
this.createVideo(); | |||||
// 组装参数 | |||||
const data = { | |||||
...this.saveData, | |||||
...this.soundParams, | |||||
...this.backGroundParams, | |||||
}; | |||||
console.log(data, "最终提交的参数"); | |||||
this.saveOrUpdate(data); | |||||
} else if (status == 0) { | } else if (status == 0) { | ||||
this.isShowMessageCover = true; | this.isShowMessageCover = true; | ||||
return; | return; | ||||
} | } | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | |||||
} | |||||
}, | |||||
/** | |||||
* @description:保存或修改用户作品 | |||||
*/ | |||||
async saveOrUpdate(data) { | |||||
try { | |||||
const res = await saveOrUpdateUserVideo(data); | |||||
console.log(res, "保存或修改用户作品"); | |||||
this.createVideo({ id: this.id }); | |||||
} catch (error) { | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -323,11 +333,14 @@ export default { | |||||
this.coverImg = this.$route.query.coverImg; | this.coverImg = this.$route.query.coverImg; | ||||
this.id = this.$route.query.id; | this.id = this.$route.query.id; | ||||
this.paperwork = this.$route.query.paperwork; | this.paperwork = this.$route.query.paperwork; | ||||
this.loadVoice(); | |||||
this.loadBackGrounnd(); | |||||
this.saveData = deepCopy(this.$route.query.saveData); | |||||
console.log(this.saveData, "this.saveData"); | |||||
}, | }, | ||||
mounted() { | mounted() { | ||||
scrollToID("top"); | scrollToID("top"); | ||||
this.loadVoice(); | |||||
this.loadBackGrounnd(); | |||||
}, | }, | ||||
}; | }; | ||||
</script> | </script> | ||||
@@ -388,9 +401,13 @@ export default { | |||||
flex-shrink: 0; | flex-shrink: 0; | ||||
border: 1px solid #00000036; | border: 1px solid #00000036; | ||||
border-radius: 50% 50%; | border-radius: 50% 50%; | ||||
overflow: hidden; | |||||
transition: all 0.5s; | transition: all 0.5s; | ||||
opacity: 0.9; | opacity: 0.9; | ||||
img { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
&.active { | &.active { | ||||
border: 1px solid #000; | border: 1px solid #000; | ||||
width: 35px; | width: 35px; | ||||
@@ -453,9 +470,13 @@ export default { | |||||
flex-shrink: 0; | flex-shrink: 0; | ||||
border: 1px solid #00000036; | border: 1px solid #00000036; | ||||
border-radius: 50% 50%; | border-radius: 50% 50%; | ||||
overflow: hidden; | |||||
transition: all 0.5s; | transition: all 0.5s; | ||||
opacity: 0.9; | opacity: 0.9; | ||||
img { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
&.active { | &.active { | ||||
border: 1px solid #000; | border: 1px solid #000; | ||||
width: 35px; | width: 35px; | ||||
@@ -89,7 +89,7 @@ export default { | |||||
const res = await getModelDetailById(id); | const res = await getModelDetailById(id); | ||||
this.modelDetail = res.data.personMould; | this.modelDetail = res.data.personMould; | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -107,10 +107,11 @@ export default { | |||||
id: res.data.id, | id: res.data.id, | ||||
coverImg: this.modelDetail.coverImg, | coverImg: this.modelDetail.coverImg, | ||||
paperwork: this.paperwork, | paperwork: this.paperwork, | ||||
saveData: data, | |||||
}, | }, | ||||
}); | }); | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||
@@ -121,7 +121,7 @@ export default { | |||||
this.videoList = res.data.list; | this.videoList = res.data.list; | ||||
this.total = res.data.total; | this.total = res.data.total; | ||||
} catch (error) { | } catch (error) { | ||||
console.log(error); | |||||
console.log(error, "error"); | |||||
Toast.fail(error.message); | Toast.fail(error.message); | ||||
} | } | ||||
}, | }, | ||||