修正了 pages 名为拼音的问题
This commit is contained in:
169
pages/mine/mine.js
Normal file
169
pages/mine/mine.js
Normal file
@@ -0,0 +1,169 @@
|
||||
// pages/mine/mine.js
|
||||
const app = getApp();
|
||||
import { ensureLogin } from '../../utils/login';
|
||||
import {
|
||||
backfillUserProfileCache,
|
||||
getUserProfileForDisplay,
|
||||
clearCacheAndEnterNormal,
|
||||
isRoleStatusActive,
|
||||
ensureRoleOnCenterPage,
|
||||
} from '../../utils/role-tab-bar';
|
||||
import { enterLockedRole } from '../../utils/primary-role.js';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
avatarUrl: '',
|
||||
userNicheng: '',
|
||||
userUid: '',
|
||||
showLoginBtn: false,
|
||||
orderCounts: { daifuwu:0, fuwuzhong:0, yiwancheng:0, yituikuan:0 },
|
||||
// 图标
|
||||
settingIcon: '', daifuwuIcon: '', fuwuzhongIcon: '', yiwanchengIcon: '', yituikuanIcon: '',
|
||||
dashouIcon: '', shangjiaIcon: '', guanshiIcon: '', kefuIcon: '',
|
||||
zuzhangIcon: '', guanzhualongIcon: '', arrowRightIcon: '', qingchuIcon: '',
|
||||
dashouCertified: false,
|
||||
shangjiaCertified: false,
|
||||
bottomSafePadding: 0
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.initIconUrls()
|
||||
this.loadUserData()
|
||||
this.setBottomSafe()
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.initIconUrls();
|
||||
this.registerNotification();
|
||||
this.checkAvatarPrompt();
|
||||
backfillUserProfileCache(app);
|
||||
this.loadUserData();
|
||||
this.updateOrderCounts();
|
||||
},
|
||||
|
||||
setBottomSafe() {
|
||||
const sys = wx.getSystemInfoSync()
|
||||
const safeBottom = sys.screenHeight - sys.safeArea.bottom // 底部安全区高度(px)
|
||||
const tabBarHeight = (sys.windowWidth / 750) * 100 // 100rpx 转为 px
|
||||
this.setData({
|
||||
bottomSafePadding: safeBottom + tabBarHeight + 4 // 4px 微调,确保不留缝隙
|
||||
})
|
||||
},
|
||||
|
||||
registerNotification() {
|
||||
const comp = this.selectComponent('#global-notification')
|
||||
if (comp?.showNotification) {
|
||||
app.globalData.globalNotification = {
|
||||
show: d => comp.showNotification(d),
|
||||
hide: () => comp.hideNotification()
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
checkAvatarPrompt() {
|
||||
const ds = wx.getStorageSync('dashoustatus')
|
||||
const tx = wx.getStorageSync('touxiang') || ''
|
||||
if (ds === 1 && (!tx || tx === 'a_long/morentouxiang.jpg')) {
|
||||
wx.showModal({
|
||||
title: '提示', content: '请先设置头像',
|
||||
confirmText: '去设置', confirmColor: '#C9A962',
|
||||
success: r => r.confirm && wx.navigateTo({ url: '/pages/edit/edit' })
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
initIconUrls() {
|
||||
const base = (app.globalData.ossImageUrl || '') + '/beijing/tubiao/'
|
||||
this.setData({
|
||||
settingIcon: base + 'grzx_shezhi.jpg',
|
||||
daifuwuIcon: base + 'grzx_daifuwu.jpg',
|
||||
fuwuzhongIcon: base + 'grzx_fuwuzhong.jpg',
|
||||
yiwanchengIcon: base + 'grzx_yiwancheng.jpg',
|
||||
yituikuanIcon: base + 'grzx_yituikuan.jpg',
|
||||
dashouIcon: base + 'grzx_dashou.jpg',
|
||||
shangjiaIcon: base + 'grzx_shangjia.jpg',
|
||||
guanshiIcon: base + 'grzx_guanshi.jpg',
|
||||
kefuIcon: base + 'grzx_kefu.jpg',
|
||||
zuzhangIcon: base + 'grzx_zuzhang.jpg',
|
||||
guanzhualongIcon: base + 'grzx_guanzhualong.jpg',
|
||||
arrowRightIcon: base + 'grzx_arrow_right.jpg',
|
||||
qingchuIcon: base + 'grzx_qingchu.jpg',
|
||||
kaoheguanIcon: base + 'kaoheguan.png',
|
||||
})
|
||||
},
|
||||
|
||||
loadUserData() {
|
||||
const profile = getUserProfileForDisplay(app);
|
||||
this.setData({
|
||||
avatarUrl: profile.avatarUrl,
|
||||
userNicheng: profile.nick,
|
||||
userUid: profile.uid,
|
||||
showLoginBtn: !profile.isLoggedIn,
|
||||
dashouCertified: isRoleStatusActive(wx.getStorageSync('dashoustatus')),
|
||||
shangjiaCertified: isRoleStatusActive(wx.getStorageSync('shangjiastatus')),
|
||||
});
|
||||
},
|
||||
|
||||
updateOrderCounts() {
|
||||
const c = app.globalData.dingdanTiaoshu || {}
|
||||
this.setData({ orderCounts: {
|
||||
daifuwu: c.daifuwu||0, fuwuzhong: c.fuwuzhong||0,
|
||||
yiwancheng: c.yiwancheng||0, yituikuan: c.yituikuan||0
|
||||
}})
|
||||
},
|
||||
|
||||
goToSetting() { wx.navigateTo({ url: '/pages/edit/edit' }) },
|
||||
|
||||
handleWechatLogin() {
|
||||
wx.showLoading({ title: '登录中...', mask: true });
|
||||
ensureLogin({ silent: false, page: this })
|
||||
.then(() => {
|
||||
this.loadUserData();
|
||||
this.updateOrderCounts();
|
||||
wx.showToast({ title: '登录成功', icon: 'success' });
|
||||
})
|
||||
.catch(() => {})
|
||||
.finally(() => wx.hideLoading());
|
||||
},
|
||||
|
||||
goToOrder(e) { wx.navigateTo({ url: `/pages/orders/orders?type=${e.currentTarget.dataset.type}` }) },
|
||||
|
||||
goToAuth(e) {
|
||||
const type = e.currentTarget.dataset.type;
|
||||
if (!type || !['dashou', 'shangjia'].includes(type)) return;
|
||||
ensureLogin({ silent: false, page: this })
|
||||
.then(() => {
|
||||
this.loadUserData();
|
||||
const statusKey = type === 'dashou' ? 'dashoustatus' : 'shangjiastatus';
|
||||
if (isRoleStatusActive(wx.getStorageSync(statusKey))) {
|
||||
ensureRoleOnCenterPage(this, type);
|
||||
enterLockedRole(type, app);
|
||||
return;
|
||||
}
|
||||
wx.navigateTo({ url: `/pages/verify/verify?type=${type}` });
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
goToKefu() {
|
||||
const { link, enterpriseId } = app.globalData.kefuConfig || {}
|
||||
if (!link || !enterpriseId) { wx.showToast({ title: '客服配置未加载', icon: 'none' }); return }
|
||||
wx.openCustomerServiceChat({ extInfo: { url: link }, corpId: enterpriseId })
|
||||
},
|
||||
goToCustomService() { this.goToKefu() },
|
||||
goToGuanzhuA() { wx.navigateTo({ url: '/pages/manager-assign/manager-assign' }) },
|
||||
|
||||
clearCache() {
|
||||
wx.showModal({
|
||||
title: '清除缓存',
|
||||
content: '将清除所有登录与身份数据,并回到点单端,确定继续?',
|
||||
confirmText: '确定',
|
||||
cancelText: '取消',
|
||||
success: r => {
|
||||
if (r.confirm) {
|
||||
clearCacheAndEnterNormal(this);
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
})
|
||||
11
pages/mine/mine.json
Normal file
11
pages/mine/mine.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"global-notification": "/components/global-notification/global-notification",
|
||||
"custom-tab-bar": "/custom-tab-bar/index"
|
||||
},
|
||||
"navigationBarTitleText": "个人中心",
|
||||
"navigationBarBackgroundColor": "#F7F3ED",
|
||||
"navigationBarTextStyle": "black",
|
||||
"backgroundColor": "#F7F3ED",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
117
pages/mine/mine.wxml
Normal file
117
pages/mine/mine.wxml
Normal file
@@ -0,0 +1,117 @@
|
||||
<view class="page-root">
|
||||
<view class="bg-layer"></view>
|
||||
|
||||
<scroll-view class="main-scroll" scroll-y="true" enhanced show-scrollbar="{{false}}">
|
||||
<view class="main-content">
|
||||
<!-- 头部 -->
|
||||
<view class="hero">
|
||||
<view class="settings-icon" bindtap="goToSetting">
|
||||
<image src="{{settingIcon}}" mode="aspectFit" class="icon-dark" />
|
||||
</view>
|
||||
<view class="user-block">
|
||||
<view class="avatar-outside">
|
||||
<image class="avatar" src="{{avatarUrl}}" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="user-text">
|
||||
<text class="nickname">{{userNicheng || (showLoginBtn ? '点击登录' : '微信用户')}}</text>
|
||||
<text class="uid">UID: {{userUid || '••••••'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<button wx:if="{{showLoginBtn}}" class="login-btn" bindtap="handleWechatLogin">一键登录</button>
|
||||
</view>
|
||||
|
||||
<!-- 我的订单 -->
|
||||
<view class="section">
|
||||
<view class="title-line gradient-bg">
|
||||
<text class="title-text">我的订单</text>
|
||||
</view>
|
||||
<view class="frosted-box">
|
||||
<view class="order-row">
|
||||
<view class="order-unit" bindtap="goToOrder" data-type="daifuwu">
|
||||
<view class="icon-bg"><image src="{{daifuwuIcon}}" mode="aspectFit" class="icon-dark icon-size" /></view>
|
||||
<text class="order-name">待服务</text>
|
||||
<view class="badge" wx:if="{{orderCounts.daifuwu > 0}}">{{orderCounts.daifuwu}}</view>
|
||||
</view>
|
||||
<view class="order-unit" bindtap="goToOrder" data-type="fuwuzhong">
|
||||
<view class="icon-bg"><image src="{{fuwuzhongIcon}}" mode="aspectFit" class="icon-dark icon-size" /></view>
|
||||
<text class="order-name">服务中</text>
|
||||
<view class="badge" wx:if="{{orderCounts.fuwuzhong > 0}}">{{orderCounts.fuwuzhong}}</view>
|
||||
</view>
|
||||
<view class="order-unit" bindtap="goToOrder" data-type="yiwancheng">
|
||||
<view class="icon-bg"><image src="{{yiwanchengIcon}}" mode="aspectFit" class="icon-dark icon-size" /></view>
|
||||
<text class="order-name">已完成</text>
|
||||
<view class="badge" wx:if="{{orderCounts.yiwancheng > 0}}">{{orderCounts.yiwancheng}}</view>
|
||||
</view>
|
||||
<view class="order-unit" bindtap="goToOrder" data-type="yituikuan">
|
||||
<view class="icon-bg"><image src="{{yituikuanIcon}}" mode="aspectFit" class="icon-dark icon-size" /></view>
|
||||
<text class="order-name">已退款</text>
|
||||
<view class="badge" wx:if="{{orderCounts.yituikuan > 0}}">{{orderCounts.yituikuan}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 更多服务 -->
|
||||
<view class="section">
|
||||
<view class="title-line gradient-bg">
|
||||
<text class="title-text">更多服务</text>
|
||||
</view>
|
||||
<view class="service-row">
|
||||
<view class="service-unit" bindtap="goToKefu">
|
||||
<view class="icon-bg"><image src="{{kefuIcon}}" mode="aspectFit" class="icon-color icon-size" /></view>
|
||||
<text class="service-name">在线客服</text>
|
||||
</view>
|
||||
<view class="service-unit" bindtap="goToGuanzhuA">
|
||||
<view class="icon-bg"><image src="{{guanzhualongIcon}}" mode="aspectFit" class="icon-color icon-size" /></view>
|
||||
<text class="service-name">关注星阙</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 身份认证(与更多服务同款紧凑布局) -->
|
||||
<view class="section">
|
||||
<view class="title-line gradient-bg">
|
||||
<text class="title-text">身份认证</text>
|
||||
</view>
|
||||
<view class="service-row auth-service-row">
|
||||
<view class="service-unit" bindtap="goToAuth" data-type="dashou">
|
||||
<view class="icon-bg icon-bg-sm">
|
||||
<image src="{{dashouIcon}}" mode="aspectFit" class="icon-dark icon-size-sm" />
|
||||
</view>
|
||||
<text class="service-name">接单员</text>
|
||||
<text class="auth-tag {{dashouCertified ? 'auth-tag-done' : ''}}">{{dashouCertified ? '已认证' : '去认证'}}</text>
|
||||
</view>
|
||||
<view class="service-unit" bindtap="goToAuth" data-type="shangjia">
|
||||
<view class="icon-bg icon-bg-sm">
|
||||
<image src="{{shangjiaIcon}}" mode="aspectFit" class="icon-dark icon-size-sm" />
|
||||
</view>
|
||||
<text class="service-name">商家</text>
|
||||
<text class="auth-tag {{shangjiaCertified ? 'auth-tag-done' : ''}}">{{shangjiaCertified ? '已认证' : '去认证'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 系统功能 -->
|
||||
<view class="section section-close">
|
||||
<view class="title-line gradient-bg">
|
||||
<text class="title-text">系统功能</text>
|
||||
</view>
|
||||
<view class="clear-row" bindtap="clearCache">
|
||||
<view class="icon-bg"><image src="{{qingchuIcon}}" mode="aspectFit" class="icon-dark icon-size" /></view>
|
||||
<text class="clear-word">清除缓存</text>
|
||||
<image src="{{arrowRightIcon}}" mode="aspectFit" class="arrow-right" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部 -->
|
||||
<view class="footer">
|
||||
<text class="copyright">© 2026 星阙网络技术</text>
|
||||
<text class="divider">|</text>
|
||||
<text class="coop" bindtap="goToCustomService">我要做同款</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
<custom-tab-bar />
|
||||
<global-notification id="global-notification" />
|
||||
251
pages/mine/mine.wxss
Normal file
251
pages/mine/mine.wxss
Normal file
@@ -0,0 +1,251 @@
|
||||
/* pages/gerenzhongxin/gerenzhongxin.wxss — 最终完美版(毛玻璃强化+图标左右贴边) */
|
||||
|
||||
/* 全局 */
|
||||
page {
|
||||
background: #F7F3ED;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.page-root {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.bg-layer {
|
||||
position: fixed;
|
||||
top: 0; left: 0;
|
||||
width: 100vw; height: 100vh;
|
||||
background: radial-gradient(ellipse at 30% 20%, rgba(201,169,98,0.08) 0%, transparent 60%),
|
||||
radial-gradient(ellipse at 80% 70%, rgba(201,169,98,0.05) 0%, transparent 50%);
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.main-scroll {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
overflow-y: auto;
|
||||
padding-bottom: calc(140rpx + env(safe-area-inset-bottom));
|
||||
}
|
||||
|
||||
.main-content {
|
||||
padding: 60rpx 40rpx 0;
|
||||
}
|
||||
|
||||
/* 图标基础 */
|
||||
.icon-dark {
|
||||
filter: brightness(0) saturate(100%) opacity(0.65);
|
||||
}
|
||||
.icon-color {
|
||||
filter: none;
|
||||
}
|
||||
.icon-size {
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
}
|
||||
|
||||
/* 图标独立淡金背景 */
|
||||
.icon-bg {
|
||||
background: rgba(201,169,98,0.08);
|
||||
border-radius: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 18rpx;
|
||||
}
|
||||
|
||||
/* 头部(头像完美正圆) */
|
||||
.hero {
|
||||
position: relative;
|
||||
margin-bottom: 100rpx;
|
||||
}
|
||||
.settings-icon {
|
||||
position: absolute;
|
||||
top: 0; right: 0;
|
||||
width: 60rpx; height: 60rpx;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.user-block {
|
||||
display: flex; align-items: center;
|
||||
}
|
||||
.avatar-outside {
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
background: rgba(201,169,98,0.06);
|
||||
padding: 10rpx;
|
||||
margin-right: 35rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.avatar {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
display: block;
|
||||
border: none;
|
||||
}
|
||||
.nickname {
|
||||
font-size: 44rpx; font-weight: 700; color: #1A1A1A;
|
||||
display: block;
|
||||
}
|
||||
.uid {
|
||||
font-size: 28rpx; color: #7A7A7A;
|
||||
margin-top: 12rpx;
|
||||
display: block;
|
||||
}
|
||||
.login-btn {
|
||||
margin-top: 45rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 46rpx;
|
||||
}
|
||||
|
||||
/* 分区间距 */
|
||||
.section {
|
||||
margin-top: 110rpx;
|
||||
}
|
||||
.section-close {
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.title-line {
|
||||
margin-bottom: 40rpx;
|
||||
padding: 18rpx 28rpx;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.gradient-bg {
|
||||
background: linear-gradient(to right, rgba(201,169,98,0.01), rgba(201,169,98,0.10));
|
||||
}
|
||||
.title-text {
|
||||
font-size: 38rpx;
|
||||
font-weight: 700;
|
||||
color: #1A1A1A;
|
||||
letter-spacing: 2rpx;
|
||||
}
|
||||
|
||||
/* 毛玻璃订单容器(强化玻璃质感,淡灰半透,无白边) */
|
||||
.frosted-box {
|
||||
background: rgba(235, 235, 240, 0.45); /* 淡灰玻璃底 */
|
||||
backdrop-filter: blur(25px);
|
||||
-webkit-backdrop-filter: blur(25px);
|
||||
border-radius: 36rpx;
|
||||
padding: 45rpx 0; /* 去掉左右内边距,让图标真正贴边 */
|
||||
box-shadow: 0 4rpx 16rpx rgba(0,0,0,0.05), inset 0 1rpx 0 rgba(255,255,255,0.7);
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* 订单行 - 图标完全左右贴边,间距最大化 */
|
||||
.order-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 5rpx; /* 极微的内边距,防止图片被裁剪,但视觉上仍贴边 */
|
||||
}
|
||||
.order-unit {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
flex: 1; /* 等分剩余空间 */
|
||||
margin: 0; /* 无额外间距 */
|
||||
}
|
||||
.order-name {
|
||||
font-size: 28rpx;
|
||||
color: #1C1C1C;
|
||||
margin-top: 18rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.badge {
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: 12rpx;
|
||||
background: #C5615E;
|
||||
color: #fff;
|
||||
font-size: 22rpx;
|
||||
min-width: 38rpx;
|
||||
height: 38rpx;
|
||||
border-radius: 19rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0 8rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* 更多服务 */
|
||||
.service-row {
|
||||
display: flex;
|
||||
gap: 80rpx;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.auth-service-row {
|
||||
gap: 100rpx;
|
||||
}
|
||||
.service-unit {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
min-width: 120rpx;
|
||||
}
|
||||
.service-name {
|
||||
font-size: 26rpx;
|
||||
color: #1C1C1C;
|
||||
margin-top: 14rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.icon-bg-sm {
|
||||
padding: 14rpx;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
.icon-size-sm {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
}
|
||||
.auth-tag {
|
||||
font-size: 20rpx;
|
||||
color: #aaa;
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
.auth-tag-done {
|
||||
color: #C9A962;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* 清除缓存 */
|
||||
.clear-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 22rpx 0;
|
||||
}
|
||||
.clear-word {
|
||||
flex: 1;
|
||||
font-size: 30rpx;
|
||||
color: #1C1C1C;
|
||||
margin-left: 18rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
.arrow-right {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
opacity: 0.45;
|
||||
margin-left: 15rpx;
|
||||
}
|
||||
|
||||
/* 底部 */
|
||||
.footer {
|
||||
margin-top: 130rpx;
|
||||
padding-bottom: 20rpx;
|
||||
text-align: center;
|
||||
font-size: 26rpx;
|
||||
color: #aaa;
|
||||
}
|
||||
.divider { margin: 0 15rpx; }
|
||||
.coop { color: #C9A962; font-weight: 500; }
|
||||
Reference in New Issue
Block a user