You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

2725 lines
64 KiB

<template>
<view class="my-page">
<scroll-view class="my-scroll" scroll-y refresher-enabled :refresher-triggered="refreshing"
@refresherrefresh="onRefresh">
<view class="my-content">
<view class="top-zone fade-up" style="animation-delay: 0ms;">
<view class="profile-row">
<view class="avatar-card">
<view class="avatar-face">{{avatarText}}</view>
<view class="level-chip">Lv.8</view>
</view>
<view class="profile-main">
<view class="name-row">
<text class="user-name">{{userName}}</text>
<text class="verify-dot"></text>
</view>
<view class="school-row">{{schoolName}}</view>
<view class="identity-pill">半径等级 Lv.8</view>
</view>
<view class="top-actions">
<view class="icon-btn" hover-class="tap-soft" hover-stay-time="80" @tap="showComingSoon('设置')">
<view class="line-gear"></view>
</view>
<view class="icon-btn icon-btn--notice" hover-class="tap-soft" hover-stay-time="80"
@tap="showComingSoon('消息')">
<view class="line-message"></view>
<view class="notice-dot"></view>
</view>
</view>
</view>
<view class="ticket-card" hover-class="tap-soft" hover-stay-time="80" @tap="navigatorTo('blindBox')">
<view>
<view class="ticket-label">我的星球券</view>
<view class="ticket-value">{{blindBoxCount}}</view>
</view>
<view class="ticket-icon"></view>
</view>
</view>
<view class="saving-hero fade-up" hover-class="tap-soft" hover-stay-time="80"
style="animation-delay: 50ms;" @tap="navigatorTo('qianbao')">
<view class="save-glow save-glow-a"></view>
<view class="save-glow save-glow-b"></view>
<view class="saved-badge">已经帮你省下</view>
<view class="saved-main">
<view class="saved-money money-roll">{{savedMoney}}</view>
<view class="saved-desc"> {{milkTeaCount}} 杯蜜雪冰城</view>
<view class="saved-week">本周又省了 +38</view>
</view>
<view class="drink-card">
<view class="drink-cup"></view>
</view>
<image class="squirrel" src="/static/images/img/songshu.png" mode="aspectFit"></image>
</view>
<view class="section-card earn-section fade-up" style="animation-delay: 100ms;">
<view class="section-head">
<view>
<view class="section-title">今天还能赚</view>
<view class="section-desc">每日都有新机会省钱又赚钱</view>
</view>
<view class="text-link" @tap="showComingSoon('全部任务')">查看全部</view>
</view>
<view class="task-row">
<view class="task-card" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in taskCards" :key="index" :class="'task-card--' + item.type"
@tap="navigatorTo(item.action)">
<view class="task-title">{{item.title}}</view>
<view class="task-sub">{{item.sub}}</view>
<view class="task-visual">
<view class="task-asset" :class="'task-asset--' + item.type">{{item.mark}}</view>
</view>
<view class="task-btn">{{item.cta}}</view>
</view>
</view>
</view>
<view class="section-card identity-section fade-up" style="animation-delay: 150ms;">
<view class="section-head">
<view>
<view class="section-title">我的身份</view>
<view class="section-desc">一个账号,多重身份</view>
</view>
<view class="text-link" @tap="showComingSoon('切换身份')">切换身份</view>
</view>
<view class="identity-row">
<view class="identity-card" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in identityCards" :key="index" :class="'identity-card--' + item.type"
@tap="navigatorTo(item.action)">
<view class="identity-tag" v-if="item.tag">{{item.tag}}</view>
<view class="identity-icon" :class="'identity-icon--' + item.type">{{item.mark}}</view>
<view class="identity-title">{{item.title}}</view>
<view class="identity-desc">{{item.desc}}</view>
<view class="identity-go">›</view>
</view>
</view>
</view>
<view class="quick-card fade-up" style="animation-delay: 200ms;">
<view class="quick-item" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in quickItems" :key="index" @tap="navigatorTo(item.action)">
<view class="quick-icon" :class="'quick-icon--' + item.type">{{item.mark}}</view>
<view class="quick-title">{{item.title}}</view>
<view class="quick-tip">{{item.tip}}</view>
</view>
</view>
<view class="section-card life-section fade-up" style="animation-delay: 250ms;">
<view class="section-head">
<view>
<view class="section-title">校园生活</view>
<view class="section-desc">发现更多有趣的校园生活</view>
</view>
<view class="text-link" @tap="showComingSoon('全部服务')">全部服务</view>
</view>
<view class="life-grid">
<view class="life-card" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in lifeCards" :key="index" :class="'life-card--' + item.type"
@tap="navigatorTo(item.action)">
<view class="life-title">{{item.title}}</view>
<view class="life-desc">{{item.desc}}</view>
<view class="life-visual">
<view class="life-asset" :class="'life-asset--' + item.type">{{item.mark}}</view>
<view class="life-go">›</view>
</view>
</view>
</view>
</view>
<view class="logout-btn fade-up" hover-class="logout-active" hover-stay-time="80"
style="animation-delay: 300ms;" @tap="navigatorTo('tuichu')">
<text class="logout-icon">↧</text>
<text>退出登录</text>
</view>
</view>
</scroll-view>
<!-- 未注册兼职弹窗 -->
<uni-popup ref="jianzhiPopup" background-color="rgba(2, 171, 255, 1)" borderRadius="40px 40px 40px 40px">
<view class="jianzhi-content" @tap="navigatorTo('partTimeReg')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/faf25c687bc1417282ebac719fd1bfba.png" alt=""
style="width: 100%;height: 100%;">
<view style="position: absolute;bottom: -50px;left: 130px;" @tap.stop="$refs.jianzhiPopup.close()">
<uni-icons type="close" size="40" color="#fff"></uni-icons>
</view>
</view>
</uni-popup>
<!-- 多个商家选择弹窗 -->
<uni-popup ref="shopPopup" background-color="transparent" borderRadius="40px 40px 40px 40px">
<view class="shop-content">
<view class="popup-pay-title">
<text>选择要进入的店铺</text>
</view>
<view class="popup-list" hover-class="tap-soft" hover-stay-time="80" @tap="clickShop(item)"
v-for="(item,index) in schoolShop" :key="index">
{{item.shopName}}
</view>
</view>
</uni-popup>
<!-- 弹出区域选择 -->
<uni-popup ref="areaPopup" background-color="transparent">
<view class="popup-area-content">
<view class="popup-area-title">
<text>选择你的校园半径</text>
</view>
<view class="popup-area-container" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in areaList" :key="index" @tap="onClickArea(item)">
<text style="display: inline-block">{{item.title}}</text>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
areaList: [],
schoolShop: [],
workerCounts: 0,
shopCounts: 0,
balance: '0.00',
worker: uni.getStorageSync('worker'),
balanceRefreshId: 0,
refreshing: false,
couponCount: Number(uni.getStorageSync('couponCount')) || 8,
blindBoxCount: Number(uni.getStorageSync('blindBoxCount')) || 8,
orderCounts: {
pay: Number(uni.getStorageSync('orderPayCount')) || 2,
delivery: Number(uni.getStorageSync('orderDeliveryCount')) || 1,
evaluate: Number(uni.getStorageSync('orderEvaluateCount')) || 3,
refund: Number(uni.getStorageSync('orderRefundCount')) || 1
},
savedMoney: uni.getStorageSync('savedMoney') || '286',
rewardMoney: uni.getStorageSync('rewardMoney') || '58.6',
deliveryIncome: uni.getStorageSync('deliveryIncome') || '86',
deliveryDoneCount: Number(uni.getStorageSync('deliveryDoneCount')) || 123,
collegeRank: Number(uni.getStorageSync('collegeRank')) || 18
}
},
computed: {
hasWorker() {
return !!this.worker
},
hasShop() {
const shopId = uni.getStorageSync('shopId')
const shops = this.normalizeShopList(this.schoolShop.length ? this.schoolShop : uni.getStorageSync('schoolShop'))
return !!shopId || shops.length > 0
},
userName() {
return uni.getStorageSync('nickName') || uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '张昊雯'
},
avatarText() {
return (this.userName || '张').slice(0, 1)
},
schoolName() {
const area = this.getArea()
return uni.getStorageSync('schoolName') || area.title || '沧州师范学院'
},
milkTeaCount() {
return Math.max(1, Math.round((Number(this.savedMoney) || 0) / 5))
},
userOrderTotal() {
return this.orderCounts.pay + this.orderCounts.delivery + this.orderCounts.evaluate + this.orderCounts.refund
},
taskCards() {
return [{
type: 'group',
title: '拼团省钱',
sub: '还差 2 人成团',
mark: '团',
cta: '去拼团',
action: 'dingdan'
}, {
type: 'cash',
title: '白嫖现金',
sub: '22:00 开奖',
mark: '礼',
cta: '去参与',
action: 'planet'
}, {
type: 'school',
title: '学院奖金',
sub: '当前排名 12',
mark: '奖',
cta: '去助推',
action: 'planet'
}, {
type: 'wallet',
title: '可提现',
sub: '余额 ¥' + this.rewardMoney,
mark: '钱',
cta: '去提现',
action: 'qianbao'
}]
},
identityCards() {
return [{
type: 'user',
title: '普通用户',
desc: '点外卖 · 拼团 · 领券',
mark: '人',
action: 'dingdan'
}, {
type: 'delivery',
title: '校园配送员',
desc: '自由接单 · 灵活赚钱',
mark: '骑',
tag: this.hasWorker ? '接单中' : '可注册',
action: this.hasWorker ? 'jianzhizhuye' : 'jianzhizhuce'
}, {
type: 'shop',
title: '商家中心',
desc: '管理店铺 · 经营数据',
mark: '店',
action: this.hasShop ? 'merchantCenter' : 'merchant'
}]
},
quickItems() {
return [{
type: 'order',
title: '我的订单',
tip: '待付款 ' + this.orderCounts.pay,
mark: '单',
action: 'dingdan'
}, {
type: 'wallet',
title: '我的钱包',
tip: '余额 ¥' + this.balance,
mark: '包',
action: 'qianbao'
}, {
type: 'coupon',
title: '优惠券',
tip: '8 张可用',
mark: '券',
action: 'youhui'
}, {
type: 'address',
title: '收货地址',
tip: '3 个地址',
mark: '址',
action: 'address'
}, {
type: 'collect',
title: '我的收藏',
tip: '12 个收藏',
mark: '星',
action: 'collect'
}]
},
lifeCards() {
return [{
type: 'ie',
title: 'IE',
desc: '找搭子一起吃饭学习',
mark: 'IE',
action: 'ie'
}, {
type: 'fish',
title: '鱼塘',
desc: '二手交易更省钱',
mark: '鱼',
action: 'fishRelease'
}, {
type: 'secret',
title: '校园秘闻',
desc: '看看学校新鲜事',
mark: '秘',
action: 'planet'
}, {
type: 'agent',
title: '成为代理',
desc: '邀请好友赚佣金',
mark: '代',
action: 'agent'
}]
}
},
mounted() {
uni.$on('myCenterCountsChange', this.setPendingCounts)
},
beforeDestroy() {
uni.$off('myCenterCountsChange', this.setPendingCounts)
},
methods: {
getArea() {
try {
return uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {}
} catch (e) {
return {}
}
},
normalizeShopList(list) {
if (Array.isArray(list)) return list
if (!list) return []
if (typeof list == 'string') {
try {
const parsed = JSON.parse(list)
return Array.isArray(parsed) ? parsed : []
} catch (e) {
return []
}
}
return typeof list == 'object' ? [list] : []
},
showComingSoon(title) {
this.tui.toast(title + '即将开放')
},
setPendingCounts(counts) {
this.workerCounts = Number(counts.workerCounts) || 0
this.shopCounts = Number(counts.shopCounts) || 0
this.$forceUpdate()
},
onRefresh() {
this.refreshing = true
Promise.resolve(this.init()).then(() => {
this.refreshing = false
}).catch(() => {
this.refreshing = false
})
},
init() {
this.schoolShop = this.normalizeShopList(uni.getStorageSync('schoolShop'))
this.worker = uni.getStorageSync('worker')
let shopId = uni.getStorageSync('shopId')
let worker = uni.getStorageSync('worker')
this.workerCounts = 0
this.shopCounts = 0
if (worker) {
this.workerCounts = Number(uni.getStorageSync('workerCounts')) || 0
}
if (shopId) {
this.shopCounts = Number(uni.getStorageSync('shopCounts')) || 0
}
this.balance = '0.00'
const refreshId = ++this.balanceRefreshId
return this.tui.request("/worker/getAllDepo/", "GET", {
userId: uni.getStorageSync('id')
}, false, true).then((res) => {
if (refreshId != this.balanceRefreshId) return
if (res.code == 200) {
let balance = 0
if (res.result.user) {
balance += Number(res.result.user.depoBal) || 0
}
if (res.result.worker) {
balance += Number(res.result.worker.depoBal) || 0
balance += Number(res.result.worker.depoBalRel) || 0
}
if (res.result.shop) {
for (let i = 0; i < res.result.shop.length; i++) {
balance += Number(res.result.shop[i].balance) || 0
}
}
this.balance = balance.toFixed(2)
this.$forceUpdate()
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {
uni.hideLoading()
})
},
clickShop(item) {
uni.setStorageSync('shopId', item.id)
uni.setStorageSync('shopName', item.shopName)
uni.setStorageSync('shopIcon', item.shopIcon)
uni.setStorageSync('shopScore', item.shopScore)
uni.setStorageSync('shopTakeaway', item.shopTakeaway)
uni.setStorageSync('attrId', item.attrId)
this.$refs.shopPopup.close()
uni.navigateTo({
url: '/package2/shop/merchantCenter'
})
},
checkArea() {
this.tui.request("/app/shopArea/getByParentId/0", "get", {}, false, false).then((res) => {
if (res.code == 200) {
this.areaList = res.result
this.$refs.areaPopup.open()
} else {
this.tui.toast(res.message)
}
})
},
onClickArea(item) {
uni.setStorageSync('area', JSON.stringify(item))
this.tui.toast('切换成功')
this.$refs.areaPopup.close()
},
navigatorTo(e, index) {
let url = ""
if (e == 'addgoods') {
url = '/package2/myCenter/addGoods'
} else if (e == 'merchantCenter') {
this.schoolShop = this.normalizeShopList(this.schoolShop.length ? this.schoolShop : uni.getStorageSync('schoolShop'))
if (this.schoolShop && this.schoolShop.length) {
let shopItem = []
const area = this.getArea()
for (let aa = 0; aa < this.schoolShop.length; aa++) {
if (!area.id || this.schoolShop[aa].regionId == area.id) {
shopItem.push(this.schoolShop[aa])
}
}
this.schoolShop = shopItem
if (this.schoolShop.length > 1) {
this.$refs.shopPopup.open()
return
} else if (this.schoolShop.length == 1) {
uni.setStorageSync('shopId', this.schoolShop[0].id)
uni.setStorageSync('attrId', this.schoolShop[0].attrId)
uni.setStorageSync('shopName', this.schoolShop[0].shopName)
uni.setStorageSync('shopIcon', this.schoolShop[0].shopIcon)
uni.setStorageSync('shopScore', this.schoolShop[0].shopScore)
uni.setStorageSync('shopTakeaway', this.schoolShop[0].shopTakeaway)
url = '/package2/shop/merchantCenter'
}
} else {
uni.showModal({
title: '提示',
content: '您还没有注册成为商家,要去注册吗?',
cancelText: '暂时不了',
confirmText: '去注册',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/package2/shop/merchantRegister'
})
}
}
})
return
}
} else if (e == 'dingdan') {
url = '/package1/order/orderList'
} else if (e == 'addType') {
url = '/package2/myCenter/addType'
} else if (e == 'qianbao') {
url = '/package2/myCenter/wallet'
} else if (e == 'youhui') {
url = '/package2/myCenter/couponList'
} else if (e == 'goodsList') {
url = '/package2/myCenter/goodsList'
} else if (e == 'merchant') {
url = '/package2/shop/merchantRegister'
} else if (e == 'tuichu') {
uni.clearStorageSync()
uni.reLaunch({
url: '/package2/login/login'
})
return
} else if (e == 'qiehuan') {
this.checkArea()
return
} else if (e == 'address') {
url = '/package2/myCenter/addressList'
} else if (e == 'collect') {
url = '/package2/myCenter/myCollect'
} else if (e == 'evaluate') {
this.showComingSoon('我的评价')
return
} else if (e == 'feedback') {
this.showComingSoon('意见反馈')
return
} else if (e == 'blindBox') {
this.showComingSoon('星球券')
return
} else if (e == 'fishRelease') {
url = '/package1/tabbar/release'
} else if (e == 'myPost') {
url = '/package2/myCenter/myPost'
} else if (e == 'idleTrad') {
url = '/package2/IdleTrad/detail'
} else if (e == 'agent') {
this.showComingSoon('成为代理')
return
} else if (e == 'ie') {
url = '/package1/ieBrowser/index'
} else if (e == 'planet') {
url = '/package1/planet/index'
} else if (e == 'deliveryRank') {
url = '/package2/shop/ranking'
} else if (e == 'shopData') {
url = '/package2/myCenter/dataStatistics'
} else if (e == 'jianzhichaping') {
let item = {
shopScore: uni.getStorageSync('worker').score,
id: uni.getStorageSync('worker').workerId
}
url = '/package2/group/shopEvaluate?item=' + JSON.stringify(item) + '&isMerchant=2&isCha=' + (index ==
'cha' ? 1 : 0)
} else if (e == 'partTimeReg') {
let worker = uni.getStorageSync('worker')
let that = this
if (worker == undefined || worker == '' || worker == null) {
const area = this.getArea()
that.tui.request("/worker/admin/add", "POST", {
userId: uni.getStorageSync('id'),
isChangeArea: 1,
region: area.id
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != null) {
uni.setStorageSync('worker', res.result)
}
this.$refs.jianzhiPopup.close()
uni.navigateTo({
url: '/package2/myCenter/partTimeJobRegister'
})
} else {
that.tui.toast(res.message)
return
}
uni.hideLoading()
}).catch((res) => {})
return
} else {
url = '/package2/myCenter/partTimeJobRegister'
this.$refs.jianzhiPopup.close()
}
} else if (e == 'jianzhizhuce') {
if (uni.getStorageSync('worker')) {
url = '/package2/myCenter/partTimeJobRegister'
} else {
this.$refs.jianzhiPopup.open()
return
}
} else if (e == 'jianzhizhuye') {
url = '/package2/partTimeJob/partTimeJobCenter'
}
if (!url) return
uni.navigateTo({
url: url
})
}
}
}
</script>
<style>
page {
width: 100%;
height: 100%;
font-size: 28rpx;
background: #F8FCFA;
}
.my-page {
width: 100%;
height: 100%;
color: #202124;
background:
radial-gradient(circle at 8% 0%, rgba(52, 200, 160, .12) 0, rgba(52, 200, 160, 0) 320rpx),
radial-gradient(circle at 94% 32%, rgba(255, 166, 61, .1) 0, rgba(255, 166, 61, 0) 360rpx),
#F8FCFA;
}
.my-scroll {
width: 100%;
height: 100%;
}
.my-content {
padding: 28rpx 32rpx 156rpx;
box-sizing: border-box;
}
.fade-up {
opacity: 0;
transform: translateY(28rpx);
animation: fadeUp .48s ease forwards;
}
.top-zone {
position: relative;
min-height: 156rpx;
}
.profile-row {
display: flex;
align-items: center;
padding-right: 140rpx;
}
.avatar-card {
position: relative;
flex-shrink: 0;
width: 104rpx;
height: 104rpx;
margin-right: 24rpx;
border-radius: 32rpx;
background: linear-gradient(145deg, #EAFBF4, #B7F3D5);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
}
.avatar-face {
width: 100%;
height: 100%;
color: #202124;
font-size: 48rpx;
font-weight: 900;
line-height: 104rpx;
text-align: center;
}
.level-chip,
.identity-pill,
.saved-badge,
.task-btn,
.identity-tag {
border-radius: 999rpx;
}
.level-chip {
position: absolute;
right: -12rpx;
bottom: 2rpx;
height: 32rpx;
padding: 0 12rpx;
background: #FFF2D8;
color: #9A5C11;
font-size: 22rpx;
font-weight: 900;
line-height: 32rpx;
}
.profile-main {
flex: 1;
min-width: 0;
text-align: left;
}
.name-row {
display: flex;
align-items: center;
}
.user-name {
max-width: 230rpx;
color: #202124;
font-size: 36rpx;
font-weight: 900;
line-height: 48rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.verify-dot {
width: 18rpx;
height: 18rpx;
margin-left: 12rpx;
border-radius: 50%;
background: #34C8A0;
box-shadow: inset 0 0 0 4rpx rgba(255, 255, 255, .68);
}
.school-row {
margin-top: 4rpx;
color: #70757A;
font-size: 22rpx;
line-height: 30rpx;
}
.identity-pill {
display: inline-flex;
height: 36rpx;
margin-top: 10rpx;
padding: 0 16rpx;
align-items: center;
background: rgba(52, 200, 160, .12);
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
}
.top-actions {
position: absolute;
right: 0;
top: 4rpx;
display: flex;
gap: 16rpx;
}
.icon-btn {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 56rpx;
height: 56rpx;
border-radius: 50%;
background: rgba(255, 255, 255, .72);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
transition: transform .16s ease;
}
.line-gear,
.line-message {
width: 26rpx;
height: 26rpx;
border-radius: 50%;
box-shadow: inset 0 0 0 4rpx #202124;
}
.line-message {
border-radius: 12rpx;
box-shadow: inset 0 0 0 4rpx #202124;
}
.notice-dot {
position: absolute;
right: 6rpx;
top: 4rpx;
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background: #FF6464;
}
.ticket-card {
position: absolute;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: space-between;
width: 166rpx;
height: 82rpx;
padding: 14rpx 16rpx;
border-radius: 24rpx;
background: rgba(255, 255, 255, .72);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
box-sizing: border-box;
transition: transform .16s ease;
}
.ticket-label {
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 26rpx;
}
.ticket-value {
margin-top: 4rpx;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 32rpx;
}
.ticket-icon {
display: flex;
align-items: center;
justify-content: center;
width: 42rpx;
height: 42rpx;
border-radius: 14rpx;
background: linear-gradient(145deg, #EAFBF4, #7BE7C3);
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
}
.saving-hero,
.section-card,
.quick-card,
.logout-btn,
.shop-content,
.popup-area-content {
margin-top: 28rpx;
border-radius: 32rpx;
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
box-sizing: border-box;
}
.saving-hero {
position: relative;
height: 260rpx;
padding: 24rpx;
overflow: hidden;
background: linear-gradient(135deg, rgba(227, 255, 243, .96), rgba(244, 255, 250, .88) 48%, rgba(255, 244, 224, .8));
transition: transform .16s ease;
}
.save-glow {
position: absolute;
border-radius: 50%;
}
.save-glow-a {
right: -90rpx;
top: -110rpx;
width: 280rpx;
height: 280rpx;
background: rgba(52, 200, 160, .12);
}
.save-glow-b {
right: 170rpx;
bottom: -130rpx;
width: 300rpx;
height: 300rpx;
background: rgba(255, 166, 61, .1);
}
.saved-badge {
position: relative;
z-index: 2;
display: inline-flex;
height: 44rpx;
padding: 0 18rpx;
align-items: center;
background: rgba(255, 255, 255, .72);
color: #202124;
font-size: 22rpx;
font-weight: 900;
}
.saved-main {
position: relative;
z-index: 2;
margin-top: 8rpx;
text-align: left;
}
.saved-money {
color: #10231E;
font-size: 96rpx;
font-weight: 900;
line-height: 104rpx;
letter-spacing: -4rpx;
}
.saved-desc,
.saved-week {
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 30rpx;
}
.saved-week {
margin-top: 4rpx;
color: #70757A;
}
.squirrel {
position: absolute;
right: 20rpx;
bottom: 8rpx;
z-index: 2;
width: 190rpx;
height: 190rpx;
}
.drink-card {
position: absolute;
right: 188rpx;
bottom: 54rpx;
z-index: 1;
width: 80rpx;
height: 80rpx;
border-radius: 24rpx;
background: rgba(255, 255, 255, .58);
transform: rotate(-12deg);
}
.drink-cup {
width: 34rpx;
height: 54rpx;
margin: 14rpx auto 0;
border-radius: 8rpx 8rpx 14rpx 14rpx;
background: linear-gradient(180deg, #FFFFFF, #FFA63D);
}
.section-card {
padding: 24rpx;
background: rgba(255, 255, 255, .76);
}
.section-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 24rpx;
margin-bottom: 24rpx;
}
.section-title {
color: #202124;
font-size: 36rpx;
font-weight: 900;
line-height: 48rpx;
text-align: left;
}
.section-desc {
margin-top: 4rpx;
color: #70757A;
font-size: 22rpx;
line-height: 30rpx;
text-align: left;
}
.text-link {
flex-shrink: 0;
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 36rpx;
}
.task-row {
display: flex;
gap: 16rpx;
}
.task-card {
flex: 1;
min-width: 0;
height: 210rpx;
padding: 18rpx 10rpx 12rpx;
border-radius: 24rpx;
box-sizing: border-box;
text-align: center;
transition: transform .16s ease;
}
.task-card--group {
background: linear-gradient(180deg, #E5FFF3, #C9F5DC);
}
.task-card--cash {
background: linear-gradient(180deg, #FFF0E1, #FFE0C4);
}
.task-card--school {
background: linear-gradient(180deg, #EAF6FF, #D8ECFF);
}
.task-card--wallet {
background: linear-gradient(180deg, #FFF2D8, #FFE4B8);
}
.task-title {
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 36rpx;
white-space: nowrap;
}
.task-sub {
margin-top: 4rpx;
color: #FFA63D;
font-size: 22rpx;
font-weight: 900;
line-height: 28rpx;
white-space: nowrap;
}
.task-visual {
display: flex;
justify-content: center;
margin-top: 14rpx;
}
.task-asset,
.identity-icon,
.quick-icon,
.life-asset {
display: flex;
align-items: center;
justify-content: center;
font-weight: 900;
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
}
.task-asset {
width: 56rpx;
height: 56rpx;
border-radius: 20rpx;
background: rgba(255, 255, 255, .72);
color: #34C8A0;
font-size: 28rpx;
}
.task-btn {
height: 44rpx;
margin: 12rpx auto 0;
padding: 0 14rpx;
background: #34C8A0;
color: #FFFFFF;
font-size: 22rpx;
font-weight: 900;
line-height: 44rpx;
}
.task-card--cash .task-btn,
.task-card--wallet .task-btn {
background: #FFA63D;
}
.identity-row {
display: flex;
gap: 16rpx;
}
.identity-card {
position: relative;
flex: 1;
min-width: 0;
height: 172rpx;
padding: 18rpx 14rpx;
border-radius: 24rpx;
box-sizing: border-box;
overflow: hidden;
transition: transform .16s ease;
}
.identity-card--user {
background: linear-gradient(145deg, #E5FFF3, #F5FFFA);
}
.identity-card--delivery {
background: linear-gradient(145deg, #EAF6FF, #F5FFFA);
}
.identity-card--shop {
background: linear-gradient(145deg, #FFF0E1, #FFF9F0);
}
.identity-tag {
position: absolute;
right: 12rpx;
top: 10rpx;
height: 32rpx;
padding: 0 12rpx;
background: rgba(52, 200, 160, .16);
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 32rpx;
}
.identity-icon {
width: 50rpx;
height: 50rpx;
border-radius: 18rpx;
background: rgba(255, 255, 255, .72);
color: #34C8A0;
font-size: 22rpx;
}
.identity-title {
margin-top: 12rpx;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 36rpx;
text-align: left;
white-space: nowrap;
}
.identity-desc {
margin-top: 4rpx;
color: #70757A;
font-size: 22rpx;
line-height: 28rpx;
text-align: left;
white-space: nowrap;
}
.identity-go {
position: absolute;
right: 14rpx;
bottom: 14rpx;
width: 42rpx;
height: 42rpx;
border-radius: 50%;
background: rgba(255, 255, 255, .74);
color: #34C8A0;
font-size: 36rpx;
line-height: 38rpx;
text-align: center;
}
.quick-card {
display: flex;
justify-content: space-between;
padding: 24rpx 18rpx;
background: rgba(255, 255, 255, .76);
}
.quick-item {
flex: 1;
min-width: 0;
text-align: center;
transition: transform .16s ease;
}
.quick-icon {
width: 58rpx;
height: 58rpx;
margin: 0 auto 10rpx;
border-radius: 20rpx;
background: linear-gradient(145deg, #EAFBF4, #B7F3D5);
color: #34C8A0;
font-size: 22rpx;
}
.quick-icon--wallet,
.quick-icon--address {
background: linear-gradient(145deg, #EAF6FF, #D8ECFF);
}
.quick-icon--coupon,
.quick-icon--collect {
background: linear-gradient(145deg, #FFF0E1, #FFE0C4);
color: #FFA63D;
}
.quick-title {
color: #202124;
font-size: 22rpx;
font-weight: 900;
line-height: 28rpx;
white-space: nowrap;
}
.quick-tip {
margin-top: 2rpx;
color: #70757A;
font-size: 22rpx;
line-height: 28rpx;
white-space: nowrap;
transform: scale(.86);
}
.life-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16rpx;
}
.life-card {
height: 154rpx;
padding: 18rpx;
border-radius: 24rpx;
box-sizing: border-box;
transition: transform .16s ease;
}
.life-card--ie,
.life-card--fish {
background: linear-gradient(145deg, #E5FFF3, #F5FFFA);
}
.life-card--secret {
background: linear-gradient(145deg, #EAF6FF, #F5FFFA);
}
.life-card--agent {
background: linear-gradient(145deg, #FFF0E1, #FFF9F0);
}
.life-title {
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 36rpx;
text-align: left;
}
.life-desc {
margin-top: 4rpx;
color: #70757A;
font-size: 22rpx;
line-height: 28rpx;
text-align: left;
white-space: nowrap;
}
.life-visual {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 14rpx;
}
.life-asset {
width: 52rpx;
height: 52rpx;
border-radius: 18rpx;
background: rgba(255, 255, 255, .72);
color: #34C8A0;
font-size: 22rpx;
}
.life-go {
width: 38rpx;
height: 38rpx;
border-radius: 50%;
background: rgba(255, 255, 255, .78);
color: #34C8A0;
font-size: 32rpx;
line-height: 34rpx;
text-align: center;
}
.logout-btn {
display: flex;
align-items: center;
justify-content: center;
height: 72rpx;
background: rgba(255, 255, 255, .78);
color: #FF6464;
font-size: 28rpx;
font-weight: 900;
line-height: 72rpx;
transition: transform .16s ease;
}
.logout-icon {
margin-right: 12rpx;
font-size: 28rpx;
}
.tap-soft,
.logout-active {
transform: scale(.98);
}
.jianzhi-content {
width: 300px;
height: 350px;
position: relative;
}
.shop-content,
.popup-area-content {
width: 600rpx;
padding: 24rpx;
background: rgba(255, 255, 255, .92);
}
.popup-pay-title,
.popup-area-title {
margin-bottom: 24rpx;
color: #202124;
font-size: 36rpx;
font-weight: 900;
text-align: left;
}
.popup-list,
.popup-area-container {
min-height: 88rpx;
margin-top: 16rpx;
padding: 0 24rpx;
border-radius: 24rpx;
background: #F8FCFA;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 88rpx;
text-align: left;
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
box-sizing: border-box;
}
@keyframes fadeUp {
from {
opacity: 0;
transform: translateY(28rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes moneyRoll {
0% {
opacity: 0;
transform: translateY(24rpx) scale(.96);
}
70% {
opacity: 1;
transform: translateY(-4rpx) scale(1.02);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
</style>
<template>
<view class="mine-page">
<scroll-view class="mine-scroll" scroll-y refresher-enabled :refresher-triggered="refreshing"
@refresherrefresh="onRefresh">
<view class="mine-content">
<view class="profile-row fade-up" style="animation-delay: 0ms;">
<view class="profile-left">
<view class="avatar-card">
<view class="avatar-face">{{avatarText}}</view>
<view class="avatar-level">Lv.8</view>
</view>
<view class="profile-copy">
<view class="name-row">
<text class="profile-name">{{userName}}</text>
<view class="verified-dot"></view>
</view>
<view class="profile-school">{{schoolName}}</view>
<view class="profile-tag">半径等级 Lv.8</view>
</view>
</view>
<view class="profile-actions">
<view class="action-dot" hover-class="tap-soft" hover-stay-time="80" @tap="navigatorTo('qiehuan')">
<text class="line-icon">⚙</text>
</view>
<view class="action-dot has-news" hover-class="tap-soft" hover-stay-time="80" @tap="navigatorTo('feedback')">
<text class="line-icon">●</text>
</view>
</view>
</view>
<view class="ticket-card fade-up" hover-class="tap-soft" hover-stay-time="80"
style="animation-delay: 40ms;" @tap="navigatorTo('blindBox')">
<view class="ticket-copy">
<view class="ticket-title">我的星球券</view>
<view class="ticket-value">{{couponCount}}<text>张</text></view>
</view>
<view class="ticket-icon">
<view class="ticket-star"></view>
</view>
</view>
<view class="saving-hero fade-up" hover-class="tap-soft" hover-stay-time="80"
style="animation-delay: 80ms;" @tap="navigatorTo('qianbao')">
<view class="soft-planet"></view>
<view class="saving-left">
<view class="saving-pill">已经帮你省下</view>
<view class="saving-money money-roll">¥{{savedMoney}}</view>
<view class="saving-desc">≈ {{milkTeaCount}} 杯蜜雪冰城</view>
<view class="saving-week">本周又省了 ¥38</view>
</view>
<image class="saving-squirrel" src="/static/images/img/songshu.png" mode="aspectFit"></image>
<view class="drink-prop"></view>
</view>
<view class="module-card earn-panel fade-up" style="animation-delay: 120ms;">
<view class="section-head">
<view>
<view class="section-title">今天还能赚</view>
<view class="section-desc">每日都有新机会,省钱又赚钱</view>
</view>
<view class="text-link" @tap="navigatorTo('dingdan')">查看全部 ></view>
</view>
<view class="earn-grid">
<view class="earn-item" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in earnTasks" :key="index" :class="'earn-item--' + item.type"
@tap="navigatorTo(item.action)">
<view class="earn-title">{{item.title}}</view>
<view class="earn-time">{{item.time}}</view>
<view class="earn-visual">
<view class="asset-graphic" :class="'asset-graphic--' + item.type"></view>
</view>
<view class="earn-button">{{item.button}}</view>
</view>
</view>
</view>
<view class="module-card identity-panel fade-up" style="animation-delay: 160ms;">
<view class="section-head">
<view>
<view class="section-title">我的身份</view>
<view class="section-desc">一个账号,多重身份</view>
</view>
<view class="text-link" @tap="navigatorTo('qiehuan')">切换身份 ></view>
</view>
<view class="identity-grid">
<view class="identity-card" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in identityCards" :key="index" :class="'identity-card--' + item.type"
@tap="navigatorTo(item.action)">
<view class="identity-tag" v-if="item.tag">{{item.tag}}</view>
<view class="identity-icon" :class="'identity-icon--' + item.type">
<view class="simple-icon" :class="'simple-icon--' + item.type"></view>
</view>
<view class="identity-title">{{item.title}}</view>
<view class="identity-desc">{{item.desc}}</view>
<view class="identity-enter">›</view>
</view>
</view>
</view>
<view class="quick-bar fade-up" style="animation-delay: 200ms;">
<view class="quick-item" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in quickItems" :key="index" @tap="navigatorTo(item.action)">
<view class="quick-icon" :class="'quick-icon--' + item.type">
<view class="quick-mark" :class="'quick-mark--' + item.type"></view>
</view>
<view class="quick-title">{{item.title}}</view>
<view class="quick-tip">{{item.tip}}</view>
</view>
</view>
<view class="module-card life-panel fade-up" style="animation-delay: 240ms;">
<view class="section-head">
<view>
<view class="section-title">校园生活</view>
<view class="section-desc">发现更多有趣的校园生活</view>
</view>
<view class="text-link">全部服务 ></view>
</view>
<view class="life-grid">
<view class="life-card" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in lifeCards" :key="index" :class="'life-card--' + item.type"
@tap="navigatorTo(item.action)">
<view class="life-title">{{item.title}}</view>
<view class="life-desc">{{item.desc}}</view>
<view class="life-visual" :class="'life-visual--' + item.type"></view>
<view class="life-enter">›</view>
</view>
</view>
</view>
<view class="logout-btn fade-up" hover-class="logout-active" hover-stay-time="80"
style="animation-delay: 280ms;" @tap="navigatorTo('tuichu')">
<text class="logout-power">⏻</text>
退出登录
</view>
</view>
</scroll-view>
<!-- 未注册兼职弹窗 -->
<uni-popup ref="jianzhiPopup" background-color="rgba(2, 171, 255, 1)" borderRadius="40px 40px 40px 40px">
<view class="jianzhi-content" @tap="navigatorTo('partTimeReg')">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/faf25c687bc1417282ebac719fd1bfba.png" alt=""
style="width: 100%;height: 100%;">
<view style="position: absolute;bottom: -50px;left: 130px;" @tap.stop="$refs.jianzhiPopup.close()">
<uni-icons type="close" size="40" color="#fff"></uni-icons>
</view>
</view>
</uni-popup>
<!-- 多个商家选择弹窗 -->
<uni-popup ref="shopPopup" background-color="transparent" borderRadius="40px 40px 40px 40px">
<view class="shop-content">
<view class="popup-pay-title">
<text>选择要进入的店铺</text>
</view>
<view class="popup-list" hover-class="tap-soft" hover-stay-time="80" @tap="clickShop(item)"
v-for="(item,index) in schoolShop" :key="index">
{{item.shopName}}
</view>
</view>
</uni-popup>
<!-- 弹出区域选择 -->
<uni-popup ref="areaPopup" background-color="transparent">
<view class="popup-area-content">
<view class="popup-area-title">
<text>选择你的校园半径</text>
</view>
<view class="popup-area-container" hover-class="tap-soft" hover-stay-time="80"
v-for="(item,index) in areaList" :key="index" @tap="onClickArea(item)">
<text style="display: inline-block">{{item.title}}</text>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
export default {
data() {
return {
areaList: [],
schoolShop: [],
workerCounts: 0,
shopCounts: 0,
balance: '0.00',
worker: uni.getStorageSync('worker'),
balanceRefreshId: 0,
refreshing: false,
couponCount: Number(uni.getStorageSync('couponCount')) || 8,
blindBoxCount: Number(uni.getStorageSync('blindBoxCount')) || 2,
orderCounts: {
pay: Number(uni.getStorageSync('orderPayCount')) || 2,
delivery: Number(uni.getStorageSync('orderDeliveryCount')) || 1,
evaluate: Number(uni.getStorageSync('orderEvaluateCount')) || 3,
refund: Number(uni.getStorageSync('orderRefundCount')) || 1
},
savedMoney: uni.getStorageSync('savedMoney') || '286',
rewardMoney: uni.getStorageSync('rewardMoney') || '58.6',
deliveryIncome: uni.getStorageSync('deliveryIncome') || '86'
}
},
computed: {
hasWorker() {
return !!this.worker
},
hasShop() {
const shopId = uni.getStorageSync('shopId')
const shops = this.normalizeShopList(this.schoolShop.length ? this.schoolShop : uni.getStorageSync('schoolShop'))
return !!shopId || shops.length > 0
},
userName() {
return uni.getStorageSync('nickName') || uni.getStorageSync('nickname') || uni.getStorageSync('userName') || '张昊雯'
},
avatarText() {
return (this.userName || '张').slice(0, 1)
},
schoolName() {
const area = this.getArea()
return uni.getStorageSync('schoolName') || area.title || '沧州师范学院'
},
milkTeaCount() {
return Math.max(1, Math.round((Number(this.savedMoney) || 0) / 5))
},
identityCards() {
return [{
type: 'user',
title: '普通用户',
desc: '点外卖 · 拼团 · 省券',
action: 'dingdan'
}, {
type: 'delivery',
title: '校园配送员',
desc: '自由接单 · 灵活赚钱',
tag: this.hasWorker ? (this.worker && this.worker.isOnLine == 1 ? '接单中' : '休息中') : '',
action: this.hasWorker ? 'jianzhizhuye' : 'jianzhizhuce'
}, {
type: 'shop',
title: '商家中心',
desc: '管理店铺 · 经营数据',
action: this.hasShop ? 'merchantCenter' : 'merchant'
}]
},
earnTasks() {
return [{
type: 'group',
title: '拼团省钱',
time: '还差 2 人成团',
button: '去拼团',
action: 'dingdan'
}, {
type: 'cash',
title: '白嫖现金',
time: '22:00 开奖',
button: '去参与',
action: 'planet'
}, {
type: 'school',
title: '学院奖金',
time: '当前排名 12',
button: '去助推',
action: 'planet'
}, {
type: 'wallet',
title: '可提现',
time: '余额 ¥' + this.rewardMoney,
button: '去提现',
action: 'qianbao'
}]
},
quickItems() {
return [{
type: 'order',
title: '我的订单',
tip: '待付款' + this.orderCounts.pay,
action: 'dingdan'
}, {
type: 'wallet',
title: '我的钱包',
tip: '余额 ¥' + this.balance,
action: 'qianbao'
}, {
type: 'coupon',
title: '优惠券',
tip: this.couponCount + '张可用',
action: 'youhui'
}, {
type: 'address',
title: '收货地址',
tip: '3 个地址',
action: 'address'
}, {
type: 'collect',
title: '我的收藏',
tip: '12 个收藏',
action: 'collect'
}]
},
lifeCards() {
return [{
type: 'ie',
title: 'IE',
desc: '找搭子一起吃饭学习',
action: 'ie'
}, {
type: 'fish',
title: '鱼塘',
desc: '二手交易更省钱',
action: 'fishRelease'
}, {
type: 'secret',
title: '校园秘闻',
desc: '看看学校新鲜事',
action: 'planet'
}, {
type: 'agent',
title: '成为代理',
desc: '邀请好友赚佣金',
action: 'agent'
}]
}
},
mounted() {
uni.$on('myCenterCountsChange', this.setPendingCounts)
},
beforeDestroy() {
uni.$off('myCenterCountsChange', this.setPendingCounts)
},
methods: {
getArea() {
try {
return uni.getStorageSync('area') ? JSON.parse(uni.getStorageSync('area')) : {}
} catch (e) {
return {}
}
},
normalizeShopList(list) {
if (Array.isArray(list)) return list
if (!list) return []
if (typeof list == 'string') {
try {
const parsed = JSON.parse(list)
return Array.isArray(parsed) ? parsed : []
} catch (e) {
return []
}
}
return typeof list == 'object' ? [list] : []
},
showComingSoon(title) {
this.tui.toast(title + '即将开放')
},
setPendingCounts(counts) {
this.workerCounts = Number(counts.workerCounts) || 0
this.shopCounts = Number(counts.shopCounts) || 0
this.$forceUpdate()
},
onRefresh() {
this.refreshing = true
Promise.resolve(this.init()).then(() => {
this.refreshing = false
}).catch(() => {
this.refreshing = false
})
},
init() {
this.schoolShop = this.normalizeShopList(uni.getStorageSync('schoolShop'))
this.worker = uni.getStorageSync('worker')
let shopId = uni.getStorageSync('shopId')
let worker = uni.getStorageSync('worker')
this.workerCounts = 0
this.shopCounts = 0
if (worker) {
this.workerCounts = Number(uni.getStorageSync('workerCounts')) || 0
}
if (shopId) {
this.shopCounts = Number(uni.getStorageSync('shopCounts')) || 0
}
this.balance = '0.00'
const refreshId = ++this.balanceRefreshId
return this.tui.request("/worker/getAllDepo/", "GET", {
userId: uni.getStorageSync('id')
}, false, true).then((res) => {
if (refreshId != this.balanceRefreshId) return
if (res.code == 200) {
let balance = 0
if (res.result.user) {
balance += Number(res.result.user.depoBal) || 0
}
if (res.result.worker) {
balance += Number(res.result.worker.depoBal) || 0
balance += Number(res.result.worker.depoBalRel) || 0
}
if (res.result.shop) {
for (let i = 0; i < res.result.shop.length; i++) {
balance += Number(res.result.shop[i].balance) || 0
}
}
this.balance = balance.toFixed(2)
this.$forceUpdate()
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {
uni.hideLoading()
})
},
clickShop(item) {
uni.setStorageSync('shopId', item.id)
uni.setStorageSync('shopName', item.shopName)
uni.setStorageSync('shopIcon', item.shopIcon)
uni.setStorageSync('shopScore', item.shopScore)
uni.setStorageSync('shopTakeaway', item.shopTakeaway)
uni.setStorageSync('attrId', item.attrId)
this.$refs.shopPopup.close()
uni.navigateTo({
url: '/package2/shop/merchantCenter'
})
},
checkArea() {
this.tui.request("/app/shopArea/getByParentId/0", "get", {}, false, false).then((res) => {
if (res.code == 200) {
this.areaList = res.result
this.$refs.areaPopup.open()
} else {
this.tui.toast(res.message)
}
})
},
onClickArea(item) {
uni.setStorageSync('area', JSON.stringify(item))
this.tui.toast('切换成功')
this.$refs.areaPopup.close()
},
navigatorTo(e, index) {
let url = ""
if (e == 'addgoods') {
url = '/package2/myCenter/addGoods'
} else if (e == 'merchantCenter') {
this.schoolShop = this.normalizeShopList(this.schoolShop.length ? this.schoolShop : uni.getStorageSync('schoolShop'))
if (this.schoolShop && this.schoolShop.length) {
let shopItem = []
const area = this.getArea()
for (let aa = 0; aa < this.schoolShop.length; aa++) {
if (!area.id || this.schoolShop[aa].regionId == area.id) {
shopItem.push(this.schoolShop[aa])
}
}
this.schoolShop = shopItem
if (this.schoolShop.length > 1) {
this.$refs.shopPopup.open()
return
} else if (this.schoolShop.length == 1) {
uni.setStorageSync('shopId', this.schoolShop[0].id)
uni.setStorageSync('attrId', this.schoolShop[0].attrId)
uni.setStorageSync('shopName', this.schoolShop[0].shopName)
uni.setStorageSync('shopIcon', this.schoolShop[0].shopIcon)
uni.setStorageSync('shopScore', this.schoolShop[0].shopScore)
uni.setStorageSync('shopTakeaway', this.schoolShop[0].shopTakeaway)
url = '/package2/shop/merchantCenter'
}
} else {
uni.showModal({
title: '提示',
content: '您还没有注册成为商家,要去注册吗?',
cancelText: '暂时不了',
confirmText: '去注册',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/package2/shop/merchantRegister'
})
}
}
})
return
}
} else if (e == 'dingdan') {
url = '/package1/order/orderList'
} else if (e == 'addType') {
url = '/package2/myCenter/addType'
} else if (e == 'qianbao') {
url = '/package2/myCenter/wallet'
} else if (e == 'youhui') {
url = '/package2/myCenter/couponList'
} else if (e == 'goodsList') {
url = '/package2/myCenter/goodsList'
} else if (e == 'merchant') {
url = '/package2/shop/merchantRegister'
} else if (e == 'tuichu') {
uni.clearStorageSync()
uni.reLaunch({
url: '/package2/login/login'
})
return
} else if (e == 'qiehuan') {
this.checkArea()
return
} else if (e == 'address') {
url = '/package2/myCenter/addressList'
} else if (e == 'collect') {
url = '/package2/myCenter/myCollect'
} else if (e == 'evaluate') {
this.showComingSoon('我的评价')
return
} else if (e == 'feedback') {
this.showComingSoon('消息')
return
} else if (e == 'blindBox') {
this.showComingSoon('星球券')
return
} else if (e == 'fishRelease') {
url = '/package1/tabbar/release'
} else if (e == 'myPost') {
url = '/package2/myCenter/myPost'
} else if (e == 'idleTrad') {
url = '/package2/IdleTrad/detail'
} else if (e == 'agent') {
this.showComingSoon('成为代理')
return
} else if (e == 'ie') {
url = '/package1/ieBrowser/index'
} else if (e == 'planet') {
url = '/package1/planet/index'
} else if (e == 'deliveryRank') {
url = '/package2/shop/ranking'
} else if (e == 'shopData') {
url = '/package2/myCenter/dataStatistics'
} else if (e == 'jianzhichaping') {
let item = {
shopScore: uni.getStorageSync('worker').score,
id: uni.getStorageSync('worker').workerId
}
url = '/package2/group/shopEvaluate?item=' + JSON.stringify(item) + '&isMerchant=2&isCha=' + (index ==
'cha' ? 1 : 0)
} else if (e == 'partTimeReg') {
let worker = uni.getStorageSync('worker')
let that = this
if (worker == undefined || worker == '' || worker == null) {
const area = this.getArea()
that.tui.request("/worker/admin/add", "POST", {
userId: uni.getStorageSync('id'),
isChangeArea: 1,
region: area.id
}, false, true).then((res) => {
if (res.code == 200) {
if (res.result != null) {
uni.setStorageSync('worker', res.result)
}
this.$refs.jianzhiPopup.close()
uni.navigateTo({
url: '/package2/myCenter/partTimeJobRegister'
})
} else {
that.tui.toast(res.message)
return
}
uni.hideLoading()
}).catch((res) => {})
return
} else {
url = '/package2/myCenter/partTimeJobRegister'
this.$refs.jianzhiPopup.close()
}
} else if (e == 'jianzhizhuce') {
if (uni.getStorageSync('worker')) {
url = '/package2/myCenter/partTimeJobRegister'
} else {
this.$refs.jianzhiPopup.open()
return
}
} else if (e == 'jianzhizhuye') {
url = '/package2/partTimeJob/partTimeJobCenter'
}
if (!url) return
uni.navigateTo({
url: url
})
}
}
}
</script>
<style>
page {
width: 100%;
height: 100%;
font-size: 28rpx;
background: #F8FCFA;
}
.mine-page {
width: 100%;
height: 100%;
color: #202124;
background:
radial-gradient(circle at 18% 0%, rgba(52, 200, 160, .10) 0, rgba(52, 200, 160, 0) 330rpx),
radial-gradient(circle at 86% 26%, rgba(255, 166, 61, .10) 0, rgba(255, 166, 61, 0) 360rpx),
#F8FCFA;
}
.mine-scroll {
width: 100%;
height: 100%;
}
.mine-content {
position: relative;
padding: 24rpx 32rpx 156rpx;
box-sizing: border-box;
}
.fade-up {
opacity: 0;
transform: translateY(24rpx);
animation: fadeUp .46s ease forwards;
}
.profile-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.profile-left {
display: flex;
align-items: center;
min-width: 0;
}
.avatar-card {
position: relative;
width: 112rpx;
height: 112rpx;
margin-right: 24rpx;
border-radius: 32rpx;
background: linear-gradient(145deg, rgba(219, 255, 239, .95), rgba(255, 247, 226, .95));
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
}
.avatar-face {
width: 100%;
height: 100%;
color: #202124;
font-size: 48rpx;
font-weight: 900;
line-height: 112rpx;
text-align: center;
}
.avatar-level {
position: absolute;
right: -8rpx;
bottom: 8rpx;
height: 30rpx;
padding: 0 12rpx;
border-radius: 999rpx;
background: #FFA63D;
color: #FFFFFF;
font-size: 22rpx;
font-weight: 900;
line-height: 30rpx;
}
.profile-copy {
min-width: 0;
text-align: left;
}
.name-row {
display: flex;
align-items: center;
}
.profile-name {
color: #202124;
font-size: 36rpx;
font-weight: 900;
line-height: 48rpx;
}
.verified-dot {
width: 22rpx;
height: 22rpx;
margin-left: 12rpx;
border-radius: 50%;
background: #34C8A0;
position: relative;
}
.verified-dot:after {
content: '';
position: absolute;
left: 7rpx;
top: 5rpx;
width: 8rpx;
height: 5rpx;
border-left: 3rpx solid #FFFFFF;
border-bottom: 3rpx solid #FFFFFF;
transform: rotate(-45deg);
}
.profile-school {
margin-top: 4rpx;
color: #70757A;
font-size: 22rpx;
line-height: 30rpx;
}
.profile-tag {
display: inline-flex;
height: 34rpx;
margin-top: 8rpx;
padding: 0 14rpx;
border-radius: 999rpx;
background: rgba(52, 200, 160, .16);
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 34rpx;
}
.profile-actions {
display: flex;
gap: 16rpx;
}
.action-dot {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 56rpx;
height: 56rpx;
border-radius: 50%;
background: rgba(255, 255, 255, .74);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
transition: transform .16s ease;
}
.line-icon {
color: #202124;
font-size: 28rpx;
font-weight: 900;
}
.has-news:after {
content: '';
position: absolute;
right: 8rpx;
top: 8rpx;
width: 14rpx;
height: 14rpx;
border-radius: 50%;
background: #FF6464;
}
.ticket-card {
position: absolute;
right: 32rpx;
top: 124rpx;
z-index: 3;
display: flex;
align-items: center;
width: 154rpx;
height: 76rpx;
padding: 12rpx;
border-radius: 24rpx;
background: rgba(255, 255, 255, .78);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
box-sizing: border-box;
transition: transform .16s ease;
}
.ticket-copy {
flex: 1;
text-align: left;
}
.ticket-title {
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 26rpx;
}
.ticket-value {
margin-top: 2rpx;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 32rpx;
}
.ticket-value text {
margin-left: 2rpx;
color: #70757A;
font-size: 22rpx;
}
.ticket-icon {
display: flex;
align-items: center;
justify-content: center;
width: 42rpx;
height: 42rpx;
border-radius: 16rpx;
background: linear-gradient(135deg, #34C8A0, #B7F5E4);
}
.ticket-star {
width: 22rpx;
height: 22rpx;
background: #FFFFFF;
clip-path: polygon(50% 0, 61% 36%, 100% 36%, 68% 58%, 80% 100%, 50% 74%, 20% 100%, 32% 58%, 0 36%, 39% 36%);
}
.saving-hero,
.module-card,
.quick-bar,
.logout-btn,
.shop-content,
.popup-area-content {
border-radius: 32rpx;
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
box-sizing: border-box;
}
.saving-hero {
position: relative;
height: 252rpx;
margin-top: 28rpx;
padding: 24rpx;
overflow: hidden;
background: linear-gradient(135deg, #E9FFF6 0%, #DDF7EF 56%, #FFF3DE 100%);
transition: transform .16s ease;
}
.soft-planet {
position: absolute;
right: 154rpx;
top: -10rpx;
width: 160rpx;
height: 78rpx;
border-radius: 50%;
background: rgba(52, 200, 160, .18);
transform: rotate(-18deg);
}
.soft-planet:after {
content: '';
position: absolute;
left: -20rpx;
top: 28rpx;
width: 200rpx;
height: 14rpx;
border-radius: 999rpx;
background: rgba(52, 200, 160, .22);
}
.saving-left {
position: relative;
z-index: 2;
text-align: left;
}
.saving-pill {
display: inline-flex;
height: 42rpx;
padding: 0 18rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, .78);
color: #202124;
font-size: 22rpx;
font-weight: 900;
line-height: 42rpx;
}
.saving-money {
margin-top: 10rpx;
color: #202124;
font-size: 82rpx;
font-weight: 900;
line-height: 92rpx;
letter-spacing: -3rpx;
}
.saving-desc,
.saving-week {
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 30rpx;
}
.saving-week {
margin-top: 4rpx;
color: #70757A;
}
.saving-squirrel {
position: absolute;
right: 12rpx;
bottom: 0;
z-index: 2;
width: 190rpx;
height: 190rpx;
}
.drink-prop {
position: absolute;
right: 190rpx;
bottom: 34rpx;
width: 56rpx;
height: 78rpx;
border-radius: 18rpx;
background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 166, 61, .28));
transform: rotate(-16deg);
box-shadow: 0 12rpx 40rpx rgba(30, 80, 60, .06);
}
.module-card {
margin-top: 28rpx;
padding: 24rpx;
background: rgba(255, 255, 255, .78);
}
.section-head {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 16rpx;
text-align: left;
}
.section-title {
color: #202124;
font-size: 36rpx;
font-weight: 900;
line-height: 46rpx;
}
.section-desc {
margin-top: 8rpx;
color: #70757A;
font-size: 22rpx;
line-height: 30rpx;
}
.text-link {
flex-shrink: 0;
color: #34C8A0;
font-size: 22rpx;
font-weight: 900;
line-height: 36rpx;
}
.earn-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 14rpx;
margin-top: 24rpx;
}
.earn-item {
min-height: 218rpx;
padding: 18rpx 10rpx 14rpx;
border-radius: 24rpx;
box-sizing: border-box;
text-align: center;
transition: transform .16s ease;
}
.earn-item--group,
.life-card--ie,
.identity-card--user {
background: linear-gradient(180deg, #E7FFF4, #DDF9EB);
}
.earn-item--cash,
.identity-card--shop,
.life-card--agent {
background: linear-gradient(180deg, #FFF4E5, #FFEBDC);
}
.earn-item--school,
.life-card--fish,
.identity-card--delivery {
background: linear-gradient(180deg, #EAF7FF, #E7F2FF);
}
.earn-item--wallet,
.life-card--secret {
background: linear-gradient(180deg, #FFF4E9, #FFF0D9);
}
.earn-title {
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 34rpx;
white-space: nowrap;
}
.earn-time {
margin-top: 4rpx;
color: #FF6464;
font-size: 22rpx;
line-height: 30rpx;
white-space: nowrap;
transform: scale(.88);
}
.earn-visual {
display: flex;
align-items: center;
justify-content: center;
height: 78rpx;
margin-top: 10rpx;
}
.asset-graphic {
position: relative;
width: 62rpx;
height: 62rpx;
border-radius: 20rpx;
background: #34C8A0;
}
.asset-graphic--group {
border-radius: 50%;
box-shadow: -24rpx 24rpx 0 rgba(52, 200, 160, .7), 24rpx 24rpx 0 rgba(52, 200, 160, .55);
}
.asset-graphic--cash:before {
content: '';
position: absolute;
left: -8rpx;
top: 22rpx;
width: 78rpx;
height: 14rpx;
background: #FFA63D;
border-radius: 999rpx;
}
.asset-graphic--school {
background: #FFA63D;
border-radius: 14rpx 14rpx 28rpx 28rpx;
}
.asset-graphic--wallet {
background: #FFA63D;
border-radius: 18rpx;
}
.earn-button {
height: 48rpx;
margin-top: 10rpx;
border-radius: 999rpx;
background: #34C8A0;
color: #FFFFFF;
font-size: 22rpx;
font-weight: 900;
line-height: 48rpx;
}
.earn-item--cash .earn-button,
.earn-item--wallet .earn-button {
background: #FFA63D;
}
.identity-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 14rpx;
margin-top: 24rpx;
}
.identity-card {
position: relative;
min-height: 168rpx;
padding: 18rpx;
border-radius: 24rpx;
box-sizing: border-box;
text-align: left;
transition: transform .16s ease;
}
.identity-tag {
position: absolute;
right: 12rpx;
top: -14rpx;
height: 34rpx;
padding: 0 14rpx;
border-radius: 999rpx;
background: #34C8A0;
color: #FFFFFF;
font-size: 22rpx;
font-weight: 900;
line-height: 34rpx;
}
.identity-icon,
.quick-icon {
display: flex;
align-items: center;
justify-content: center;
width: 58rpx;
height: 58rpx;
border-radius: 50%;
background: rgba(255, 255, 255, .74);
}
.simple-icon,
.quick-mark {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
background: #34C8A0;
}
.simple-icon--delivery {
background: #34C8A0;
border-radius: 8rpx;
box-shadow: 24rpx 12rpx 0 -6rpx #34C8A0, -22rpx 12rpx 0 -6rpx #34C8A0;
}
.simple-icon--shop {
background: #FFA63D;
border-radius: 8rpx 8rpx 2rpx 2rpx;
}
.identity-title {
margin-top: 14rpx;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 36rpx;
}
.identity-desc {
margin-top: 6rpx;
color: #70757A;
font-size: 22rpx;
line-height: 30rpx;
}
.identity-enter,
.life-enter {
position: absolute;
right: 14rpx;
bottom: 14rpx;
display: flex;
align-items: center;
justify-content: center;
width: 38rpx;
height: 38rpx;
border-radius: 50%;
background: rgba(255, 255, 255, .78);
color: #34C8A0;
font-size: 28rpx;
font-weight: 900;
}
.quick-bar {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 10rpx;
margin-top: 28rpx;
padding: 24rpx 10rpx;
background: rgba(255, 255, 255, .78);
}
.quick-item {
text-align: center;
transition: transform .16s ease;
}
.quick-icon {
margin: 0 auto;
}
.quick-icon--wallet .quick-mark,
.quick-icon--coupon .quick-mark {
background: #FFA63D;
}
.quick-icon--address .quick-mark {
background: #A8B0B8;
}
.quick-title {
margin-top: 12rpx;
color: #202124;
font-size: 22rpx;
font-weight: 900;
line-height: 28rpx;
white-space: nowrap;
}
.quick-tip {
margin-top: 2rpx;
color: #70757A;
font-size: 22rpx;
line-height: 26rpx;
white-space: nowrap;
transform: scale(.82);
}
.life-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 14rpx;
margin-top: 24rpx;
}
.life-card {
position: relative;
min-height: 178rpx;
padding: 18rpx;
border-radius: 24rpx;
box-sizing: border-box;
text-align: left;
overflow: hidden;
transition: transform .16s ease;
}
.life-title {
position: relative;
z-index: 1;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 36rpx;
}
.life-desc {
position: relative;
z-index: 1;
margin-top: 6rpx;
color: #70757A;
font-size: 22rpx;
line-height: 30rpx;
transform-origin: left center;
transform: scale(.88);
}
.life-visual {
position: absolute;
left: 24rpx;
bottom: 20rpx;
width: 58rpx;
height: 42rpx;
border-radius: 50%;
background: #34C8A0;
}
.life-visual--fish {
background: #FFA63D;
}
.life-visual--secret {
border-radius: 12rpx;
background: #FFA63D;
}
.life-visual--agent {
border-radius: 12rpx;
background: #FFA63D;
}
.logout-btn {
display: flex;
align-items: center;
justify-content: center;
height: 88rpx;
margin-top: 28rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, .78);
color: #FF6464;
font-size: 28rpx;
font-weight: 900;
line-height: 88rpx;
transition: transform .16s ease;
}
.logout-power {
margin-right: 12rpx;
font-size: 28rpx;
}
.tap-soft,
.logout-active {
transform: scale(.98);
}
.jianzhi-content {
width: 300px;
height: 350px;
position: relative;
}
.shop-content,
.popup-area-content {
width: 600rpx;
padding: 24rpx;
background: rgba(255, 255, 255, .92);
}
.popup-pay-title,
.popup-area-title {
margin-bottom: 24rpx;
color: #202124;
font-size: 36rpx;
font-weight: 900;
text-align: left;
}
.popup-list,
.popup-area-container {
min-height: 88rpx;
margin-top: 16rpx;
padding: 0 24rpx;
border-radius: 24rpx;
background: #F8FCFA;
color: #202124;
font-size: 28rpx;
font-weight: 900;
line-height: 88rpx;
text-align: left;
box-sizing: border-box;
}
.money-roll {
animation: moneyRoll .72s ease both;
}
@keyframes fadeUp {
from {
opacity: 0;
transform: translateY(24rpx);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes moneyRoll {
0% {
opacity: 0;
transform: translateY(24rpx);
}
100% {
opacity: 1;
transform: translateY(0);
}
}
</style>