瀏覽代碼

commit

main
yk 1 年之前
父節點
當前提交
4793d2b465
共有 4 個檔案被更改,包括 168 行新增30 行删除
  1. +19
    -0
      public/config.json
  2. +5
    -0
      public/index.html
  3. +1
    -1
      src/App.vue
  4. +143
    -29
      src/mixins/mixin.js

+ 19
- 0
public/config.json 查看文件

@@ -7,6 +7,24 @@
"debug": false,
"detectedFaceEnable": false,
"handleUrl": "http://192.168.1.146:8080/",
"companyTxt": "2006年公司创立, 首个风电项目辽宁昌图50兆瓦风电场投产。2007年,公司于香港联交所上市, 成为香港和大陆市场首家风电上市企业。2008年,公司制造、开发、建设和营运的纵向一体化风电产业链初步形成。2009年,公司进入发展快车道, 权益装机容量首次超过500兆瓦。与多家大型国有和国际发电企业建立战略合作关系。2010年,公司发展达到阶段高峰, 年度净利润达4.27亿港币, 风电项目投资累计达 27个共1710 兆瓦, 权益容量1025兆瓦, 公司与国际金融公司实现合作。2011年,公司积极实施向南发展和向太阳能发展的战略, 首个光伏电站并网发电。2012年,首个海外光伏项目美国纽约分布式光伏项目投产。公司加快向南发展,资产结构持续优化,风电并网机组达到1000台。2013年,云南永仁等多个光伏项目投产, 太阳能业务展现良好发展势头。2014年,太阳能电厂装机容量超过三分之一,非限电地区的权益装机容量超过三分之二,资产结构和质量大幅优化。2015年,控股股东增持股份,利润超过5亿港币,其中发电利润超过一半。2016年,成功发行国内首单非金融企业绿色债券。2017年,公司获得国际信用评级机构授予的BB(稳定)评级;发布智慧能源解决方案POWER+。2018年,公司权益装机容量突破200万千瓦。2019年,公司首个平价项目当年开工、当年投产,迈入平价时代。2020年,克服疫情影响,在建项目及早复工复产,项目开发容量再创新高,资产结构和质量更加优化,极大减少了对绿电补贴的依赖,实现持续滚动发展。2021年,实现年投产容量百万千瓦,并创造200兆瓦电站工程最短工期记录。2022年 ,年度开发指标获取创历史新高,公司基地项目申报实现零突破,连续实现年投产容量超百万千瓦,在MSCI的ESG评级中获评为A级。",
"speed": {
"2": 0.5,
"6": 0.14,
"33": 0.04,
"54": 0.13,
"61": 0.10,
"73": 0.13,
"81": 0.10,
"93": 0.13,
"105": 0.11,
"115": 0.13,
"126": 0.10,
"143": 0.13,
"149": 0.09
},
"speedPreSec":4.4,
"pauseTime": 60,
"text_match": {
"工区": "公区",
"奥比": "奥北",
@@ -20,6 +38,7 @@
"克然": "客人",
"早一下": "找一下"
},

"clothes": {
"SweetGirl": [
"suit_blue",


+ 5
- 0
public/index.html 查看文件

@@ -7,7 +7,12 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="x-dns-prefetch-control" content="on" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="https://tan-xin.oss-cn-qingdao.aliyuncs.com/vconsole.min.js"></script>
<script>
// var vConsole = new VConsole();
</script>
<link rel="icon" href="<%= BASE_URL %>favicon.ico">

<style>
body {
height: 100% !important;


+ 1
- 1
src/App.vue 查看文件

@@ -137,6 +137,7 @@ export default {
window.socketTimer = undefined;
window.closeTimer = undefined;
window.Cloudia = Cloudia;
window.$ = $;
},
destroyed() {
// console.log("=========app destroyed====");
@@ -196,7 +197,6 @@ export default {
message: "您好,我是小酷。"
}
];
window.Cloudia && window.Cloudia.setClothes("suit_blue");
},
leaveAdPage() {
this.sleep = false;


+ 143
- 29
src/mixins/mixin.js 查看文件

@@ -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() {


Loading…
取消
儲存