diff --git a/app.js b/app.js index 1d3c6e2..1c78299 100644 --- a/app.js +++ b/app.js @@ -2,5 +2,6 @@ const { checkLogin } = require('./utils/logcheck'); App({ onLaunch() { // checkLogin(); - } + }, + }); diff --git a/pages/personCenter/commissionSetting/commissionSetting.js b/pages/personCenter/commissionSetting/commissionSetting.js index ee23691..1dd9c1c 100644 --- a/pages/personCenter/commissionSetting/commissionSetting.js +++ b/pages/personCenter/commissionSetting/commissionSetting.js @@ -6,7 +6,7 @@ Page({ /** * 生命周期函数--监听页面加载 */ - onLoad(options) { + onLoad() { this.getProjectList() this.getFixedRate() }, @@ -126,53 +126,27 @@ Page({ }) }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { +* 页面相关事件处理函数--监听用户下拉动作 +*/ +onPullDownRefresh: function () { + this.onRefresh(); +}, +onRefresh:function(){ + //导航条加载动画 + wx.showNavigationBarLoading() + //loading 提示框 + wx.showLoading({ + title: '加载中...', + }) + console.log("下拉刷新啦"); + this.onLoad() + setTimeout(function () { + wx.hideLoading(); + wx.hideNavigationBarLoading(); + //停止下拉刷新 + wx.stopPullDownRefresh(); + }, 1000) +}, - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } }) \ No newline at end of file diff --git a/pages/personCenter/commissionSetting/commissionSetting.json b/pages/personCenter/commissionSetting/commissionSetting.json index 2969084..f1e8649 100644 --- a/pages/personCenter/commissionSetting/commissionSetting.json +++ b/pages/personCenter/commissionSetting/commissionSetting.json @@ -2,5 +2,6 @@ "usingComponents": { "commissionPop": "/pages/personCenter/component/commissionPop/commissionPop", "commissionRatePop": "/pages/personCenter/component/commissionRatePop/commissionRatePop" - } + }, + "enablePullDownRefresh": true } \ No newline at end of file diff --git a/pages/personCenter/component/commissionPop/commissionPop.js b/pages/personCenter/component/commissionPop/commissionPop.js index 142df09..4b0ec66 100644 --- a/pages/personCenter/component/commissionPop/commissionPop.js +++ b/pages/personCenter/component/commissionPop/commissionPop.js @@ -32,7 +32,7 @@ import { baseUrl } from "../../../../request";Component({ // 提交设置 submit() { const rate = parseFloat(this.data.commissionRate); - if (isNaN(rate) || rate <= 0 || rate > 5) { + if (isNaN(rate) || rate < 0 || rate > 10) { wx.showToast({ title: `请输入有效的比例,最大为 5%`, icon: 'none', diff --git a/pages/personCenter/subCommissionSetting/subCommissionSetting.js b/pages/personCenter/subCommissionSetting/subCommissionSetting.js index d5a7a0e..a1a221a 100644 --- a/pages/personCenter/subCommissionSetting/subCommissionSetting.js +++ b/pages/personCenter/subCommissionSetting/subCommissionSetting.js @@ -99,52 +99,25 @@ Page({ this.getSubCommissionList() }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady() { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow() { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide() { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload() { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh() { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom() { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage() { - - } + /** +* 页面相关事件处理函数--监听用户下拉动作 +*/ +onPullDownRefresh: function () { + this.onRefresh(); +}, +onRefresh:function(){ + //导航条加载动画 + wx.showNavigationBarLoading() + //loading 提示框 + wx.showLoading({ + title: '加载中...', + }) + this.getSubCommissionList() + setTimeout(function () { + wx.hideLoading(); + wx.hideNavigationBarLoading(); + //停止下拉刷新 + wx.stopPullDownRefresh(); + }, 1000) +}, }) \ No newline at end of file diff --git a/pages/personCenter/subCommissionSetting/subCommissionSetting.json b/pages/personCenter/subCommissionSetting/subCommissionSetting.json index ae91d9f..dd798e3 100644 --- a/pages/personCenter/subCommissionSetting/subCommissionSetting.json +++ b/pages/personCenter/subCommissionSetting/subCommissionSetting.json @@ -1,5 +1,6 @@ { "usingComponents": { "commissionRatePop": "/pages/personCenter/component/commissionRatePop/commissionRatePop" - } + }, + "enablePullDownRefresh": true } \ No newline at end of file diff --git a/pages/projectModule/projectList/projectList.js b/pages/projectModule/projectList/projectList.js index 335879c..28f84a2 100644 --- a/pages/projectModule/projectList/projectList.js +++ b/pages/projectModule/projectList/projectList.js @@ -64,4 +64,31 @@ Page({ url: `/pages/projectModule/projectDetail/projectDetail?id=${projectId}&isPromo=0` }); }, + +/** +* 页面相关事件处理函数--监听用户下拉动作 +*/ +onPullDownRefresh: function () { + this.onRefresh(); +}, +onRefresh:function(){ + //导航条加载动画 + wx.showNavigationBarLoading() + //loading 提示框 + wx.showLoading({ + title: '加载中...', + }) + console.log("下拉刷新啦"); + this.onLoad() + setTimeout(function () { + wx.hideLoading(); + wx.hideNavigationBarLoading(); + //停止下拉刷新 + wx.stopPullDownRefresh(); + }, 1000) +}, + + + + }); diff --git a/pages/projectModule/projectList/projectList.json b/pages/projectModule/projectList/projectList.json index a9401ea..f8a6cfa 100644 --- a/pages/projectModule/projectList/projectList.json +++ b/pages/projectModule/projectList/projectList.json @@ -1,4 +1,5 @@ { "navigationBarTitleText": "接单列表", - "usingComponents": {} + "usingComponents": {}, + "enablePullDownRefresh": true } \ No newline at end of file