Commit 37286d30 by liaoym

修复样式

1 parent 8cba28ac
No preview for this file type
...@@ -404,7 +404,7 @@ export default { ...@@ -404,7 +404,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.task-box { .task-box {
padding-top: toRpx(32); padding-top: toRpx(32);
height: calc(100% - #{toRpx(100)}); height: calc(100% + #{toRpx(72)});
} }
.tab-list { .tab-list {
......
...@@ -103,6 +103,9 @@ ...@@ -103,6 +103,9 @@
confirm-type="search" confirm-type="search"
@confirm="handleSearch" @confirm="handleSearch"
/> />
<view class="clear-btn" @click.stop="clearSearch" v-if="searchKeyword">
<uni-icons type="closeempty" size="16" color="#999ea8"></uni-icons>
</view>
</view> </view>
</view> </view>
...@@ -276,6 +279,11 @@ export default { ...@@ -276,6 +279,11 @@ export default {
console.log('搜索关键词:', this.searchKeyword) console.log('搜索关键词:', this.searchKeyword)
// TODO: 调用课程列表接口,传入搜索关键词 // TODO: 调用课程列表接口,传入搜索关键词
}, },
// 清空搜索
clearSearch() {
this.searchKeyword = ''
this.handleSearch()
},
// 打开筛选弹窗 // 打开筛选弹窗
openFilter() { openFilter() {
this.$refs.orderScreen.open() this.$refs.orderScreen.open()
...@@ -785,6 +793,17 @@ export default { ...@@ -785,6 +793,17 @@ export default {
color: #333333; color: #333333;
text-align: center; text-align: center;
} }
.clear-btn {
position: absolute;
right: toRpx(32);
display: flex;
align-items: center;
justify-content: center;
width: toRpx(48);
height: toRpx(48);
cursor: pointer;
}
} }
} }
...@@ -846,8 +865,9 @@ export default { ...@@ -846,8 +865,9 @@ export default {
font-size: toRpx(24); font-size: toRpx(24);
color: #FF9D0A; color: #FF9D0A;
height: toRpx(48); height: toRpx(48);
margin: toRpx(0) toRpx(40);
margin-top: toRpx(32); margin-top: toRpx(32);
margin-left: toRpx(18);
&-text { &-text {
margin-top: toRpx(4); margin-top: toRpx(4);
......
...@@ -129,7 +129,7 @@ export default { ...@@ -129,7 +129,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 toRpx(64); padding: 0 toRpx(64);
margin-top: toRpx(32); margin-top: toRpx(52);
.tab-item { .tab-item {
width: toRpx(208); width: toRpx(208);
height: toRpx(72); height: toRpx(72);
......
...@@ -117,7 +117,7 @@ export default { ...@@ -117,7 +117,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 0 toRpx(64); padding: 0 toRpx(64);
margin-top: toRpx(32); margin-top: toRpx(52);
margin-bottom: toRpx(32); margin-bottom: toRpx(32);
.tab-item { .tab-item {
width: toRpx(208); width: toRpx(208);
......
...@@ -19,7 +19,12 @@ ...@@ -19,7 +19,12 @@
class="webview-window" class="webview-window"
v-if="webviewUrl" v-if="webviewUrl"
> >
<web-view :src="webviewUrl"></web-view> <web-view :src="webviewUrl" @onPostMessage="handlePostMessage"></web-view>
</view>
<!-- 全屏 Loading -->
<view class="loading-overlay" v-if="showLoading">
<image class="loading-icon" src="../../assets/images/common/loadding.gif" mode="aspectFit" />
</view> </view>
</view> </view>
...@@ -33,7 +38,8 @@ export default { ...@@ -33,7 +38,8 @@ export default {
webviewUrl: '', webviewUrl: '',
pageTitle: '学习测评', pageTitle: '学习测评',
wv: null, wv: null,
hotArea: null // 存储热区对象 hotArea: null, // 存储热区对象
showLoading: true // 控制 loading 显示
} }
}, },
onLoad (options) { onLoad (options) {
...@@ -69,6 +75,14 @@ export default { ...@@ -69,6 +75,14 @@ export default {
this.createHotArea() this.createHotArea()
// this.hideThirdPartyBackButton() // 不隐藏第三方按钮,只用热区拦截点击 // this.hideThirdPartyBackButton() // 不隐藏第三方按钮,只用热区拦截点击
}, 1000) }, 1000)
// 设置超时自动隐藏 loading(防止页面加载失败一直显示 loading)
setTimeout(() => {
if (this.showLoading) {
console.log('⏰ 超时自动关闭 loading')
this.showLoading = false
}
}, 10000) // 10秒后自动关闭
}, },
beforeDestroy() { beforeDestroy() {
// 销毁热区 // 销毁热区
...@@ -112,6 +126,15 @@ export default { ...@@ -112,6 +126,15 @@ export default {
height: 'calc(100% - 136rpx)' // 减去顶部导航栏高度 height: 'calc(100% - 136rpx)' // 减去顶部导航栏高度
}) })
console.log('✅ webview 样式设置成功') console.log('✅ webview 样式设置成功')
// 监听 webview 加载完成事件
wv.addEventListener('loaded', () => {
console.log('✅ webview 加载完成,关闭 loading')
setTimeout(() => {
this.showLoading = false
}, 300)
}, false)
return true return true
} else { } else {
console.log('⚠️ 未找到 webview 对象') console.log('⚠️ 未找到 webview 对象')
...@@ -148,6 +171,17 @@ export default { ...@@ -148,6 +171,17 @@ export default {
} }
}) })
}, },
// 处理 webview 发送的消息
handlePostMessage(e) {
console.log('📨 收到 webview 消息:', e)
// webview 加载完成后隐藏 loading
if (this.showLoading) {
setTimeout(() => {
console.log('✅ webview 消息触发,关闭 loading')
this.showLoading = false
}, 500)
}
},
// 创建透明热区覆盖在返回按钮位置,拦截点击事件 // 创建透明热区覆盖在返回按钮位置,拦截点击事件
createHotArea() { createHotArea() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
...@@ -230,5 +264,23 @@ export default { ...@@ -230,5 +264,23 @@ export default {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
} }
.loading-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #ffffff;
display: flex;
align-items: center;
justify-content: center;
z-index: 99999;
.loading-icon {
width: toRpx(100);
height: toRpx(100);
}
}
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!