This commit is contained in:
2025-08-13 14:53:35 +08:00
parent 1f5f069988
commit b2009403d8
13 changed files with 761 additions and 282 deletions

View File

@@ -33,6 +33,18 @@ export default {
}
})
},
refreshPrevPageData(reset) {
const pages = getCurrentPages(); // 当前页面栈
if (pages.length > 1) {
const prevPage = pages[pages.length - 2]; // 上一页实例
if (prevPage && typeof prevPage.refreshData === 'function') {
console.log('at line 514:', '调用刷新函数')
prevPage.refreshData(reset); // 调用刷新函数
}
}
uni.navigateBack({ delta: 1 });
},
//复制内容
handleCopy(value, title) {
uniCopy({
@@ -44,22 +56,22 @@ export default {
})
},
error: (e) => {
}
})
},
//用户协议
async getAgreement(id) {
async getAgreement(id) {
console.log('id at line 56:', id)
var data = {
id: id
}
var result = {
title:'',
content:''
title: '',
content: ''
}
await $http
await $http
.request({
url: "sys/agreement/getAgreement",
method: "POST",
@@ -111,8 +123,8 @@ export default {
}
},
});
},
// 注销账户
},
// 注销账户
logout() {
let that = this;
uni.showModal({

View File

@@ -25,5 +25,35 @@ function debounce(func, wait = 500, immediate = false) {
}, wait)
}
}
export default debounce
function throttle(fn, delay = 1000, immediate = false) {
console.log("进入节流对象")
let timer
let status = false // 是否为重复点击状态
return function () {
let _this = this
let args = arguments
if (immediate) {
console.log("立即执行参数 执行一次方法")
fn.apply(_this, args)
immediate = false
return
}
if (status) {
console.log("当前点击状态为正在重复点击,请稍等片刻后在点击执行")
return
}
console.log("执行节流:当前执行了一次点击方法")
fn.apply(_this, args)
status = true // 修改状态
timer = setTimeout(() => {
console.log("规定时间到,重置状态,可以重新调用")
status = false
}, delay)
}
}
export {
debounce,
throttle
}