first commit

This commit is contained in:
Ls
2026-02-12 12:19:20 +08:00
commit 219fd9be5c
529 changed files with 169918 additions and 0 deletions

View File

@@ -0,0 +1,131 @@
<script setup lang="ts">
import { onLaunch, onShow, onHide } from "@dcloudio/uni-app";
import { onMounted, ref } from "vue";
import { WebSocket } from "@/Service/Comm/TwWebSocket";
import { Service } from "@/Service/Service"
import { CNRiderOrderService } from '@/Service/CN/CNRiderOrderService'
let isios = ref(false)
var socket = new WebSocket();
const currentLatitude = ref(0);
const currentLongitude = ref(0);
let locationTimer: ReturnType<typeof setInterval> | null = null;
onLaunch(() => {
isios.value = uni.getSystemInfoSync().platform != 'ios'//是否为ios
//#ifdef APP-PLUS//app
if (isios.value) {
// getVersion()//更新
}
//#endif
//链接服务器
uni.$on("ImCom", () => {
socket.ConnectSocketInit();
})
uni.$on("ImComOff", function (data) {
socket.CloseSocket(data);
})
startFetchingLocation();
});
onShow(() => {
Service.SetStorageCache('isHede',false)
//链接服务器
if (Service.GetUserIsLogin()) {
uni.$emit('ImCom')
}
});
onHide(() => {
Service.SetStorageCache('isHede',true)
});
const startFetchingLocation = () => {
// 安全检查:如果定时器已存在,先清除,防止重复启动
if (locationTimer) {
clearInterval(locationTimer);
}
console.log("开始定时获取位置间隔1分钟...");
// 1. 立即执行第一次获取
getLocationNow();
// 2. 设置定时器,每 60000 毫秒 (1分钟) 执行一次
locationTimer = setInterval(() => {
getLocationNow();
}, 60000);
};
const getLocationNow = () => {
console.log("正在获取当前经纬度...");
uni.getLocation({
type: 'wgs84',
isHighAccuracy: true,
success: (res) => {
console.log('成功获取到新位置:', res);
// 更新页面上的数据显示
console.log(res.latitude,res.longitude,'===')
if(Service.GetUserIsLogin()){
CNRiderOrderService.UpdateRiderLocation(res.longitude,res.latitude).then(res=>{})
}
},
fail: (err) => {
console.error('获取经纬度失败:', err);
// (可选) 可以在这里添加失败提示
// uni.showToast({ title: '获取位置失败', icon: 'none' });
}
});
};
/**
* 停止定时获取位置
*/
const stopFetchingLocation = () => {
if (locationTimer) {
clearInterval(locationTimer);
locationTimer = null; // 清理 ID
}
};
const getUpData = () => {
// #ifdef APP
// plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
// NvpMerchService.GetAppVersion().then(res=>{
// console.log('wgtinfo.versionCode',wgtinfo.versionCode);
// if (res.data.version > wgtinfo.versionCode) {
// setTimeout(function() {
// uni.navigateTo({
// url: "/pages/upData/upData?info=" +
// encodeURIComponent(
// JSON.stringify(res.data))
// })
// }, 1000)
// }
// })
// })
// #endif
}
</script>
<style lang="scss">
@import "uview-plus/index.scss";
@import "colorui/main.css";
@import "colorui/icon.css";
page {
--nav-mian: #1890FF; //全局颜色
--nav-vice: #52C41A; //副颜色
--nav-diluted: #FF4D4F; //次颜色
}
</style>

View File

