Commit e88e8bf3 by Ken Nakahira

提交更新代码

parent 33c3fea5
...@@ -365,12 +365,13 @@ ...@@ -365,12 +365,13 @@
<scroll-view <scroll-view
:scroll-y="true" :scroll-y="true"
:scroll-top="scrollTop_pangbai" :scroll-top="scrollTop_pangbai"
:style="{height: '7.5rem'}" :style="{height: boxHeight + 'rpx'}"
:scroll-into-view="bottomElement_pangbai" :scroll-into-view="bottomElement_pangbai"
class="pangbai_content" class="pangbai_content"
id="pangbaiBox"
> >
<view id="scrollView"> <view id="scrollView">
<view class="npc" id="pangbai">{{yyds_pangbai}}</view> <view class="npc" :style="{fontSize: fontSize + 'rpx'}">{{yyds_pangbai}}</view>
<!-- 最后一个元素,用于滚动定位 --> <!-- 最后一个元素,用于滚动定位 -->
<view id="bottomElement_pangbai"></view> <view id="bottomElement_pangbai"></view>
</view> </view>
...@@ -504,6 +505,8 @@ export default { ...@@ -504,6 +505,8 @@ export default {
'中国大陆少女口音3': 'zh-CN-YunxiaNeural', '中国大陆少女口音3': 'zh-CN-YunxiaNeural',
}, },
Allvoice:[], Allvoice:[],
fontSize:0,
boxHeight:210,
worldParameter:[] worldParameter:[]
} }
}, },
...@@ -567,7 +570,7 @@ export default { ...@@ -567,7 +570,7 @@ export default {
//获取历史聊天记录 根据历史记录处理决定 websocket 的连接 //获取历史聊天记录 根据历史记录处理决定 websocket 的连接
this.getHistory() this.getHistory()
this.calcFontSize(26)
//讲完话以后 向服务器发送数据 //讲完话以后 向服务器发送数据
recorderManager.onStop( res=> { recorderManager.onStop( res=> {
...@@ -739,11 +742,14 @@ export default { ...@@ -739,11 +742,14 @@ export default {
}); });
}, },
calcFontSize() { calcFontSize(size) {
let windowInfo = wx.getWindowInfo(); let windowInfo = wx.getWindowInfo();
let FontSizeRPX = 26 / (430/750); let FontSizeRPX = size * (428/750);
let FontSizePX = FontSizeRPX * (windowInfo.windowWidth/750); let FontSizePX = FontSizeRPX / (windowInfo.windowWidth/750);
document.getElementById('pangbai').style.fontSize = FontSizePX; let pangbaiHeightRPX = 210 * (428/750);
let pangbaiHeightPX = pangbaiHeightRPX / (windowInfo.windowWidth/750);
this.fontSize = FontSizePX;
this.height = 210;
}, },
splitString(str) { splitString(str) {
...@@ -3028,7 +3034,6 @@ export default { ...@@ -3028,7 +3034,6 @@ export default {
position:relative; position:relative;
} }
.pangbai_content{ .pangbai_content{
height: 250rpx;
overflow: scroll; overflow: scroll;
color: #fff; color: #fff;
padding: 12rpx; padding: 12rpx;
...@@ -3202,8 +3207,8 @@ export default { ...@@ -3202,8 +3207,8 @@ export default {
.npc{ .npc{
word-break:break-all; word-break:break-all;
white-space:pre-wrap; white-space:pre-wrap;
font-size: 26rpx;
padding-right: 16rpx; padding-right: 16rpx;
font-size: 86%;
} }
.confirm{ .confirm{
width: 160rpx; width: 160rpx;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -605,6 +605,7 @@ var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runt ...@@ -605,6 +605,7 @@ var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runt
// //
// //
// //
//
// import FullScreenLoading from '../../components/FullScreenLoading.vue'; // import FullScreenLoading from '../../components/FullScreenLoading.vue';
var recorderManager = uni.getRecorderManager(); var recorderManager = uni.getRecorderManager();
...@@ -703,6 +704,8 @@ var _default = { ...@@ -703,6 +704,8 @@ var _default = {
'中国大陆少女口音3': 'zh-CN-YunxiaNeural' '中国大陆少女口音3': 'zh-CN-YunxiaNeural'
}, },
Allvoice: [], Allvoice: [],
fontSize: 0,
boxHeight: 210,
worldParameter: [] worldParameter: []
}; };
}, },
...@@ -765,6 +768,7 @@ var _default = { ...@@ -765,6 +768,7 @@ var _default = {
//获取历史聊天记录 根据历史记录处理决定 websocket 的连接 //获取历史聊天记录 根据历史记录处理决定 websocket 的连接
this.getHistory(); this.getHistory();
this.calcFontSize(26);
//讲完话以后 向服务器发送数据 //讲完话以后 向服务器发送数据
recorderManager.onStop(function (res) { recorderManager.onStop(function (res) {
...@@ -939,11 +943,14 @@ var _default = { ...@@ -939,11 +943,14 @@ var _default = {
}).exec(); }).exec();
}); });
}, },
calcFontSize: function calcFontSize() { calcFontSize: function calcFontSize(size) {
var windowInfo = wx.getWindowInfo(); var windowInfo = wx.getWindowInfo();
var FontSizeRPX = 26 / (430 / 750); var FontSizeRPX = size * (428 / 750);
var FontSizePX = FontSizeRPX * (windowInfo.windowWidth / 750); var FontSizePX = FontSizeRPX / (windowInfo.windowWidth / 750);
document.getElementById('pangbai').style.fontSize = FontSizePX; var pangbaiHeightRPX = 210 * (428 / 750);
var pangbaiHeightPX = pangbaiHeightRPX / (windowInfo.windowWidth / 750);
this.fontSize = FontSizePX;
this.height = 210;
}, },
splitString: function splitString(str) { splitString: function splitString(str) {
var result = []; var result = [];
......
...@@ -963,7 +963,6 @@ to { ...@@ -963,7 +963,6 @@ to {
position:relative; position:relative;
} }
.pangbai_content.data-v-57280228{ .pangbai_content.data-v-57280228{
height: 250rpx;
overflow: scroll; overflow: scroll;
color: #fff; color: #fff;
padding: 12rpx; padding: 12rpx;
...@@ -1135,8 +1134,8 @@ to { ...@@ -1135,8 +1134,8 @@ to {
.npc.data-v-57280228{ .npc.data-v-57280228{
word-break:break-all; word-break:break-all;
white-space:pre-wrap; white-space:pre-wrap;
font-size: 26rpx;
padding-right: 16rpx; padding-right: 16rpx;
font-size: 86%;
} }
.confirm.data-v-57280228{ .confirm.data-v-57280228{
width: 160rpx; width: 160rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment