Commit b881b66f by 李宁

1

1 parent a58d16a8
......@@ -23,7 +23,10 @@
"Bash(lsof -ti:8080)",
"Bash(python3 -m http.server 8081)",
"Bash(open \"http://localhost:8081/zjbPhone/busiDetail.html\")",
"Bash(open \"http://localhost:8081/zjbPhone/addBusi.html\")"
"Bash(open \"http://localhost:8081/zjbPhone/addBusi.html\")",
"Bash(lsof -ti:8080,8081)",
"Bash(kill 33038 46309)",
"Bash(open \"http://localhost:8081/myBusi.html\")"
],
"deny": [],
"ask": []
......
......@@ -18,7 +18,8 @@ new Vue({
{ id: '4', name: '已成单', selected: false, nodeId: '355:540' },
{ id: '5', name: '已关闭', selected: false, nodeId: '355:543' }
],
businessList: []
businessList: [],
scrollTop: 0
},
computed: {
......@@ -61,6 +62,11 @@ new Vue({
}).then(res=>{
if(res.code == 200){
this.detail = res.data
this.$nextTick(() => {
this.updateActiveIndicator(this.activeTab);
document.querySelector('#listDiv').scrollTop = this.scrollTop||0
});
}
})
},
......@@ -109,6 +115,8 @@ new Vue({
// 查看商机详情
viewBusinessDetail(business) {
console.log('查看商机详情:', business);
// 保存当前页面状态
this.savePageState();
// 实际项目中这里应该跳转到详情页面
window.location.href = `busiDetail.html?id=${business.id}`;
},
......@@ -147,9 +155,50 @@ new Vue({
return 'completed'
}
},
// 保存页面状态
savePageState() {
const state = {
searchKeyword: this.searchKeyword,
activeTab: this.activeTab,
tagId: this.tagId,
scrollTop: document.querySelector('#listDiv').scrollTop,
timestamp: Date.now()
};
localStorage.setItem('myBusiPageState', JSON.stringify(state));
},
// 恢复页面状态
restorePageState() {
const savedState = localStorage.getItem('myBusiPageState');
if (savedState) {
try {
const state = JSON.parse(savedState);
// 检查状态是否在30分钟内保存的(避免过期状态)
const isRecent = (Date.now() - state.timestamp) < 30 * 60 * 1000;
if (isRecent) {
this.searchKeyword = state.searchKeyword || '';
this.activeTab = state.activeTab || 'all';
this.tagId = state.tagId || 'all';
this.scrollTop = state.scrollTop
}
} catch (e) {
console.error('恢复页面状态失败:', e);
}
this.clearPageState()
}
},
// 清除页面状态
clearPageState() {
localStorage.removeItem('myBusiPageState');
},
loginOut(){
localStorage.removeItem('userInfo')
localStorage.removeItem('tokenInfo')
this.clearPageState()
location.replace('login.html?platform='+localStorage.getItem('platform'))
}
......@@ -170,10 +219,8 @@ new Vue({
mounted() {
this.isWorker = localStorage.getItem('platform')=='gw'
// 延迟更新指示器位置,确保DOM已渲染
this.$nextTick(() => {
this.updateActiveIndicator(this.activeTab);
});
// 恢复页面状态
this.restorePageState();
this.queryBusiList()
},
......
......@@ -70,7 +70,7 @@
</div>
<!-- 商机列表 -->
<div class="business-list">
<div class="business-list" id="listDiv">
<div
v-for="(business, index) in detail.records"
:key="business.id"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!