first commit
This commit is contained in:
@@ -0,0 +1,511 @@
|
||||
<template>
|
||||
<!-- 骨架屏 -->
|
||||
<view v-if="loading" class="skeleton-container">
|
||||
<!-- 余额区域骨架屏 -->
|
||||
<view class="skeleton-balance-section">
|
||||
<view class="skeleton-balance-label"></view>
|
||||
<view class="skeleton-balance-amount"></view>
|
||||
<view class="skeleton-balance-current"></view>
|
||||
</view>
|
||||
|
||||
<!-- 账户选择区域骨架屏 -->
|
||||
<view class="skeleton-account-section">
|
||||
<view class="skeleton-section-title"></view>
|
||||
<view class="skeleton-account-item">
|
||||
<view class="skeleton-account-icon"></view>
|
||||
<view class="skeleton-account-name"></view>
|
||||
<view class="skeleton-account-radio"></view>
|
||||
</view>
|
||||
<view class="skeleton-account-item">
|
||||
<view class="skeleton-account-icon"></view>
|
||||
<view class="skeleton-account-name"></view>
|
||||
<view class="skeleton-account-radio"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息骨架屏 -->
|
||||
<view class="skeleton-tip-section">
|
||||
<view class="skeleton-tip-icon"></view>
|
||||
<view class="skeleton-tip-content">
|
||||
<view class="skeleton-tip-line"></view>
|
||||
<view class="skeleton-tip-line-small"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 确认按钮骨架屏 -->
|
||||
<view class="skeleton-confirm-section">
|
||||
<view class="skeleton-confirm-button"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 真实内容 -->
|
||||
<view v-else class="withdraw-container">
|
||||
<!-- 可提现金额 -->
|
||||
<view class="balance-section">
|
||||
<text class="balance-label">可提现金额</text>
|
||||
<text class="balance-amount">¥86.50</text>
|
||||
<text class="current-balance">当前钱包余额</text>
|
||||
</view>
|
||||
|
||||
<!-- 提现账户选择 -->
|
||||
<view class="account-section">
|
||||
<text class="section-title">提现账户</text>
|
||||
<view class=""
|
||||
style="display: flex;align-items: center; border-bottom: 4rpx solid #e2e2e2;padding-bottom: 10px; margin-bottom: 10px;">
|
||||
<up-icon name="zhifubao-circle-fill" size="30" color="#1890ff"></up-icon>
|
||||
<view style="flex: 1; margin-left: 30rpx; " class="">
|
||||
支付宝
|
||||
</view>
|
||||
<view @click="changePay(0)" class="">
|
||||
<view v-if="current==0" class="radio-circle">
|
||||
<view class="radio-inner"></view>
|
||||
</view>
|
||||
<view v-else class="radio-no-circle">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" style="display: flex;align-items: center;">
|
||||
<up-icon name="weixin-circle-fill" size="30" color="#28C445"></up-icon>
|
||||
<view style="flex: 1; margin-left: 30rpx; " class="">
|
||||
微信
|
||||
</view>
|
||||
<view @click="changePay(1)" class="">
|
||||
<view v-if="current==1" class="radio-circle">
|
||||
<view class="radio-inner"></view>
|
||||
</view>
|
||||
<view v-else class="radio-no-circle">
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<view class="tip-section">
|
||||
<up-icon name="clock" size="18" color="#1890ff"></up-icon>
|
||||
<view class="" style="margin-left: 10rpx;">
|
||||
<view class="tip-text">预计 T+1 工作日到账</view>
|
||||
<view class="tip-text" style="color: #666666; font-size: 24rpx; margin-top: 10rpx; ">无手续费</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 确认按钮 -->
|
||||
<view class="confirm-section">
|
||||
<button class="confirm-button" @click="confirmWithdraw">确认提现 ¥86.50</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import { ref } from 'vue';
|
||||
|
||||
let current = ref(null)
|
||||
let loading=ref(true)
|
||||
|
||||
onLoad(() => {
|
||||
setTimeout(()=>{
|
||||
loading.value=false
|
||||
},1000)
|
||||
})
|
||||
|
||||
const changePay = (item : any) => {
|
||||
current.value = item
|
||||
}
|
||||
|
||||
// 确认提现
|
||||
const confirmWithdraw = () => {
|
||||
// 这里可以添加提现逻辑
|
||||
uni.showToast({
|
||||
title: '提现申请已提交',
|
||||
icon: 'success'
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.withdraw-container {
|
||||
min-height: 100vh;
|
||||
background-color: #fff;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
/* 选择 */
|
||||
|
||||
.radio-circle {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border: 2rpx solid var(--nav-mian);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.radio-inner {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
background-color: var(--nav-mian);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.radio-no-circle {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
border: 2rpx solid #dadada;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* 顶部导航栏 */
|
||||
.nav-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx 20rpx;
|
||||
background-color: #fff;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.nav-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.back-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
.help-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
}
|
||||
|
||||
/* 余额显示区域 */
|
||||
.balance-section {
|
||||
background-color: #fff;
|
||||
padding: 40rpx 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.balance-label {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
display: block;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.balance-amount {
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
color: #ff4757;
|
||||
display: block;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.current-balance {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
/* 账户选择区域 */
|
||||
.account-section {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
display: block;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.account-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 25rpx 0;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.account-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.account-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.account-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
border-radius: 12rpx;
|
||||
background-color: #1677ff;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
border: 2rpx solid #000;
|
||||
}
|
||||
|
||||
.account-icon.wechat {
|
||||
background-color: #07c160;
|
||||
}
|
||||
|
||||
.icon-text {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.account-name {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 提示信息区域 */
|
||||
.tip-section {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background-color: #e6f7ff;
|
||||
padding: 20rpx 30rpx;
|
||||
margin: 0 30rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.tip-text {
|
||||
font-size: 28rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
/* 确认按钮区域 */
|
||||
.confirm-section {
|
||||
background-color: #fff;
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.confirm-button {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #1677ff;
|
||||
color: #fff;
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 45rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.confirm-button:active {
|
||||
background-color: #0958d9;
|
||||
}
|
||||
/* 骨架屏样式 */
|
||||
.skeleton-container {
|
||||
min-height: 100vh;
|
||||
background-color: #fff;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
/* 骨架屏动画 */
|
||||
@keyframes shimmer {
|
||||
0% {
|
||||
background-position: -1000px 0;
|
||||
}
|
||||
100% {
|
||||
background-position: 1000px 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* 骨架屏通用样式 */
|
||||
.skeleton-balance-section,
|
||||
.skeleton-account-section,
|
||||
.skeleton-tip-section {
|
||||
padding: 40rpx 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 余额区域骨架屏 */
|
||||
.skeleton-balance-section {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.skeleton-balance-label {
|
||||
width: 30%;
|
||||
height: 32rpx;
|
||||
background-color: #e6e6e6;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-balance-amount {
|
||||
width: 40%;
|
||||
height: 60rpx;
|
||||
background-color: #e6e6e6;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 4rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-balance-current {
|
||||
width: 25%;
|
||||
height: 28rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 4rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
/* 账户选择区域骨架屏 */
|
||||
.skeleton-account-section {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.skeleton-section-title {
|
||||
width: 25%;
|
||||
height: 32rpx;
|
||||
background-color: #e6e6e6;
|
||||
margin-bottom: 30rpx;
|
||||
border-radius: 4rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-account-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 30rpx;
|
||||
border-bottom: 4rpx solid #e2e2e2;
|
||||
}
|
||||
|
||||
.skeleton-account-item:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.skeleton-account-icon {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 12rpx;
|
||||
margin-right: 20rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-account-name {
|
||||
flex: 1;
|
||||
height: 32rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 4rpx;
|
||||
margin-right: 20rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-account-radio {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 50%;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
/* 提示信息骨架屏 */
|
||||
.skeleton-tip-section {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
background-color: #e6f7ff;
|
||||
padding: 20rpx 30rpx;
|
||||
margin: 0 30rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.skeleton-tip-icon {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-tip-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.skeleton-tip-line {
|
||||
width: 70%;
|
||||
height: 28rpx;
|
||||
background-color: #e6e6e6;
|
||||
margin-bottom: 15rpx;
|
||||
border-radius: 4rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
.skeleton-tip-line-small {
|
||||
width: 50%;
|
||||
height: 24rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 4rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
|
||||
/* 确认按钮骨架屏 */
|
||||
.skeleton-confirm-section {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.skeleton-confirm-button {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 45rpx;
|
||||
animation: shimmer 1.5s infinite;
|
||||
background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 1000px 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,341 @@
|
||||
<template>
|
||||
<view v-if="loading" style="margin: 20rpx; padding-top: 80rpx; ">
|
||||
<!-- 用户信息骨架屏 -->
|
||||
<view class="skeleton-user-card">
|
||||
<view class="skeleton-avatar"></view>
|
||||
<view class="skeleton-user-info">
|
||||
<view class="skeleton-line skeleton-name"></view>
|
||||
<view class="skeleton-line skeleton-id"></view>
|
||||
<view class="skeleton-line skeleton-status"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- 服务列表骨架屏 -->
|
||||
<view class="skeleton-section-title"></view>
|
||||
<view class="skeleton-service-list">
|
||||
<view class="skeleton-service-item" v-for="i in 4" :key="i">
|
||||
<view class="skeleton-icon"></view>
|
||||
<view class="skeleton-line skeleton-service-name"></view>
|
||||
<view class="skeleton-arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录按钮骨架屏 -->
|
||||
<view class="skeleton-logout-btn"></view>
|
||||
</view>
|
||||
<view v-else style="margin: 20rpx ; padding-top: 60rpx; ">
|
||||
<view class=""
|
||||
style="background: linear-gradient(to bottom,#E6F7FF,#FFFFFF) ; border-radius: 20rpx; display: flex; align-items: center; padding: 40rpx 20rpx; ">
|
||||
<image :src="Service.GetMateUrlByImg(riderInfo.headImg)"
|
||||
style="width: 110rpx; height: 110rpx; border-radius: 50%; border: 1rpx solid var(--nav-mian); " mode="">
|
||||
</image>
|
||||
<view class="" style="flex: 1; margin-left: 30rpx;">
|
||||
<view class="" style="display: flex; align-items: center; gap: 20rpx;">
|
||||
<view class="" style="font-size: 34rpx; font-weight: 600; color: var(--nav-mian); ">
|
||||
{{riderInfo.nick}}
|
||||
</view>
|
||||
<!-- <view class=""
|
||||
style="background-color: var(--nav-vice); color: #fff; padding: 4rpx 10rpx; border-radius: 4rpx; font-size: 24rpx; display: flex; align-items: baseline; justify-content: center; ">
|
||||
4.9
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="" style="margin: 10rpx 0; font-size: 28rpx; ">
|
||||
riderNo: {{ riderInfo.riderNo }}
|
||||
</view>
|
||||
<view class="" style="color: var(--nav-vice); font-weight: bold; ">
|
||||
{{ riderInfo.status==0?'审核中':(riderInfo.isOnline==0?'已下线':'已上线') }}
|
||||
</view>
|
||||
</view>
|
||||
<view @click="Service.GoPage('/pages/my/edit')" class="">
|
||||
<u-icon name="setting" size="20"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="" style="margin: 20rpx 0;">
|
||||
<text style="font-size: 34rpx; font-weight: 600; ">我的服务</text>
|
||||
</view>
|
||||
<view class="" style=" background-color: #fff; border-radius: 20rpx; ">
|
||||
<view class="" @click="gopage(funcItem,funcIndex)" v-for="(funcItem,funcIndex) in funcList" :key="funcIndex"
|
||||
style=" border-bottom: 1rpx solid #e2e2e2; display: flex; align-items: center; padding: 24rpx 30rpx; ">
|
||||
<image :src="Service.GetIconImg(funcItem.icon)" style="width: 50rpx; height: 50rpx; " mode=""></image>
|
||||
<view class="" style="flex: 1; font-size: 28rpx; margin-left: 20rpx; ">
|
||||
{{funcItem.name}}
|
||||
</view>
|
||||
<view class="">
|
||||
<up-icon name="arrow-right"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button @click=" reLogin() " class="confirm-button">退出登录</button>
|
||||
<view class="" style="width: 100%; height: 100rpx; ">
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import { Service } from "@/Service/Service";
|
||||
import { ref } from 'vue'
|
||||
import { CNRiderDataService } from "@/Service/CN/CNRiderDataService"
|
||||
|
||||
|
||||
let loading = ref(true)
|
||||
|
||||
let funcList = ref([
|
||||
{
|
||||
name: '联系客服',
|
||||
icon: '/static/index/user/phone.png',
|
||||
path: '/pages/my/myKF'
|
||||
},
|
||||
{
|
||||
name: '异常订单',
|
||||
icon: '/static/index/user/warming.png',
|
||||
path: '/pages/my/AbnormalList'
|
||||
},
|
||||
// {
|
||||
// name: '签到与奖励',
|
||||
// icon: '/static/index/user/check.png',
|
||||
// path: '/pages/my/check'
|
||||
// },
|
||||
{
|
||||
name: '提现列表',
|
||||
icon: '/static/index/user/security.png',
|
||||
path: '/pages/my/withDrowList'
|
||||
},
|
||||
{
|
||||
name: '账号与安全',
|
||||
icon: '/static/index/user/security.png',
|
||||
path: '/pages/my/security'
|
||||
},
|
||||
{
|
||||
name: '评价中心',
|
||||
icon: '/static/index/user/security.png',
|
||||
path: '/pages/my/evaluate'
|
||||
}
|
||||
])
|
||||
|
||||
let riderInfo=ref<any>({})
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
getData()
|
||||
});
|
||||
|
||||
|
||||
const getData = () => {
|
||||
CNRiderDataService.GetRiderInfo().then(res => {
|
||||
loading.value = false
|
||||
if(res.data){
|
||||
riderInfo.value=res.data.riderInfo
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const gopage = (item : any, index : number) => {
|
||||
Service.GoPage(item.path)
|
||||
}
|
||||
|
||||
|
||||
const reLogin =()=>{
|
||||
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.$emit('ImComOff',{});
|
||||
Service.OffUserToken()
|
||||
Service.GoPage('/pages/my/login')
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.confirm-button {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #1677ff;
|
||||
color: #fff;
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 45rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: none;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.confirm-button:active {
|
||||
background-color: #0958d9;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 骨架屏基础样式和动画
|
||||
.skeleton-loading {
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
@keyframes skeleton-loading {
|
||||
0% {
|
||||
background-position: 200% 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 骨架屏公共样式
|
||||
.skeleton-line {
|
||||
height: 32rpx;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
// 用户信息卡片骨架
|
||||
.skeleton-user-card {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 40rpx 20rpx;
|
||||
background: linear-gradient(to bottom, #f0f0f0, #fafafa);
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.skeleton-avatar {
|
||||
width: 110rpx;
|
||||
height: 110rpx;
|
||||
border-radius: 50%;
|
||||
background-color: #f0f0f0;
|
||||
|
||||
}
|
||||
|
||||
.skeleton-user-info {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
|
||||
.skeleton-name {
|
||||
width: 40%;
|
||||
height: 36rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.skeleton-id {
|
||||
width: 60%;
|
||||
height: 30rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.skeleton-status {
|
||||
width: 50%;
|
||||
height: 28rpx;
|
||||
}
|
||||
|
||||
// 数据统计卡片骨架
|
||||
.skeleton-stats-card {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.skeleton-stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.skeleton-stat-value {
|
||||
width: 80%;
|
||||
height: 40rpx;
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
|
||||
.skeleton-stat-label {
|
||||
width: 60%;
|
||||
height: 28rpx;
|
||||
}
|
||||
|
||||
// 服务列表骨架
|
||||
.skeleton-section-title {
|
||||
height: 40rpx;
|
||||
background-color: #fff;
|
||||
width: 30%;
|
||||
margin: 20rpx 0;
|
||||
|
||||
.skeleton-loading {}
|
||||
}
|
||||
|
||||
.skeleton-service-list {
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.skeleton-service-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 24rpx 30rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.skeleton-service-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.skeleton-icon {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 8rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.skeleton-service-name {
|
||||
flex: 1;
|
||||
height: 30rpx;
|
||||
}
|
||||
|
||||
.skeleton-arrow {
|
||||
width: 20rpx;
|
||||
height: 20rpx;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 4rpx;
|
||||
|
||||
}
|
||||
|
||||
// 退出登录按钮骨架
|
||||
.skeleton-logout-btn {
|
||||
height: 90rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 45rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
}
|
||||
|
||||
// 底部占位
|
||||
.skeleton-bottom-space {
|
||||
height: 100rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,361 @@
|
||||
<template>
|
||||
|
||||
<view v-if="loading" class="skeleton-container">
|
||||
<!-- 安全等级卡片骨架 -->
|
||||
<view class="security-level-card skeleton-card">
|
||||
<view class="security-level-header">
|
||||
<view class="skeleton-line skeleton-line-sm"></view>
|
||||
</view>
|
||||
<view class="progress-bar skeleton-progress"></view>
|
||||
<view class="skeleton-line skeleton-line-xs"></view>
|
||||
</view>
|
||||
|
||||
<!-- 安全设置列表骨架 -->
|
||||
<view class="security-settings skeleton-settings">
|
||||
<view class="security-item skeleton-item" v-for="i in 3" :key="i">
|
||||
<view class="item-left">
|
||||
<view class="item-icon skeleton-icon"></view>
|
||||
<view class="skeleton-line skeleton-line-md"></view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<view class="skeleton-line skeleton-line-sm"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 安全提示卡片骨架 -->
|
||||
<view class="security-tip-card skeleton-tip-card">
|
||||
<view class="tip-content">
|
||||
<view class="skeleton-circle"></view>
|
||||
<view class="skeleton-line skeleton-line-full"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-else class="account-security-page" style="overflow: hidden;" >
|
||||
<!-- 安全等级卡片 -->
|
||||
<view class="security-level-card">
|
||||
<view class="security-level-header">
|
||||
<text class="security-level-label">账号安全等级:</text>
|
||||
<text class="security-level-value">高</text>
|
||||
</view>
|
||||
<view class="progress-bar">
|
||||
<view class="progress-fill"></view>
|
||||
</view>
|
||||
<view class="security-desc">您已完成所有安全设置</view>
|
||||
</view>
|
||||
|
||||
<!-- 安全设置列表 -->
|
||||
<view class="security-settings">
|
||||
<!-- 实名认证 -->
|
||||
<view class="security-item" @click="Service.GoPage(item.path)" v-for="(item,index) in funcList" :key="index">
|
||||
<view class="item-left">
|
||||
<view class="item-icon">
|
||||
<image :src="Service.GetIconImg(item.icon)" style="width: 100%; height: 100%; " mode=""></image>
|
||||
</view>
|
||||
<text class="item-label">{{item.name}}</text>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<text class="item-status">{{ item.des }}</text>
|
||||
<up-icon name="arrow-right" size="19" color="#999"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<!-- 安全提示卡片 -->
|
||||
<view class="security-tip-card">
|
||||
<view class="tip-content">
|
||||
<up-icon name="info-circle-fill" size="24" color="#999"></up-icon>
|
||||
<text class="tip-text">为保障您的账号安全,请勿泄露验证码,定期更新密码。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { Service } from "@/Service/Service"
|
||||
import { ref } from 'vue'
|
||||
import { CNRiderDataService } from "@/Service/CN/CNRiderDataService"
|
||||
|
||||
let loading = ref(true)
|
||||
|
||||
let riderInfo=ref<any>({})
|
||||
|
||||
|
||||
const funcList = ref([
|
||||
{
|
||||
name: '实名认证',
|
||||
icon: '/static/index/my/security/security.png',
|
||||
des: "已认证",
|
||||
path:'/pages/my/authentication'
|
||||
},
|
||||
{
|
||||
name: '手机号绑定',
|
||||
icon: '/static/index/my/security/phone.png',
|
||||
des: "已绑定138****4441",
|
||||
path:'/pages/my/setConnect?type=1'
|
||||
},
|
||||
{
|
||||
name: '紧急联系人',
|
||||
icon: '/static/index/my/security/user.png',
|
||||
des: "张女士 138****4112",
|
||||
path:'/pages/my/setConnect?type=0'
|
||||
},
|
||||
{
|
||||
name: '修改密码',
|
||||
icon: '/static/index/my/security/mima.png',
|
||||
des: "",
|
||||
path:'/pages/my/editPasssword'
|
||||
}
|
||||
|
||||
])
|
||||
|
||||
// 页面加载时的逻辑
|
||||
onLoad(() => {
|
||||
|
||||
})
|
||||
|
||||
onShow(()=>{
|
||||
getData()
|
||||
getConnect()
|
||||
})
|
||||
|
||||
|
||||
const getData = () => {
|
||||
CNRiderDataService.GetRiderInfo().then(res => {
|
||||
loading.value = false
|
||||
if(res.data){
|
||||
riderInfo.value=res.data.riderInfo
|
||||
funcList.value[0].des=riderInfo.value.status===-1?'未认证':(riderInfo.value.status===0?'审核中':'已认证')
|
||||
funcList.value[1].des='已绑定'+' '+riderInfo.value.phone.slice(0,3)+'****'+riderInfo.value.phone.slice(-4)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const getConnect=()=>{
|
||||
CNRiderDataService.GetRiderExigency().then(res=>{
|
||||
if(res.data){
|
||||
funcList.value[2].des= res.data.info? res.data.info.phone : '未绑定'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
// 安全等级卡片样式
|
||||
.security-level-card {
|
||||
background-color: #E6F7FF;
|
||||
margin: 30rpx 30rpx 30rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.security-level-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.security-level-label {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.security-level-value {
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #007AFF;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 100%;
|
||||
height: 8rpx;
|
||||
background-color: #B3D8FF;
|
||||
border-radius: 4rpx;
|
||||
overflow: hidden;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.progress-fill {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #007AFF;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.security-desc {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
// 安全设置列表样式
|
||||
.security-settings {
|
||||
background-color: #fff;
|
||||
margin: 0 30rpx 30rpx;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.security-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.security-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.item-label {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.item-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-status {
|
||||
font-size: 28rpx;
|
||||
color: #4CD964;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
// 安全提示卡片样式
|
||||
.security-tip-card {
|
||||
background-color: #FFF8E8;
|
||||
margin: 0 30rpx;
|
||||
padding: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.tip-content {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.tip-text {
|
||||
flex: 1;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 36rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
// 骨架屏基础样式
|
||||
.skeleton-line {
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
border-radius: 4rpx;
|
||||
}
|
||||
|
||||
.skeleton-icon {
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.skeleton-circle {
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
border-radius: 50%;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.skeleton-progress {
|
||||
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
||||
background-size: 200% 100%;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
// 骨架屏线条尺寸
|
||||
.skeleton-line-xs {
|
||||
height: 28rpx;
|
||||
width: 200rpx;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.skeleton-line-sm {
|
||||
height: 32rpx;
|
||||
width: 300rpx;
|
||||
}
|
||||
|
||||
.skeleton-line-md {
|
||||
height: 36rpx;
|
||||
width: 240rpx;
|
||||
}
|
||||
|
||||
.skeleton-line-full {
|
||||
height: 36rpx;
|
||||
width: calc(100% - 60rpx);
|
||||
}
|
||||
|
||||
// 骨架屏动画
|
||||
@keyframes skeleton-loading {
|
||||
0% {
|
||||
background-position: 200% 0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-position: -200% 0;
|
||||
}
|
||||
}
|
||||
|
||||
// 骨架屏容器样式
|
||||
.skeleton-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// 骨架屏卡片样式
|
||||
.skeleton-card {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.skeleton-settings {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.skeleton-item {
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.skeleton-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.skeleton-tip-card {
|
||||
background-color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,807 @@
|
||||
<template>
|
||||
|
||||
<view v-if="isLoading" class="skeleton-container" style="padding-top: 80rpx;" >
|
||||
<!-- 统计数据区域骨架 -->
|
||||
<view class="skeleton-stats-section">
|
||||
<view class="skeleton-stat-item">
|
||||
<view class="skeleton-stat-label"></view>
|
||||
<view class="skeleton-stat-value"></view>
|
||||
</view>
|
||||
<view class="skeleton-stat-item">
|
||||
<view class="skeleton-stat-label"></view>
|
||||
<view class="skeleton-stat-value"></view>
|
||||
</view>
|
||||
<view class="skeleton-stat-item">
|
||||
<view class="skeleton-stat-label"></view>
|
||||
<view class="skeleton-stat-value"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 接单按钮骨架 -->
|
||||
<view class="skeleton-action-section">
|
||||
<view class="skeleton-accept-btn"></view>
|
||||
</view>
|
||||
|
||||
<!-- 标签栏骨架 -->
|
||||
<view class="skeleton-tab-bar">
|
||||
<view class="skeleton-tab-item">
|
||||
<view class="skeleton-tab-text"></view>
|
||||
</view>
|
||||
<view class="skeleton-tab-item">
|
||||
<view class="skeleton-tab-text"></view>
|
||||
</view>
|
||||
<view class="skeleton-tab-item">
|
||||
<view class="skeleton-tab-text"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 任务列表骨架 -->
|
||||
<view class="skeleton-task-list">
|
||||
<!-- 任务卡片骨架 -->
|
||||
<view class="skeleton-task-section" v-for="i in 3" :key="i">
|
||||
<!-- 高价单标签骨架 -->
|
||||
<view class="skeleton-tag-row">
|
||||
<view class="skeleton-high-price-tag"></view>
|
||||
<view class="skeleton-phone-btn"></view>
|
||||
</view>
|
||||
|
||||
<!-- 商家信息骨架 -->
|
||||
<view class="skeleton-merchant-info">
|
||||
<view class="skeleton-merchant-name"></view>
|
||||
<view class="skeleton-distance"></view>
|
||||
</view>
|
||||
|
||||
<!-- 地址信息骨架 -->
|
||||
<view class="skeleton-address-info">
|
||||
<view class="skeleton-address-text"></view>
|
||||
</view>
|
||||
|
||||
<!-- 价格和取餐时间骨架 -->
|
||||
<view class="skeleton-price-time-row">
|
||||
<view class="skeleton-pickup-code"></view>
|
||||
<view class="skeleton-pickup-time"></view>
|
||||
</view>
|
||||
|
||||
<!-- 立即抢单按钮骨架 -->
|
||||
<view class="skeleton-grab-btn"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 实际内容 -->
|
||||
<view v-else class="rider-home" style="padding-top: 60rpx;" >
|
||||
<!-- 统计数据区域 -->
|
||||
<view class="stats-section">
|
||||
<view class="stat-item">
|
||||
<text class="stat-label">今日收入</text>
|
||||
<text class="stat-value income">¥{{userData.dayAmount.toFixed(2)}}</text>
|
||||
</view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-label">已完成</text>
|
||||
<text class="stat-value completed">{{userData.dayOrderCount}}单</text>
|
||||
</view>
|
||||
<view class="stat-item">
|
||||
<text class="stat-label">配送中</text>
|
||||
<text class="stat-value ongoing">{{ userData.takeOrderCount }}单</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 接单按钮 -->
|
||||
<view class="action-section">
|
||||
<up-button :disabled='riderInfo.status===0' type="primary" shape="circle" size="default"
|
||||
class="accept-orders-btn"
|
||||
@click="toggleAcceptOrders">{{ riderInfo.status==0?'审核中':(riderInfo.isOnline == 0 ? '已下线' : '已上线') }}</up-button>
|
||||
</view>
|
||||
|
||||
<view class="tab-bar">
|
||||
<view v-for="(tab, index) in tabs" :key="index" class="tab-item" :class="{ active: activeTab === index }"
|
||||
@click="switchTab(index)">
|
||||
<text class="tab-text">{{ tab }}</text>
|
||||
<view v-if="activeTab === index" class="active-line"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="riderInfo.status==1" class="" style="padding: 0 30rpx;">
|
||||
<!-- -->
|
||||
<view v-for="(orderItem,orderIndex) in orderList " @click="gopage(orderItem.orderId)" :key="orderIndex"
|
||||
class="task-section">
|
||||
<!-- 高价单标签 -->
|
||||
<view class="" style="display: flex; align-items: center; justify-content: space-between;">
|
||||
|
||||
<view class="high-price-tag"
|
||||
:style="{'border':activeTab==0?'1rpx solid #FF7875':(activeTab==1?'1rpx solid #52C41A':'1rpx solid #FAAD14'),'color':activeTab==0?'#FF7875':(activeTab==1?'#52C41A':'#FAAD14') }"
|
||||
style="background-color: #fff;">
|
||||
<text class="high-price-text">{{activeTab==0? '新订单':(activeTab==1? '待取单':'配送中')}}</text>
|
||||
</view>
|
||||
<view class="" @click.stop="call(orderItem.phone)" style="display: flex; align-items: baseline;">
|
||||
<up-icon name="phone" color="var(--nav-mian)" size="20"></up-icon>
|
||||
<text style="margin-left: 10rpx; color: var(--nav-mian); ">拨打商家</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商家信息 -->
|
||||
<view class="merchant-info">
|
||||
<text class="merchant-name">{{ orderItem.storeName }}</text>
|
||||
<text v-if="activeTab==1" class="distance">{{ distance(orderItem.distance) }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 地址信息 -->
|
||||
<view class="address-info">
|
||||
<up-icon name="map" color="#999" size="24rpx" />
|
||||
<text class="address-text"> {{orderItem.address }}</text>
|
||||
<!-- <text v-if="activeTab!==0" class="address-text">共3件商品</text> -->
|
||||
</view>
|
||||
<!-- 商品次数-->
|
||||
<!-- <view class="address-info">
|
||||
<text class="address-text">共3件商品</text>
|
||||
<view class="">
|
||||
<text class="price">¥5.50</text>
|
||||
<text style="color: var(--nav-mian); font-weight: 600; margin-left: 10rpx; ">/单</text>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 价格和取餐时间 -->
|
||||
<view class="price-time-row">
|
||||
<view v-if="activeTab==1" class="">
|
||||
<text style="font-size: 30rpx; font-weight: 600; color: #1890FF; ">取件码: </text>
|
||||
<text style="color: var(--nav-mian); font-weight: 600; margin-left: 10rpx; ">A121</text>
|
||||
</view>
|
||||
<view v-if="activeTab!==1" class="">
|
||||
<text class="address-text">据您{{ distance(orderItem.distance) }}</text>
|
||||
</view>
|
||||
<view class="pickup-time">
|
||||
<up-icon name="clock" :color="activeTab==0?'#FAAD14':'#FF0000'" size="16" />
|
||||
<text class="time-text"
|
||||
:style="{'color':activeTab==0?'#FAAD14':'#FF0000'}">{{ orderItem.makeTime.split(' ').length==2?'预计'+orderItem.makeTime.split(' ')[1]+'送达':orderItem.makeTime }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 立即抢单按钮 -->
|
||||
|
||||
<view class="" style="display: flex; ">
|
||||
<view class="" style="width: 100%;"
|
||||
@click.stop="activeTab==0?takeOrder(orderItem.orderId):pickFood(orderItem.orderId)">
|
||||
<button type="primary" :color="activeTab==0?'#1890FF':'#52C41A'" size="large"
|
||||
class="grab-btn">{{ activeTab==0?'立即接单':(activeTab==1?'我已取餐':'确认送达')}}</button>
|
||||
</view>
|
||||
<view class="" style="width: 20rpx;" v-if="activeTab!=0">
|
||||
|
||||
</view>
|
||||
<view style="width: 100%;" v-if="activeTab!=0" @click.stop="Service.GoPage('/pages/order/orderMap?orderId='+orderItem.orderId)" class="">
|
||||
<button type="primary" color="#1890FF"
|
||||
class="grab-btn">{{activeTab==1?'导航取餐':'导航送餐'}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<up-loadmore :status="status" />
|
||||
</view>
|
||||
|
||||
<view v-if="riderInfo.status==0" style=" margin-top: 20rpx; text-align: center; font-weight: bold; font-size: 34rpx;" class="">
|
||||
信息审核中·请等待审核
|
||||
</view>
|
||||
|
||||
|
||||
<view class="" style="width: 100%; height: 60rpx; ">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { Service } from '@/Service/Service';
|
||||
import { CNRiderDataService } from '@/Service/CN/CNRiderDataService'
|
||||
import { CNRiderOrderService } from '@/Service/CN/CNRiderOrderService'
|
||||
|
||||
// 加载状态
|
||||
const isLoading = ref(true);
|
||||
let status = ref('nomore')
|
||||
let page = ref(1)
|
||||
|
||||
let userData = ref({
|
||||
dayAmount: 0,
|
||||
dayOrderCount: 0,
|
||||
takeOrderCount: 0
|
||||
})
|
||||
|
||||
const tabs = ['新订单', '待取货', '配送中']
|
||||
const activeTab = ref(0)
|
||||
let riderInfo = ref<any>({})
|
||||
|
||||
let orderList = ref<Array<any>>([])
|
||||
|
||||
|
||||
onLoad(() => {
|
||||
uni.$on(`newOrder`, (data) => {
|
||||
newOrder()
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
onShow(() => {
|
||||
getData()
|
||||
getOrderData()
|
||||
})
|
||||
|
||||
// 有新订单
|
||||
const newOrder = () =>{
|
||||
if(activeTab.value==0){
|
||||
getOrderData()
|
||||
}
|
||||
|
||||
audioPlay()
|
||||
}
|
||||
|
||||
const getData = () => {
|
||||
CNRiderDataService.GetRiderHomeInfo().then(res => {
|
||||
isLoading.value = false
|
||||
riderInfo.value = res.data.riderInfo
|
||||
userData.value = res.data
|
||||
if (res.data.riderInfo.status === -1) {
|
||||
Service.GoPage('/pages/my/completeData')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const getOrderData = () => {
|
||||
status.value = 'loadmore'
|
||||
page.value = 1
|
||||
orderList.value = []
|
||||
getOrderList()
|
||||
}
|
||||
|
||||
|
||||
//获取订单
|
||||
const getOrderList = () => {
|
||||
if (status.value == 'nomore' || status.value == 'loading') {
|
||||
return
|
||||
}
|
||||
status.value == 'loadmore'
|
||||
|
||||
if (activeTab.value == 0) {
|
||||
CNRiderOrderService.GetRiderOrderList(page.value).then(res => {
|
||||
orderList.value = [...orderList.value, ...res.data.list]
|
||||
status.value = res.data.list == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
})
|
||||
} else {
|
||||
CNRiderOrderService.GetRiderTakeOrderList(activeTab.value == 1 ? 0 : 1, page.value).then(res => {
|
||||
orderList.value = [...orderList.value, ...res.data.list]
|
||||
status.value = res.data.list == 10 ? 'loadmore' : 'nomore'
|
||||
page.value++
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 接单
|
||||
const takeOrder = (orderId : string) => {
|
||||
CNRiderOrderService.RiderTakeOrder(orderId).then(res => {
|
||||
if (res.data) {
|
||||
getOrderData()
|
||||
getData()
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
// 取餐
|
||||
const pickFood = (orderId : string) => {
|
||||
CNRiderOrderService.UpdateRiderOrderTake(orderId, activeTab.value).then(res => {
|
||||
if (res.data) {
|
||||
getOrderData()
|
||||
getData()
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 切换标签
|
||||
const switchTab = (index : number) => {
|
||||
activeTab.value = index
|
||||
getOrderData()
|
||||
}
|
||||
|
||||
// 切换接单状态
|
||||
const toggleAcceptOrders = () => {
|
||||
CNRiderDataService.UpdateRiderOnline().then(res => {
|
||||
if (res.data) {
|
||||
getData()
|
||||
} else {
|
||||
Service.Msg(res.msg)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
// 距离计算
|
||||
const distance = (item : any) => {
|
||||
if (item < 0) {
|
||||
return Number(item * 100).toFixed(2) + 'm'
|
||||
} else {
|
||||
return Number(item).toFixed(2) + 'km'
|
||||
}
|
||||
}
|
||||
|
||||
// 拨打电话
|
||||
const call = (e : string) => {
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: e
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 页面跳转
|
||||
const gopage = (id) => {
|
||||
if (activeTab.value == 0) {
|
||||
Service.GoPage('/pages/order/grabOrder?orderId=' + id)
|
||||
} else {
|
||||
Service.GoPage('/pages/order/orderDetail?orderId=' + id+'&type='+activeTab.value)
|
||||
}
|
||||
}
|
||||
|
||||
const audioPlay = () => {
|
||||
const innerAudioContext = uni.createInnerAudioContext();
|
||||
innerAudioContext.autoplay = true;
|
||||
innerAudioContext.src = '/static/order.mp3';
|
||||
innerAudioContext.onPlay(() => {
|
||||
console.log('开始播放');
|
||||
});
|
||||
innerAudioContext.onError((res) => {
|
||||
console.log(res.errMsg);
|
||||
console.log(res.errCode);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
page {
|
||||
background-color: #F6f6f6;
|
||||
}
|
||||
|
||||
|
||||
/* 统计数据区域 */
|
||||
.stats-section {
|
||||
background-color: #ffffff;
|
||||
margin: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.income {
|
||||
color: var(--nav-diluted);
|
||||
}
|
||||
|
||||
.completed {
|
||||
color: var(--nav-vice);
|
||||
}
|
||||
|
||||
.ongoing {
|
||||
color: #FF9500;
|
||||
}
|
||||
|
||||
/* 接单按钮 */
|
||||
.action-section {
|
||||
margin: 0 20rpx;
|
||||
}
|
||||
|
||||
.accept-orders-btn {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
font-size: 32rpx;
|
||||
background-color: #52C41A;
|
||||
}
|
||||
|
||||
|
||||
/* 顶部标签栏 */
|
||||
.tab-bar {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
background-color: #FFFFFF;
|
||||
padding: 20rpx 0 0;
|
||||
border-bottom: 1rpx solid #E5E5E5;
|
||||
width: 100vw;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.tab-text {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.tab-item.active .tab-text {
|
||||
color: var(--nav-mian);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.active-line {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 110rpx;
|
||||
height: 6rpx;
|
||||
background-color: var(--nav-mian);
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
|
||||
|
||||
.task-section {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
/* 标签样式 */
|
||||
.high-price-tag {
|
||||
width: fit-content;
|
||||
background-color: #FF7875;
|
||||
color: #FFFFFF;
|
||||
padding: 5rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 20rpx;
|
||||
padding: 5rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
font-size: 24rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.status-tag.pending {
|
||||
background-color: #4CD964;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.status-tag.delivering {
|
||||
background-color: #FF9500;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* 右侧操作按钮 */
|
||||
.right-action {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
|
||||
.call-btn {
|
||||
padding: 5rpx 15rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
/* 信息展示 */
|
||||
.merchant-info {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.merchant-name {
|
||||
font-size: 34rpx;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.distance {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.address-info {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.address-text {
|
||||
margin-left: 10rpx;
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* 价格和时间 */
|
||||
.price-time-row {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.price {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
color: #FF3B30;
|
||||
}
|
||||
|
||||
.pickup-code {
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.pickup-time {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.time-text {
|
||||
margin-left: 8rpx;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
/* 按钮样式 */
|
||||
.grab-btn {
|
||||
margin-top: 25rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.grab-btn {
|
||||
background-color: #007AFF;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* uview组件样式覆盖 */
|
||||
::v-deep .u-button--primary {
|
||||
background-color: var(--nav-vice);
|
||||
border-color: var(--nav-vice);
|
||||
}
|
||||
|
||||
::v-deep .u-button--mini {
|
||||
background-color: var(--nav-mian);
|
||||
border-color: var(--nav-mian);
|
||||
}
|
||||
|
||||
|
||||
/* 骨架屏样式 */
|
||||
.skeleton-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
/* 统计数据区域骨架 */
|
||||
.skeleton-stats-section {
|
||||
background-color: #ffffff;
|
||||
margin: 0 20rpx;
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 30rpx 0;
|
||||
}
|
||||
|
||||
.skeleton-stat-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.skeleton-stat-label {
|
||||
width: 120rpx;
|
||||
height: 28rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
.skeleton-stat-value {
|
||||
width: 150rpx;
|
||||
height: 36rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 接单按钮骨架 */
|
||||
.skeleton-action-section {
|
||||
margin: 20rpx;
|
||||
}
|
||||
|
||||
.skeleton-accept-btn {
|
||||
width: 100%;
|
||||
height: 90rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 标签栏骨架 */
|
||||
.skeleton-tab-bar {
|
||||
display: flex;
|
||||
background-color: #ffffff;
|
||||
padding: 20rpx 0 0;
|
||||
border-bottom: 1rpx solid #e5e5e5;
|
||||
}
|
||||
|
||||
.skeleton-tab-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 20rpx 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.skeleton-tab-text {
|
||||
width: 100rpx;
|
||||
height: 28rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 任务列表骨架 */
|
||||
.skeleton-task-list {
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.skeleton-task-section {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
/* 标签骨架 */
|
||||
.skeleton-tag-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.skeleton-high-price-tag {
|
||||
width: 120rpx;
|
||||
height: 30rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 20rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
.skeleton-phone-btn {
|
||||
width: 150rpx;
|
||||
height: 30rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 商家信息骨架 */
|
||||
.skeleton-merchant-info {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.skeleton-merchant-name {
|
||||
width: 200rpx;
|
||||
height: 34rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
.skeleton-distance {
|
||||
width: 80rpx;
|
||||
height: 28rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 地址信息骨架 */
|
||||
.skeleton-address-info {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
|
||||
.skeleton-address-text {
|
||||
width: 100%;
|
||||
height: 28rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 价格和时间骨架 */
|
||||
.skeleton-price-time-row {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.skeleton-pickup-code {
|
||||
width: 150rpx;
|
||||
height: 30rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
.skeleton-pickup-time {
|
||||
width: 200rpx;
|
||||
height: 30rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 8rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 按钮骨架 */
|
||||
.skeleton-grab-btn {
|
||||
margin-top: 25rpx;
|
||||
height: 80rpx;
|
||||
background-color: #e6e6e6;
|
||||
border-radius: 40rpx;
|
||||
animation: skeleton-loading 1.5s infinite;
|
||||
}
|
||||
|
||||
/* 骨架屏动画 */
|
||||
@keyframes skeleton-loading {
|
||||
0% {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
50% {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
100% {
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user