feat(ui): 紫色主题完善、抢单端去自动刷新、我的页下拉刷新
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -58,6 +58,7 @@ Page(createPage({
|
||||
tongguoZongshu: 0,
|
||||
pendingShenheCount: 0,
|
||||
layoutSparse: false,
|
||||
scrollRefreshing: false,
|
||||
rankBoardList: [
|
||||
{ type: 'dashou', name: '接单员榜', sub: '接单成交', icon: '', shapeClass: 'rank-shape-left', themeClass: 'rank-theme-blue' },
|
||||
{ type: 'guanshi', name: '管事榜', sub: '邀请收入', icon: '', shapeClass: 'rank-shape-right', themeClass: 'rank-theme-gold' },
|
||||
@@ -196,15 +197,14 @@ Page(createPage({
|
||||
|
||||
this.registerNotificationComponent();
|
||||
this.checkRoleStatuses();
|
||||
this.applyCachedProfileFromGlobal();
|
||||
if (isCenterPageActive(this, 'isDashou', 'dashoustatus')) {
|
||||
if (!this.data.isDashou) this.setData({ isDashou: true });
|
||||
ensureRoleOnCenterPage(this, 'dashou');
|
||||
setTimeout(() => this.refreshAllInfo(false), 300);
|
||||
} else if (isRoleStatusActive(wx.getStorageSync('guanshistatus')) ||
|
||||
isRoleStatusActive(wx.getStorageSync('zuzhangstatus')) ||
|
||||
isRoleStatusActive(wx.getStorageSync('kaoheguanstatus'))) {
|
||||
ensureRoleOnCenterPage(this, 'dashou');
|
||||
setTimeout(() => this.refreshAllInfo(false), 300);
|
||||
}
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
@@ -304,6 +304,54 @@ Page(createPage({
|
||||
});
|
||||
},
|
||||
|
||||
applyCachedProfileFromGlobal() {
|
||||
const app = getApp();
|
||||
const g = app.globalData;
|
||||
const guanshi = g.guanshi || {};
|
||||
const patch = {
|
||||
dashouNicheng: g.dashouNicheng || this.data.dashouNicheng || '',
|
||||
zhanghaoStatus: g.zhanghaoStatus ?? this.data.zhanghaoStatus,
|
||||
yongjin: g.yongjin || this.data.yongjin || '0.00',
|
||||
zonge: g.zonge || this.data.zonge || '0.00',
|
||||
yajin: g.yajin || this.data.yajin || '0.00',
|
||||
chenghao: g.chenghao || this.data.chenghao || '',
|
||||
jinfen: g.jinfen || this.data.jinfen || '0',
|
||||
clumber: g.clumber || this.data.clumber || [],
|
||||
chengjiaoliang: g.chengjiaoliang || this.data.chengjiaoliang || '0',
|
||||
zaixianZhuangtai: g.zaixianZhuangtai ?? this.data.zaixianZhuangtai ?? 0,
|
||||
dashouzhuangtai: g.dashouzhuangtai ?? this.data.dashouzhuangtai,
|
||||
gszhstatus: guanshi.gszhstatus || this.data.gszhstatus || '',
|
||||
yaoqingzongshu: guanshi.yaoqingzongshu ?? this.data.yaoqingzongshu ?? 0,
|
||||
fenyongzonge: guanshi.fenyongzonge || this.data.fenyongzonge || '0.00',
|
||||
fenyongtixian: guanshi.fenyongtixian || this.data.fenyongtixian || '0.00',
|
||||
};
|
||||
this.setData(patch, () => this._updateTotalAssets());
|
||||
},
|
||||
|
||||
async onPullDownRefresh() {
|
||||
if (this._pullRefreshing) return;
|
||||
this._pullRefreshing = true;
|
||||
this.setData({ scrollRefreshing: true });
|
||||
try {
|
||||
this.checkRoleStatuses();
|
||||
await Promise.allSettled([
|
||||
this._fetchDashouInfoSilent(),
|
||||
this.fetchChenghaoList(),
|
||||
this._fetchGuanshiInfoSilent(),
|
||||
this.fetchGuanshiChenghaoList(),
|
||||
this._fetchZuzhangInfoSilent(),
|
||||
this._fetchKaoheguanInfoSilent(),
|
||||
]);
|
||||
this.checkRoleStatuses();
|
||||
wx.showToast({ title: '已更新', icon: 'success', duration: 1200 });
|
||||
} catch (e) {
|
||||
wx.showToast({ title: '刷新失败', icon: 'none' });
|
||||
} finally {
|
||||
this._pullRefreshing = false;
|
||||
this.setData({ scrollRefreshing: false });
|
||||
}
|
||||
},
|
||||
|
||||
async refreshAllInfo(showToast = true) {
|
||||
this.throttledRefresh(async () => {
|
||||
this.setData({ isLoading: true });
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"tab-bar": "/tab-bar/index"
|
||||
},
|
||||
"navigationStyle": "custom",
|
||||
"backgroundColor": "#fff8e1",
|
||||
"backgroundColor": "#f5f3ff",
|
||||
"backgroundTextStyle": "dark",
|
||||
"enablePullDownRefresh": false,
|
||||
"onReachBottomDistance": 50
|
||||
|
||||
@@ -33,7 +33,18 @@
|
||||
<image class="refresh-float-ico" src="{{imgUrls.iconRefresh}}" mode="aspectFit"/>
|
||||
</view>
|
||||
|
||||
<scroll-view class="content" scroll-y enhanced show-scrollbar="{{false}}">
|
||||
<scroll-view
|
||||
class="content"
|
||||
scroll-y
|
||||
enhanced
|
||||
show-scrollbar="{{false}}"
|
||||
refresher-enabled="{{true}}"
|
||||
refresher-threshold="80"
|
||||
refresher-default-style="black"
|
||||
refresher-background="#f5f3ff"
|
||||
refresher-triggered="{{scrollRefreshing}}"
|
||||
bindrefresherrefresh="onPullDownRefresh"
|
||||
>
|
||||
<!-- 用户信息 -->
|
||||
<view class="user-info flexb">
|
||||
<view class="flex">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* 打手端个人中心 - 逍遥梦 UI(逻辑不变) */
|
||||
|
||||
page {
|
||||
background: #fff8e1;
|
||||
background: #f5f3ff;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ page {
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
background: linear-gradient(180deg, #f7dc51 0%, #fff 28%, #fff8e1 100%);
|
||||
background: linear-gradient(180deg, #c4b5fd 0%, #fff 28%, #f5f3ff 100%);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ page {
|
||||
font-size: 20rpx;
|
||||
padding: 2rpx 12rpx;
|
||||
border-radius: 8rpx;
|
||||
background: linear-gradient(180deg, #fae04d, #ffc0a3);
|
||||
background: linear-gradient(180deg, #c4b5fd, #a78bfa);
|
||||
color: #492f00;
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ page {
|
||||
margin: 15rpx 30rpx 0;
|
||||
padding: 24rpx 20rpx;
|
||||
border-radius: 26rpx;
|
||||
background: #fef6d4;
|
||||
background: #ede9fe;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ page {
|
||||
font-weight: 700;
|
||||
border: 2rpx solid #fff;
|
||||
border-radius: 60rpx;
|
||||
background: linear-gradient(180deg, #fae04d, #ffc0a3);
|
||||
background: linear-gradient(180deg, #c4b5fd, #a78bfa);
|
||||
color: #492f00;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -237,7 +237,7 @@ page {
|
||||
margin: 16rpx 30rpx 0;
|
||||
padding: 20rpx 10rpx;
|
||||
border-radius: 15rpx;
|
||||
background: #fef6d4;
|
||||
background: #ede9fe;
|
||||
}
|
||||
|
||||
.freeze-col {
|
||||
@@ -259,7 +259,7 @@ page {
|
||||
}
|
||||
|
||||
.btn-bg {
|
||||
background: linear-gradient(180deg, #fae04d, #ffc0a3);
|
||||
background: linear-gradient(180deg, #c4b5fd, #a78bfa);
|
||||
border-radius: 30px;
|
||||
color: #492f00;
|
||||
}
|
||||
@@ -405,7 +405,7 @@ page {
|
||||
}
|
||||
|
||||
.func-tag-done {
|
||||
color: #c9a962;
|
||||
color: #9333ea;
|
||||
}
|
||||
|
||||
.rank-hub-tip {
|
||||
@@ -484,7 +484,7 @@ page {
|
||||
}
|
||||
|
||||
.rank-theme-gold {
|
||||
background: linear-gradient(135deg, #a8842a 0%, #f5d563 100%);
|
||||
background: linear-gradient(135deg, #a8842a 0%, #c4b5fd 100%);
|
||||
}
|
||||
|
||||
.rank-theme-gold .rank-tile-name,
|
||||
@@ -498,7 +498,7 @@ page {
|
||||
}
|
||||
|
||||
.rank-theme-orange {
|
||||
background: linear-gradient(135deg, #d4652a 0%, #f5a962 100%);
|
||||
background: linear-gradient(135deg, #7c3aed 0%, #c4b5fd 100%);
|
||||
}
|
||||
|
||||
/* 未注册 */
|
||||
@@ -576,7 +576,7 @@ page {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border: 4rpx solid rgba(0, 0, 0, 0.08);
|
||||
border-top-color: #ffd061;
|
||||
border-top-color: #9333ea;
|
||||
border-radius: 50%;
|
||||
animation: fighterSpin 0.8s linear infinite;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user