@@ -0,0 +1,357 @@
<template>
<!-- 导航栏 -->
<view class=""
style=" z-index: 100; padding:50rpx 20rpx 18rpx;box-sizing: border-box; position: fixed;top: 0; left: 0; width: 100vw; background-color: #fff; display: flex; align-items: center; justify-content: space-between; ">
<view class="" @click="Service.GoPageBack()">
<up-icon name="arrow-left" size="32rpx"></up-icon>
</view>
<view class="">
消息通知
</view>
<view class="" style="font-size: 22rpx; color: #999999; " >
全部已读
</view>
</view>
<view class="" style="width: 100%; height: 108rpx; ">
</view>
<view v-if="loading" class="">
<!-- 消息列表骨架 -->
<view class="skeleton-list">
<!-- 模拟4条消息 -->
<view v-for="index in 4" :key="index" class="skeleton-message-item">
<view class="skeleton-message-icon">
<view class="skeleton-icon-container"></view>
<view class="skeleton-unread-dot"></view>
</view>
<view class="skeleton-message-content">
<view class="skeleton-message-header">
<view class="skeleton-message-title"></view>
<view class="skeleton-message-time"></view>
</view>
<view class="skeleton-message-desc">
<view class="skeleton-desc-line"></view>
<view class="skeleton-desc-line short"></view>
</view>
</view>
</view>
<!-- 加载更多骨架 -->
<view class="skeleton-load-more"></view>
</view>
</view>
<view v-else class="message-center-container">
<!-- 标签页 -->
<up-tabs :list="tabList" :current="currentTab" @change="handleTabChange" lineWidth='60' :scrollable="false"
lineColor="var(--nav-mian)"
:activeStyle="{ color: 'var(--nav-mian)', fontWeight: 'bold', transform: 'scale(1.05)'}"
:inactiveStyle="{color: '#606266', transform: 'scale(1)'}"></up-tabs>
<!-- 消息列表 -->
<scroll-view scroll-y class="message-list" :show-scrollbar="false">
<!-- 根据不同标签显示不同的消息 -->
<view v-for="(message, index) in 4" :key="index" class="message-item">
<view class="message-icon">
<view class="icon-container">
<image v-if="currentTab === 1" style="width: 100%; height: 100%;"
:src=" Service.GetIconImg('/static/index/home/shop.png')" mode=""></image>
<image v-if="currentTab === 2" style="width: 100%; height: 100%;"
:src=" Service.GetIconImg('/static/index/home/custom.png')" mode=""></image>
<image v-if="currentTab === 3" style="width: 100%; height: 100%;"
:src=" Service.GetIconImg('/static/index/home/system.png')" mode=""></image>
</view>
<view class="unread-dot"></view>
</view>
<view class="message-content">
<view class="message-header">
<text class="message-title">系统维护通知</text>
<text class="message-time">10分钟前</text>
</view>
<text class="message-desc">为了给您提供更好的服务体验系统将于今晚24:00-次日凌晨2:00进行例行维护</text>
</view>
</view>
<up-loadmore :status="status" />
</scroll-view>
</view>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue';
import { Service } from "@/Service/Service"
import { onLoad } from '@dcloudio/uni-app';
// 标签页数据
const tabList = ref([
{ name: '全部' },
{ name: '订单通知' },
{ name: '客户消息' },
{ name: '系统通知' }
]);
// 当前选中标签
const currentTab = ref(0);
// 加载状态
let loading = ref(true);
let status = ref('nomore')
onLoad(() => {
setTimeout(() => { loading.value = false; }, 1500);
})
// 处理标签切换
const handleTabChange = (e) => {
currentTab.value = e.index;
};
</script>
<style scoped lang="scss">
/* 消息列表骨架 */
.skeleton-list {
padding: 30rpx;
height: calc(100vh - 220rpx);
overflow: hidden;
}
.skeleton-message-item {
display: flex;
align-items: flex-start;
background-color: #ffffff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 24rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-message-icon {
position: relative;
margin-right: 24rpx;
}
.skeleton-icon-container {
width: 80rpx;
height: 80rpx;
background-color: #e0e0e0;
border-radius: 16rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-unread-dot {
position: absolute;
top: -8rpx;
right: -8rpx;
width: 24rpx;
height: 24rpx;
background-color: #e0e0e0;
border-radius: 50%;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-message-content {
flex: 1;
}
.skeleton-message-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12rpx;
}
.skeleton-message-title {
width: 200rpx;
height: 44rpx;
background-color: #e0e0e0;
border-radius: 8rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-message-time {
width: 100rpx;
height: 32rpx;
background-color: #e0e0e0;
border-radius: 6rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-message-desc {
display: flex;
flex-direction: column;
gap: 10rpx;
}
.skeleton-desc-line {
height: 40rpx;
background-color: #e0e0e0;
border-radius: 8rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-desc-line.short {
width: 80%;
}
.skeleton-load-more {
height: 60rpx;
background-color: #e0e0e0;
border-radius: 30rpx;
margin-top: 20rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
/* 骨架屏加载动画 */
@keyframes skeleton-loading {
0% {
opacity: 1;
}
50% {
opacity: 0.5;
}
100% {
opacity: 1;
}
}
/* 设置延迟,让骨架屏各部分加载动画错开 */
.skeleton-tab:nth-child(1) {
animation-delay: 0s;
}
.skeleton-tab:nth-child(2) {
animation-delay: 0.1s;
}
.skeleton-tab:nth-child(3) {
animation-delay: 0.2s;
}
.skeleton-tab:nth-child(4) {
animation-delay: 0.3s;
}
.skeleton-message-item:nth-child(1) {
animation-delay: 0s;
}
.skeleton-message-item:nth-child(2) {
animation-delay: 0.15s;
}
.skeleton-message-item:nth-child(3) {
animation-delay: 0.3s;
}
.skeleton-message-item:nth-child(4) {
animation-delay: 0.45s;
}
// end
.message-center-container {
background-color: #f5f5f5;
}
.read-all-btn {
position: absolute;
top: 88rpx;
right: 30rpx;
font-size: 26rpx;
color: #666666;
z-index: 10;
}
.message-list {
padding: 30rpx;
height: calc(100vh - 220rpx);
}
.message-item {
display: flex;
align-items: flex-start;
background-color: #ffffff;
border-radius: 16rpx;
padding: 30rpx;
margin-bottom: 24rpx;
transition: transform 0.2s;
&:active {
transform: scale(0.98);
}
}
.message-icon {
position: relative;
margin-right: 24rpx;
}
.icon-container {
width: 80rpx;
height: 80rpx;
background-color: #ffffff;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 40rpx;
}
.unread-dot {
position: absolute;
top: -8rpx;
right: -8rpx;
width: 24rpx;
height: 24rpx;
background-color: #FF4444;
border-radius: 50%;
border: 2rpx solid #ffffff;
}
.message-content {
flex: 1;
}
.message-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12rpx;
}
.message-title {
font-size: 32rpx;
font-weight: 600;
color: #333333;
line-height: 44rpx;
}
.message-time {
font-size: 24rpx;
color: #999999;
}
.message-desc {
font-size: 28rpx;
color: #666666;
line-height: 40rpx;
word-break: break-all;
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 0;
}
.empty-icon {
font-size: 120rpx;
margin-bottom: 30rpx;
}
.empty-text {
font-size: 28rpx;
color: #999999;
}
</style>

View File

@@ -0,0 +1,246 @@
<template>
<view v-if="isLoading" class="skeleton-container" style="padding: 10rpx 30rpx">
<!-- 骨架屏记录项 -->
<view class="skeleton-record-item" v-for="i in 3" :key="i">
<!-- 标题骨架 -->
<view class="skeleton-title"></view>
<!-- 金额区域骨架 -->
<view class="skeleton-amount-section">
<view class="skeleton-amount-line"></view>
<view class="skeleton-amount-value"></view>
</view>
<!-- 信息行骨架 -->
<view class="skeleton-info-row">
<view class="skeleton-info-label"></view>
<view class="skeleton-info-value"></view>
</view>
<view class="skeleton-info-row">
<view class="skeleton-info-label"></view>
<view class="skeleton-info-value"></view>
</view>
<view class="skeleton-info-row">
<view class="skeleton-info-label"></view>
<view class="skeleton-info-value"></view>
</view>
</view>
<!-- 加载更多骨架 -->
<view class="skeleton-loadmore"></view>
</view>
<view v-else style="padding: 10rpx 30rpx;">
<view class="" v-for="(item,index) in withdrowList" :key="index"
style="margin-top: 20rpx; gap: 20rpx; background-color: #fff; border-radius: 20rpx; padding: 30rpx; ">
<view class="" style=" display: flex; align-items: center; justify-content: space-between; font-weight: bold; border-bottom: 1rpx solid #f6f6f6; padding-bottom: 15rpx;">
余额提现-{{ item.payway}}
<view class="" :style="{ 'color': item.status==0?'#1890FF':(item.status==1?'#52C41A':'#FF4D4F') }" >
{{ item.status==0?'待审核':(item.status==1?'已通过':'已拒绝') }}
</view>
</view>
<view class=""
style="width: 100%; height: 200rpx; display: flex;flex-direction: column; justify-content: center; align-items: center; ">
<view class="" style="">
提现金额 {{ item.amount}} 元
</view>
<view class="" style="font-size: 32rpx; font-weight: bold; margin-top: 10rpx; ">
实际到账 {{item.withAmount}} 元
</view>
</view>
<view class="" style="display: flex; align-items: center; gap: 30rpx; ">
<view class="" style="width: 120rpx;">
收款人
</view>
<view class="" style="">
{{ item.name }}
</view>
</view>
<view class="" style="display: flex; align-items: center; gap: 30rpx; margin-top: 10rpx; ">
<view class="" style="width: 120rpx;">
提现账号
</view>
<view class="" style="">
{{ item.account }}
</view>
</view>
<view class="" style="display: flex; align-items: center; gap: 30rpx; margin-top: 10rpx;">
<view class="" style="width: 120rpx;">
提现时间
</view>
<view class="" style="">
{{ Service.formatDate(item.addTime,1) }}
</view>
</view>
<view v-if="item.reply && item.status==2" class="" style="display: flex; align-items: center; gap: 30rpx; margin-top: 10rpx;">
<view class="" style="width: 120rpx;">
拒绝通知
</view>
<view class="" style="">
{{ item.reply }}
</view>
</view>
</view>
<up-loadmore :status="status" />
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad, onReachBottom } from "@dcloudio/uni-app";
import { Service } from '@/Service/Service';
import { ref } from "vue";
import { CNRiderOrderService } from '@/Service/CN/CNRiderOrderService'
let isLoading = ref(true)
let withdrowList = ref<Array<any>>([])
let status = ref('nomore')
let page = ref(1)
onLoad(() => {
getData()
});
onShow(() => {
});
onReachBottom(() => {
getList()
})
const getData = () => {
status.value = 'loadmore'
page.value = 1
withdrowList.value = []
getList()
}
//获取订单
const getList = () => {
if (status.value == 'nomore' || status.value == 'loading') {
return
}
status.value == 'loadmore'
CNRiderOrderService.GetRiderWithList(page.value).then(res => {
isLoading.value = false
if (res.data) {
withdrowList.value = [...withdrowList.value, ...res.data.list]
status.value = res.data.list == 10 ? 'loadmore' : 'nomore'
page.value++
}
})
}
</script>
<style lang="scss">
.icon-placeholder {
width: 70rpx;
height: 70rpx;
background-color: #E6F7FF;
border-radius: 8rpx;
display: flex;
align-items: center;
justify-content: center;
}
/* 骨架屏样式 */
.skeleton-record-item {
margin-top: 20rpx;
background-color: #fff;
border-radius: 20rpx;
padding: 30rpx;
gap: 20rpx;
}
.skeleton-title {
width: 200rpx;
height: 32rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4rpx;
margin-bottom: 20rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-amount-section {
width: 100%;
height: 200rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-bottom: 20rpx;
}
.skeleton-amount-line {
width: 180rpx;
height: 28rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4rpx;
margin-bottom: 10rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-amount-value {
width: 250rpx;
height: 40rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-info-row {
display: flex;
align-items: center;
gap: 30rpx;
margin-top: 10rpx;
}
.skeleton-info-label {
width: 120rpx;
height: 28rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-info-value {
width: 300rpx;
height: 28rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
.skeleton-loadmore {
width: 100%;
height: 80rpx;
background: linear-gradient(90deg, #f0f0f0 25%, #e6e6e6 50%, #f0f0f0 75%);
background-size: 200% 100%;
border-radius: 4rpx;
margin-top: 20rpx;
animation: skeleton-loading 1.5s infinite ease-in-out;
}
/* 骨架屏动画 */
@keyframes skeleton-loading {
0% {
background-position: -100% 0;
}
100% {
background-position: 100% 0;
}
}
</style>

View File

@@ -0,0 +1,23 @@
{
// launch.json 配置了启动调试时相关设置configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数remote代表前端连云端云函数
"version" : "0.0",
"configurations" : [
{
"app-plus" : {
"launchtype" : "local"
},
"default" : {
"launchtype" : "local"
},
"mp-weixin" : {
"launchtype" : "local"
},
"type" : "uniCloud"
},
{
"playground" : "standard",
"type" : "uni-app:app-android"
}
]
}