|
|
@@ -18,7 +18,14 @@ const mixin = { |
|
|
|
picVisible: false, |
|
|
|
videoVisible: false, |
|
|
|
jsPlayTtsEnabled: true, |
|
|
|
jsHandleStateEnabled: false |
|
|
|
jsHandleStateEnabled: false, |
|
|
|
speedConfig: false, |
|
|
|
videoStopConfig: false, |
|
|
|
speakTs: 0, |
|
|
|
timer: 0, |
|
|
|
pauseTs: 0, |
|
|
|
msg: this.$cmdList["companyTxt"], |
|
|
|
speakTxt: "" |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
@@ -30,15 +37,55 @@ const mixin = { |
|
|
|
...mapMutations(["setLastPerson", "setProgressPerson", "setLocalDevInfo", "setPad", "setDebug"]), |
|
|
|
jsonpRequest(url) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
console.log("request"); |
|
|
|
/*window.$.ajax({ |
|
|
|
url: url, |
|
|
|
// dataType: "jsonp", // 指定数据类型为 JSONP |
|
|
|
// jsonpCallback: "jsonpCallback", // 指定回调函数名 |
|
|
|
success: function(data) { |
|
|
|
console.log(data); |
|
|
|
resolve(data); |
|
|
|
}, |
|
|
|
error: function(error) { |
|
|
|
console.log(error); |
|
|
|
reject(error); |
|
|
|
} |
|
|
|
});*/ |
|
|
|
|
|
|
|
/*var requestOptions = { |
|
|
|
method: "GET", |
|
|
|
redirect: "follow" |
|
|
|
}; |
|
|
|
console.log(url); |
|
|
|
fetch(url, requestOptions) |
|
|
|
.then((response) => response.text()) |
|
|
|
.then((result) => { |
|
|
|
console.log(result); |
|
|
|
resolve(result); |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
console.log("error", error); |
|
|
|
reject(error); |
|
|
|
});*/ |
|
|
|
|
|
|
|
const callbackName = "jsonpCallback"; // 回调函数名 |
|
|
|
|
|
|
|
// 创建一个 script 元素 |
|
|
|
const script = document.createElement("script"); |
|
|
|
script.src = url + (url.indexOf("?") === -1 ? "?" : "&") + "callback=" + callbackName; |
|
|
|
if (url.indexOf("?") === -1) { |
|
|
|
script.src = url + "?" + "callback=" + callbackName; |
|
|
|
} else { |
|
|
|
var params = url.substring(url.indexOf("?") + 1); |
|
|
|
var base = url.substring(0, url.indexOf("?")); |
|
|
|
// url += |
|
|
|
script.src = base + "?callback=" + callbackName + "&" + params; |
|
|
|
} |
|
|
|
document.body.appendChild(script); |
|
|
|
|
|
|
|
// 设置回调函数 |
|
|
|
window[callbackName] = (data) => { |
|
|
|
console.log("callback===="); |
|
|
|
console.log(data); |
|
|
|
delete window[callbackName]; |
|
|
|
document.body.removeChild(script); |
|
|
|
resolve(data); |
|
|
@@ -46,6 +93,8 @@ const mixin = { |
|
|
|
|
|
|
|
// 请求失败处理 |
|
|
|
script.onerror = (error) => { |
|
|
|
console.log("error callback===="); |
|
|
|
console.log(error); |
|
|
|
delete window[callbackName]; |
|
|
|
document.body.removeChild(script); |
|
|
|
reject(error); |
|
|
@@ -61,7 +110,7 @@ const mixin = { |
|
|
|
switch (cmd) { |
|
|
|
case "onBind": |
|
|
|
that.character = params.currentCharacter; |
|
|
|
that.allClothes = window.cloudiaConfig.allClothes; |
|
|
|
that.allClothes = window.cloudiaConfig ? window.cloudiaConfig.allClothes : []; |
|
|
|
break; |
|
|
|
case "setState": |
|
|
|
if ("GREET" == params.state) { |
|
|
@@ -95,8 +144,9 @@ const mixin = { |
|
|
|
cameraMode: that.cameraMode |
|
|
|
} |
|
|
|
); |
|
|
|
Cloudia.setWalkGreetingEnable(false); |
|
|
|
Cloudia.setAsrWakeUpEnable(true); |
|
|
|
Cloudia && Cloudia.setWalkGreetingEnable(false); |
|
|
|
Cloudia && Cloudia.setAsrWakeUpEnable(true); |
|
|
|
Cloudia && Cloudia.setClothes("suit_blue"); |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
that.$parent.consoleLog(e.message); |
|
|
@@ -133,6 +183,46 @@ const mixin = { |
|
|
|
setTabindex(tabIndex) { |
|
|
|
this.tabIndex = tabIndex; |
|
|
|
}, |
|
|
|
recordTs() { |
|
|
|
var that = this; |
|
|
|
that.timer = setInterval(() => { |
|
|
|
that.speakTs++; |
|
|
|
if (that.$cmdList["speed"]) { |
|
|
|
var speeds = that.$cmdList["speed"]; |
|
|
|
for (var item in speeds) { |
|
|
|
console.log(that.speakTs + "=====" + item); |
|
|
|
if (that.speakTs < item) { |
|
|
|
break; |
|
|
|
} |
|
|
|
if (that.speakTs == item) { |
|
|
|
that.changeSpeed(speeds[item]); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
if (that.speakTs > 170) { |
|
|
|
window.clearInterval(that.timer); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log(that.speakTs); |
|
|
|
}, 1000); |
|
|
|
}, |
|
|
|
clearTs() { |
|
|
|
this.speakTs = 0; |
|
|
|
this.changeSpeed(1); |
|
|
|
window.clearInterval(this.timer); |
|
|
|
}, |
|
|
|
changeSpeed(speed) { |
|
|
|
var that = this; |
|
|
|
this.jsonpRequest(that.$cmdList.handleUrl + "?speed=" + speed) |
|
|
|
.then((data) => { |
|
|
|
console.log("speed===" + data); |
|
|
|
}) |
|
|
|
.catch((error) => { |
|
|
|
console.log("speed error===" + error); |
|
|
|
}); |
|
|
|
}, |
|
|
|
playVideo(src) { |
|
|
|
if (src) { |
|
|
|
this.picVisible = false; |
|
|
@@ -223,40 +313,64 @@ const mixin = { |
|
|
|
}, |
|
|
|
homeEvent() { |
|
|
|
// this.$parent.$data.ws.send("pic1"); |
|
|
|
this.jsonpRequest(this.$cmdList.handleUrl + "pic1") |
|
|
|
.then((data) => {}) |
|
|
|
.catch((error) => {}); |
|
|
|
let that = this; |
|
|
|
that.clearTs(); |
|
|
|
if (that.$parent.$data.isSpeaking) { |
|
|
|
that.$parent.setIsSpeaking(false); |
|
|
|
window.Cloudia.stopPlayTts(); |
|
|
|
} |
|
|
|
try { |
|
|
|
this.jsonpRequest(this.$cmdList.handleUrl + "pic1") |
|
|
|
.then((data) => {}) |
|
|
|
.catch((error) => {}); |
|
|
|
} catch (e) { |
|
|
|
console.log("977777"); |
|
|
|
console.log(e); |
|
|
|
} |
|
|
|
}, |
|
|
|
companyEvent() { |
|
|
|
let that = this; |
|
|
|
|
|
|
|
/* |
|
|
|
this.jsonpRequest(this.$cmdList.handleUrl + "pic2") |
|
|
|
.then((data) => {}) |
|
|
|
.catch((error) => {}); |
|
|
|
*/ |
|
|
|
|
|
|
|
this.jsonpRequest(this.$cmdList.handleUrl + "speed=0.13") |
|
|
|
.then((data) => { |
|
|
|
that.jsonpRequest(that.$cmdList.handleUrl + "name=play") |
|
|
|
.then((data2) => {}) |
|
|
|
.catch((error2) => {}); |
|
|
|
}) |
|
|
|
.catch((error) => {}); |
|
|
|
// that.clearTs(); |
|
|
|
var ind = 0; |
|
|
|
|
|
|
|
if (that.$parent.$data.isSpeaking) { |
|
|
|
window.clearInterval(that.timer); |
|
|
|
that.pauseTs = new Date().getTime(); |
|
|
|
|
|
|
|
that.$parent.setIsSpeaking(false); |
|
|
|
window.Cloudia.stopPlayTts(); |
|
|
|
that.jsonpRequest(that.$cmdList.handleUrl + "name=stop") |
|
|
|
that.jsonpRequest(that.$cmdList.handleUrl + "?name=stop") |
|
|
|
.then((data) => {}) |
|
|
|
.catch((error) => {}); |
|
|
|
that.videoStopConfig = true; |
|
|
|
} else { |
|
|
|
setTimeout(function() { |
|
|
|
that.addMsgList( |
|
|
|
2, |
|
|
|
"协合新能源集团创立于二零零六年,自创立之初便致力于风电项目的建设,并在二零零六年成功投产了首个风电项目、、位于辽宁昌图的五十兆瓦风电场。随后的二零零七年,集团于香港联交所上市,成为中国内地和香港市场上首家风电上市企业。二零零八年,集团初步形成了纵向一体化风电产业链,包括制造、开发、建设和营运等环节、在二零零九年集团进入发展的快车道,并与多家国内外大型发电企业建立战略合作关系,权益装机容量首次超过五百兆瓦。在二零一零年,集团发展达到了阶段高峰,年度净利润达到四点二七亿港币,累计投资的风电项目数量达到二十七个,共计装机容量达到一千七百一十兆瓦,并与国际金融公司IFC实现合作。随后,在二零一一年,集团积极实施向南发展和向太阳能发展的战略,成功并网了首个光伏电站。二零一二年,首个海外光伏项目、美国纽约分布式光伏项目也投产、、经过多年实践,集团资产结构和资产质量持续优化,并于二零一六年成功发行了国内首单非金融企业绿色债券。在二零一七年,集团获得了国际信用评级机构的BB评级,并发布了智慧能源解决方案POWER加。二零一八年,权益装机容量突破了二百万千瓦。二零一九年,集团首个平价项目当年开工、当年投产,这展示了我们已迈入平价时代。二零二零年,尽管受到疫情影响,集团仍始终坚持项目的建设,并取得了资产结构和质量的极大提升,实现持续滚动发展。二零二一年,集团实现了年投产容量百万千瓦,并创造了二百兆瓦电站工程最短工期记录。在二零二二年,开发指标创下了历史新高,基地项目申报实现零的突破,连续实现年投产容量超过百万千瓦,并在MSCI的ESG评级中获评为A级、、协合新能源集团从成立伊始就以发展绿色能源为己任,追求可持续发展,而历经多年的努力和拼搏,已初步建立了一条完整的绿色发展产业链,未来也将围绕用清洁能源创造更好未来的核心价值观,促进企业与社会的可持续发展。" |
|
|
|
); |
|
|
|
}, 800); |
|
|
|
let currentTs = new Date().getTime(); |
|
|
|
if (currentTs - that.pauseTs > 1000 * that.$cmdList["pauseTime"]) { |
|
|
|
that.speakTs = 0; |
|
|
|
} |
|
|
|
if (that.speakTs > 0 && that.speakTs < 170) { |
|
|
|
ind = Math.floor(that.speakTs * that.$cmdList["speedPreSec"]); |
|
|
|
console.log("pauseTs:" + that.pauseTs + "ind:" + ind); |
|
|
|
} |
|
|
|
this.jsonpRequest(that.$cmdList.handleUrl + "pic2/") |
|
|
|
.then((data) => {}) |
|
|
|
.catch((error) => {}); |
|
|
|
|
|
|
|
if (that.videoStopConfig) { |
|
|
|
setTimeout(function() { |
|
|
|
that.jsonpRequest(that.$cmdList.handleUrl + "?name=play") |
|
|
|
.then((data) => {}) |
|
|
|
.catch((error) => {}); |
|
|
|
that.addMsgList(2, that.msg.substring(ind)); |
|
|
|
}, 800); |
|
|
|
} else { |
|
|
|
setTimeout(function() { |
|
|
|
that.changeSpeed(0.13); |
|
|
|
that.addMsgList(2, that.msg.substring(ind)); |
|
|
|
}, 800); |
|
|
|
} |
|
|
|
that.videoStopConfig = false; |
|
|
|
this.recordTs(); |
|
|
|
} |
|
|
|
}, |
|
|
|
updLocation() { |
|
|
|