Commit ee58da18 by 李伟康

"优化对话组件音频初始化逻辑及样式圆角处理"

1 parent 3a610ccf
/* packageEquity/pages/receptionDetail/components/dialogue/dialogue.wxss */
/* pages/test.wxss */
.flex{
.flex {
display: flex;
align-items: center;
}
.view {
width: calc(100% - 56rpx);
left: 28rpx;
position: relative;
height: 100%;
background: #f5f8fc;
border-radius: 16rpx 16rpx 0 0;
.scroll-view {
height: 100%;
background-color: #fff;
animation: show-view .75s forwards;
border-radius: 16rpx 16rpx 0 0;
}
@keyframes show-view {
......@@ -104,6 +106,7 @@
.color-2 {
color: #FF6053;
.violation-text {
border-color: #ff60531a;
background: #fff4f2;
......@@ -112,6 +115,7 @@
.color-1 {
color: #7F80FE;
.violation-text {
border-color: #7f80fe1a;
background: #f2f2fe;
......@@ -159,6 +163,7 @@
background: #f5f8fc;
overflow: hidden;
opacity: 0;
.content-box {
transform: translateY(-100%);
}
......@@ -317,7 +322,8 @@
.up {
height: auto;
opacity:1;
opacity: 1;
.arrow {
transform: rotate(90deg);
}
......@@ -456,12 +462,14 @@
border-radius: 100%;
box-sizing: border-box;
}
.default-axis-dot{
.default-axis-dot {
width: var(--fontSize36);
height: var(--fontSize36);
border: var(--fontSize6) solid #347BFF;
border: var(--fontSize6) solid #347BFF;
z-index: 9;
}
.axis-text {
position: absolute;
right: var(--fontSize20);
......@@ -474,7 +482,7 @@
padding: 0 var(--fontSize22) 0 var(--fontSize12);
transform: translateY(-50%);
white-space: nowrap;
background: #347bff1a;
background: #347bff1a;
/* 防止文本换行 */
}
......@@ -489,6 +497,7 @@
border: none;
box-shadow: 0 var(--fontSize4) var(--fontSize16) 0 #7a7a7a33;
border-radius: 0 100% 100% 0;
&::after {
position: absolute;
content: '';
......@@ -551,16 +560,18 @@
text-align: center;
color: #8A8C90;
}
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #999ea8;
font-size: 24rpx;
background: #fff;
.icon {
width: 172rpx;
height: 172rpx;
}
}
\ No newline at end of file
.nothing {
width: 100%;
height: 100%;
flex-direction: column;
justify-content: center;
color: #999ea8;
font-size: 24rpx;
background: #fff;
.icon {
width: 172rpx;
height: 172rpx;
}
}
\ No newline at end of file
......@@ -11,36 +11,36 @@ Component({
recordData: Object,
batchId: {
type: Number,
observer: function(n) {
observer: function (n) {
console.log(n, '====123456')
thisPage = wx.$router.getPageInstance()
this.innerAudioContext = thisPage.qualityAudio
const data = {
batchId: n,
currentPage: 1,
pageSize: 999999,
};
this.findConversationDetailByBatchId(data)
this.findCbByBatchId(data)
// thisPage = wx.$router.getPageInstance()
// this.innerAudioContext = thisPage.qualityAudio
const data = {
batchId: n,
currentPage: 1,
pageSize: 999999,
};
this.findConversationDetailByBatchId(data)
this.findCbByBatchId(data)
}
},
autoPlayConfig: Object
},
lifetimes: {
ready() {
thisPage = wx.$router.getPageInstance()
this.innerAudioContext = thisPage.qualityAudio
const {
batchId
} = this.data
const data = {
batchId,
currentPage: 1,
pageSize: 999999,
};
// this.innerAudioContext.onCanplay(() => {
this.findConversationDetailByBatchId(data)
this.findCbByBatchId(data)
// thisPage = wx.$router.getPageInstance()
// this.innerAudioContext = thisPage.qualityAudio
// const {
// batchId
// } = this.data
// const data = {
// batchId,
// currentPage: 1,
// pageSize: 999999,
// };
// // this.innerAudioContext.onCanplay(() => {
// this.findConversationDetailByBatchId(data)
// this.findCbByBatchId(data)
},
detached() {
this.IntersectionObserver?.disconnect()
......@@ -179,6 +179,13 @@ Component({
}
})
},
getAudioObject() {
thisPage = wx.$router.getPageInstance()
if (thisPage.qualityAudio) this.innerAudioContext = thisPage.qualityAudio
else setTimeout(() => {
this.getAudioObject()
}, 100)
},
/**对话列表 */
async findConversationDetailByBatchId(params) {
function numberToChinese(num) {
......@@ -189,6 +196,7 @@ Component({
throw new Error('Number must be between 1 and 10');
}
}
this.getAudioObject()
const {
data: dialogueList
} = await api.post("dj.api.smartcarlife.recepiton.findConversationDetailByBatchId", params), {
......@@ -244,7 +252,7 @@ Component({
e.appealClass = e.conversationDetailAppealId ? 'appeal-disabled' : ''
}
}
if (autoPlayConfig.auto && e.violationFlag == 1 && !this.autoPlayItem) this.autoPlayItem = e
if (autoPlayConfig.auto && e.violationFlag == 1 && !this.autoPlayItem) this.autoPlayItem = e
})
this.setData({
flag: true,
......
......@@ -74,6 +74,7 @@ Page({
showViolationBtn,
autoPlayConfig
}, () => {
this.setWarpHeight()
this.setAudio()
})
}
......@@ -82,7 +83,11 @@ Page({
},
back() {
if (this.qualityAudio) this.qualityAudio.pause()
wx.$router.back()
wx.navigateBack().catch(() => {
wx.reLaunch({
url: '/pages/loading/loading',
})
})
},
onHandle(e) {
let {
......@@ -220,17 +225,40 @@ Page({
auto: true
}
}
console.log(options)
this.setData({
record: options,
typeLists: options.hideScore ? typeLists.splice(0, 1) : typeLists,
showViolationBtn,
autoPlayConfig
}, () => {
this.setWarpHeight()
this.setAudio()
})
}
},
setWarpHeight() {
wx.$util.getViewInfo('.reception-wrap', ({
height
}) => {
let {
showViolationBtn,
userInfo
} = this.data
if (showViolationBtn && (userInfo.isSuper || userInfo.loginRole == 3 || userInfo.loginRole == 6)) {
wx.$util.getViewInfo('.violation-btn-box', ({
height: btnHeight
}) => {
this.setData({
receptionWrapHeight: `${(height + btnHeight) * 2}rpx`
})
})
} else this.setData({
receptionWrapHeight: `${height * 2}rpx`
})
})
},
changeType(e) {
let {
index
......@@ -254,25 +282,6 @@ Page({
this.setData({
navBarHeight,
});
wx.$util.getViewInfo('.reception-wrap', ({
height
}) => {
let {
showViolationBtn,
userInfo
} = this.data
if (showViolationBtn && (userInfo.isSuper || userInfo.loginRole == 3 || userInfo.loginRole == 6)) {
wx.$util.getViewInfo('.violation-btn-box', ({
height: btnHeight
}) => {
this.setData({
receptionWrapHeight: `${(height + btnHeight) * 2}rpx`
})
})
} else this.setData({
receptionWrapHeight: `${height * 2}rpx`
})
})
},
dialogueRef() {
return this.selectComponent('#dialogue')
......@@ -361,7 +370,7 @@ Page({
* 生命周期函数--监听页面隐藏
*/
onHide() {
if(this.options.new) return
if (this.options.new) return
this.qualityAudio.stop()
this.onPageHide()
},
......@@ -370,7 +379,7 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload() {
if(this.options.new) return
if (this.options.new) return
this.qualityAudio?.stop()
this.onPageHide()
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!