|
@@ -64,7 +64,7 @@ export default {
|
|
|
crossShow: false, //注释点+显示
|
|
|
expressionShow: false, //表情图片对显示
|
|
|
dotShow: false, //选项点显示
|
|
|
- arrList: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], //取样数组
|
|
|
+ arrList: ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10"], //取样数组
|
|
|
randomArr: [], //十个人全取加2个随机人
|
|
|
blockList1: [], //block数据1
|
|
|
blockList2: [], //block数据2
|
|
@@ -84,6 +84,8 @@ export default {
|
|
|
topImg: "", //上边图片
|
|
|
bottomImg: "", //下边图片
|
|
|
isLoading: false,
|
|
|
+
|
|
|
+ baseUrlPort: ''
|
|
|
};
|
|
|
},
|
|
|
// 页面初始化函数
|
|
@@ -93,6 +95,7 @@ export default {
|
|
|
this.banClickVoice = new Audio(require("../../assets/ban.mp3"));
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.baseUrlPort = window.location.origin
|
|
|
//进入页面即初始化开始测试
|
|
|
this.startTest();
|
|
|
},
|
|
@@ -236,12 +239,12 @@ export default {
|
|
|
dotPos: index >= 6 ? "0" : "1", //0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-happy-${rank + 1}.jpg`
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg`, //图片地址
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-happy-${rank > 8 ? rank + 1 : '0' + (rank + 1)}.jpg`
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg`, //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg` //图片地址
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-happy-${rank + 1}.jpg`
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg` //图片地址
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-happy-${rank > 8 ? rank + 1 : '0' + (rank + 1)}.jpg`
|
|
|
});
|
|
|
//害怕-1
|
|
|
this.blockList1.push({
|
|
@@ -255,12 +258,12 @@ export default {
|
|
|
dotPos: index >= 6 ? "0" : "1", //0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-fear-${rank + 1}.jpg`
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg`, //图片地址
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-happy-${rank > 8 ? rank + 1 : '0' + (rank + 1)}.jpg`
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg`, //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg` //图片地址
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-fear-${rank + 1}.jpg`
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg` //图片地址
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-happy-${rank > 8 ? rank + 1 : '0' + (rank + 1)}.jpg`
|
|
|
});
|
|
|
//开心-2
|
|
|
this.blockList2.push({
|
|
@@ -274,12 +277,12 @@ export default {
|
|
|
dotPos: index >= 6 ? "0" : "1", //0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-happy-${rank + 1}-jumble.jpg`
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg`, //图片地址
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-happy-${rank > 8 ? rank + 1 : '0' + (rank + 1)}-jumble.jpg`
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg`, //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg` //图片地址
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-happy-${rank + 1}-jumble.jpg`
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg` //图片地址
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-happy-${rank > 8 ? rank + 1 : '0' + (rank + 1)}-jumble.jpg`
|
|
|
});
|
|
|
//害怕-2
|
|
|
this.blockList2.push({
|
|
@@ -293,12 +296,12 @@ export default {
|
|
|
dotPos: index >= 6 ? "0" : "1", //点位置0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-fear-${rank + 1}-jumble.jpg`
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg`, //图片地址
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-fear-${rank > 8 ? rank + 1 : '0' + (rank + 1)}-jumble.jpg`
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg`, //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? `http://localhost:8080/static/assets/ETBnew/${item}-neutral.jpg` //图片地址
|
|
|
- : `http://localhost:8080/static/assets/ETBnew/${item}-fear-${rank + 1}-jumble.jpg`
|
|
|
+ ? `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-neutral.jpg` //图片地址
|
|
|
+ : `${this.baseUrlPort}/static/assets/ETBnew/${ (Number(item) > 5 ? 'm' : 'f') + item}-fear-${rank > 8 ? rank + 1 : '0' + (rank + 1)}-jumble.jpg`
|
|
|
});
|
|
|
});
|
|
|
},
|
|
@@ -314,13 +317,13 @@ export default {
|
|
|
},
|
|
|
async imgListSerialize() {
|
|
|
// 按情绪等级图片数组序列化
|
|
|
- await this.initImgList(0);
|
|
|
- await this.initImgList(1);
|
|
|
- await this.initImgList(2);
|
|
|
- await this.initImgList(3);
|
|
|
+ await this.initImgList(0)
|
|
|
+ await this.initImgList(1)
|
|
|
+ await this.initImgList(2)
|
|
|
+ await this.initImgList(3)
|
|
|
//打乱数组序列
|
|
|
- await this.shuffle(this.blockList1);
|
|
|
- await this.shuffle(this.blockList2);
|
|
|
+ await this.shuffle(this.blockList1)
|
|
|
+ await this.shuffle(this.blockList2)
|
|
|
//图片数组添加序列号
|
|
|
this.blockList1.map((item, i) => {
|
|
|
return (item.index = i);
|
|
@@ -329,8 +332,8 @@ export default {
|
|
|
return (item.index = i);
|
|
|
});
|
|
|
// 图片预加载
|
|
|
- await this.imgsPreloader(this.blockList1);
|
|
|
- await this.imgsPreloader(this.blockList2);
|
|
|
+ await this.imgsPreloader(this.blockList1)
|
|
|
+ await this.imgsPreloader(this.blockList2)
|
|
|
|
|
|
// 初始化图片完成后开始倒计时进入测试
|
|
|
// this.countDown();
|