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,123 @@
<template>
<view class="">
<web-view ref="webviewRef" v-if="isshow" :src="url" @message="handleMessage" @logData = "logData"></web-view>
<!-- ✅ 新增:一个绝对定位的遮罩层,用于在刷新时覆盖 web-view -->
<view v-else class="reloading-mask">
<up-loading-icon text="正在获取订单状态..." v-if="orderOver" textSize="16"></up-loading-icon>
<up-loading-icon text="订单已完成" v-else textSize="16"></up-loading-icon>
</view>
</view>
</template>
<script setup lang="ts">
import { onLoad } from '@dcloudio/uni-app';
import { Service } from "@/Service/Service";
import { ref, onMounted } from 'vue';
import { CNRiderOrderService } from '@/Service/CN/CNRiderOrderService'
let orderId = ref<string>('')
let url = ref<string>('')
let isshow = ref<false>(false)
let orderInfo = ref<any>({
isFood: 0
})
let riderOrder = ref<any>({
status:0
})
let orderOver = ref<true>(false)
onLoad((data) => {
if (data.orderId) {
orderId.value = data.orderId
getData()
} else {
Service.Msg('为获取到订单ID')
}
});
// 初始化url
const getUrl = () => {
isshow.value = false
url.value = 'https://cndh.twbar.cn?orderId=' + orderId.value + '&isFood=' + riderOrder.value.status
isshow.value = true
}
const getData = () => {
CNRiderOrderService.GetUnitOrderInfo(orderId.value).then(res => {
if (res.code==0) {
orderInfo.value = res.data.orderInfo
riderOrder.value = res.data.riderOrder
getUrl()
}else{
Service.Msg(res.mgs)
}
})
}
// 点击完成送餐取餐调用
const handleMessage = (data) => {
let preat = data.detail.data[0]
if(preat.action =='message'){
if (riderOrder.value.status == 0) {
// 去商家、取餐
pickFood(1)
} else {
// 去用户,送餐
pickFood(2)
}
}else if(preat.action =='logData'){
CNRiderOrderService.UpdateRiderLocation(preat.data[0],preat.data[1]).then(res=>{
if(res.code==0){
}
})
}
return
};
// 骑手定位
const logData = (data) =>{
console.log(data,'骑手定位')
}
// 取餐
const pickFood = ( type:number) => {
CNRiderOrderService.UpdateRiderOrderTake(orderId.value, type).then(res => {
if (res.data) {
Service.Msg(type==1?'取餐成功':'订单完成')
setTimeout(()=>{Service.GoPageTab('/pages/index/index')},500)
getData()
} else {
Service.Msg(res.msg)
}
})
};
</script>
<style lang="scss" scoped>
.reloading-mask {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #f7f7f7; // 使用页面底色
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
}
</style>

View File

@@ -0,0 +1,103 @@
import { Service } from '@/Service/Service';
/*****订单接口*****/
class CNRiderOrderService {
private static GetRiderOrderListPath : string = '/Rider/GetRiderOrderList';
/*****首页新订单*****/
static GetRiderOrderList(page : number) {
var result = Service.Request(this.GetRiderOrderListPath, "GET", {page});
return result;
}
private static RiderTakeOrderPath : string = '/Rider/RiderTakeOrder';
/*****骑手接单*****/
static RiderTakeOrder(orderId : string) {
var result = Service.Request(this.RiderTakeOrderPath, "POST", {orderId});
return result;
}
private static GetRiderTakeOrderListPath : string = '/Rider/GetRiderTakeOrderList';
/*****首页 待取餐/配送中*****/
static GetRiderTakeOrderList(status: number,page : number) {
var result = Service.Request(this.GetRiderTakeOrderListPath, "GET", {status,page});
return result;
}
private static GetUnitOrderInfoPath : string = '/Order/GetUnitOrderInfo';
/*****获取订单详情*****/
static GetUnitOrderInfo(orderId: string) {
var result = Service.Request(this.GetUnitOrderInfoPath, "GET", {orderId});
return result;
}
private static UpdateRiderOrderTakePath : string = '/Rider/UpdateRiderOrderTake';
/*****取餐*****/
static UpdateRiderOrderTake(orderId: string,status:number) {
var result = Service.Request(this.UpdateRiderOrderTakePath, "POST", {orderId,status});
return result;
}
private static GetRiderAccLogPath : string = '/Rider/GetRiderAccLog';
/*****收入列表*****/
static GetRiderAccLog(time: string,page:number) {
var result = Service.Request(this.GetRiderAccLogPath, "GET", {time,page});
return result;
}
private static AddRiderWithPath : string = '/Rider/AddRiderWith';
/*****骑手提现*****/
static AddRiderWith(amount: number,payway:string,name:string,account:string) {
var result = Service.Request(this.AddRiderWithPath, "POST", {amount,payway,name,account});
return result;
}
private static GetRiderWithListPath : string = '/Rider/GetRiderWithList';
/*****骑手提现列表*****/
static GetRiderWithList(page:number) {
var result = Service.Request(this.GetRiderWithListPath, "GET", {page});
return result;
}
private static ApplyOrderServicePath : string = '/Rider/ApplyOrderService';
/*****上报异常订单*****/
static ApplyOrderService(orderId:string,type:string,remark:string,img:string) {
var result = Service.Request(this.ApplyOrderServicePath, "POST", {orderId,type,remark,img});
return result;
}
private static GetRiderOrderServiceListPath : string = '/Rider/GetRiderOrderServiceList';
/*****上报异常订单列表*****/
static GetRiderOrderServiceList(type:number,page:number) {
var result = Service.Request(this.GetRiderOrderServiceListPath, "GET", {type,page});
return result;
}
private static GetOrderServiceInfoPath : string = '/Order/GetOrderServiceInfo';
/*****上报异常订单详情*****/
static GetOrderServiceInfo(orderId:string) {
var result = Service.Request(this.GetOrderServiceInfoPath, "GET", {orderId});
return result;
}
private static UpdateRiderLocationPath : string = '/Rider/UpdateRiderLocation';
/*****骑手上报位置*****/
static UpdateRiderLocation(lon:number,lat:number) {
var result = Service.Request(this.UpdateRiderLocationPath, "POST", {lon,lat});
return result;
}
}
export {
Service,
CNRiderOrderService
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,233 @@
{
"easycom": {
// 注意一定要放在custom里否则无效https://ask.dcloud.net.cn/question/131175
"custom": {
"^u--(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^up-(.*)": "uview-plus/components/u-$1/u-$1.vue",
"^u-([^-].*)": "uview-plus/components/u-$1/u-$1.vue"
}
},
"pages": [ //pages数组中第一项表示应用启动页参考https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "门店运营",
"navigationBarBackgroundColor": "#36394D",
"navigationStyle": "custom",
"backgroundColor": "#F8F8F8"
}
},
{
"path": "pages/index/task",
"style": {
"navigationBarTitleText": "任务",
"navigationBarBackgroundColor": "#36394D",
"navigationStyle": "custom",
"backgroundColor": "#F8F8F8"
}
},
{
"path": "pages/index/income",
"style": {
"navigationBarTitleText": "我的收入",
"navigationBarBackgroundColor": "#36394D",
"navigationStyle": "custom",
"backgroundColor": "#F8F8F8"
}
},
{
"path": "pages/index/user",
"style": {
"navigationBarTitleText": "我的",
"navigationBarBackgroundColor": "#36394D",
"navigationStyle": "custom",
"backgroundColor": "#F8F8F8"
}
}
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "v派商家",
"navigationBarBackgroundColor": "#fff",
"backgroundColor": "#000"
},
"subPackages": [
{
"root": "pages/order",
"pages": [
{
"path": "orderDetail",
"style": {
"navigationBarTitleText": "项目中心",
"navigationStyle": "custom"
}
},
{
"path" : "navigation",
"style" :
{
"navigationBarTitleText" : "导航",
"navigationStyle": "custom"
}
},
{
"path" : "abnormal",
"style" :
{
"navigationBarTitleText" : "上报异常",
"navigationStyle": "custom"
}
},
{
"path" : "grabOrder",
"style" :
{
"navigationBarTitleText" : "订单详情"
}
},
{
"path" : "incomeDetail",
"style" :
{
"navigationBarTitleText" : "收入详情",
"navigationStyle": "custom"
}
},
{
"path" : "withdraw",
"style" :
{
"navigationBarTitleText" : "提现申请"
}
},
{
"path" : "finish",
"style" :
{
"navigationBarTitleText" : "订单完成"
}
},
{
"path" : "upAbnormal",
"style" :
{
"navigationBarTitleText" : "异常上报"
}
}
]
},
{
"root": "pages/my",
"pages": [{
"path" : "edit",
"style" :
{
"navigationBarTitleText" : "编辑资料"
}
},
{
"path" : "statusContro",
"style" :
{
"navigationBarTitleText" : "上线管理"
}
},
{
"path" : "myKF",
"style" :
{
"navigationBarTitleText" : "联系客服",
"navigationStyle": "custom"
}
},
{
"path" : "AbnormalList",
"style" :
{
"navigationBarTitleText" : "异常订单"
}
},
{
"path" : "check",
"style" :
{
"navigationBarTitleText" : "签到奖励"
}
},
{
"path" : "abnormalDetail",
"style" :
{
"navigationBarTitleText" : "异常详情"
}
},
{
"path" : "security",
"style" :
{
"navigationBarTitleText" : "账号与安全"
}
},
{
"path" : "authentication",
"style" :
{
"navigationBarTitleText" : "实名认证"
}
},
{
"path" : "login",
"style" :
{
"navigationBarTitleText" : "登录",
"navigationStyle": "custom"
}
},
{
"path" : "noticeList",
"style" :
{
"navigationBarTitleText" : "消息通知",
"navigationStyle": "custom"
}
}
]
}
],
"tabBar": {
"color": "#000",
"selectedColor": "#000",
"backgroundColor": "#FFFFFF",
"list": [{
"pagePath": "pages/index/index",
"iconPath": "static/tab/home.png",
"selectedIconPath": "/static/tab/homed.png",
"text": "主页"
},
{
"pagePath": "pages/index/task",
"iconPath": "static/tab/task.png",
"selectedIconPath": "static/tab/tasked.png",
"text": "任务"
},
{
"pagePath": "pages/index/income",
"iconPath": "static/tab/income.png",
"selectedIconPath": "static/tab/incomed.png",
"text": "收入"
},
{
"pagePath": "pages/index/user",
"iconPath": "static/tab/user.png",
"selectedIconPath": "static/tab/usered.png",
"text": "我的"
}
]
}
}

View File

@@ -0,0 +1,115 @@
<template>
<view style="margin: 20rpx 20rpx; padding: 20rpx; ">
<up-form v-if="type==1" labelPosition="left" labelWidth='90' :model="password" ref="form1">
<up-form-item label="姓名" prop="userInfo.name" :borderBottom="true" ref="item1">
<up-input clearable='true' placeholder="请输入联系人姓名" border="none"></up-input>
</up-form-item>
<up-form-item label="手机号" prop="userInfo.name" :borderBottom="true" ref="item1">
<up-input clearable='true' placeholder="请输入手机号" border="none"></up-input>
</up-form-item>
</up-form>
<up-form v-else labelPosition="left" labelWidth='90' :model="password" ref="form1">
<up-form-item label="手机号" prop="userInfo.name" :borderBottom="true" ref="item1">
<up-input clearable='true' placeholder="请输入手机号" border="none"></up-input>
</up-form-item>
<up-form-item prop="userInfo.name" :borderBottom="true" ref="item1">
<up-input clearable='true' placeholder="请输入手机号" border="none">
<template #suffix>
<up-code :seconds="seconds" @end="end" @start="start" ref="uCodeRef" @change="codeChange"></up-code>
<up-button @tap="getCode">{{tips}}</up-button>
</template>
</up-input>
</up-form-item>
</up-form>
<view class="" style=" position: fixed; bottom: 0; left: 0; width: 100%; padding: 20rpx; ">
<button @click="save()" :disabled='!password.password || !password.code ' class="logout-btn">确认修改</button>
</view>
</view>
</template>
<script setup lang="ts">
import { onShow, onLoad } from "@dcloudio/uni-app";
import { ref } from "vue";
import { Service } from "../../Service/Service";
const tips = ref('');
const seconds = ref(10);
const uCodeRef = ref(null);
let password = ref({
password: '',
code: ''
})
let type = ref(1)
onLoad((data : any) => {
if (data.type == 1) {
uni.setNavigationBarTitle({
title: '修改手机号'
})
}
type.value = data.type
});
onShow(() => {
});
const save = () => {
}
const codeChange = (text) => {
tips.value = text;
};
const getCode = () => {
if (uCodeRef.value.canGetCode) {
// 模拟向后端请求验证码
uni.showLoading({
title: '正在获取验证码',
});
setTimeout(() => {
uni.hideLoading();
// 这里此提示会被start()方法中的提示覆盖
Service.Msg('验证码已发送')
uCodeRef.value.start();
}, 2000);
} else {
Service.Msg('倒计时结束后再发送')
}
};
const end = () => {
};
const start = () => {
};
</script>
<style lang="scss">
.logout-btn {
background-color: var(--nav-banbacor);
color: #fff;
font-weight: 500;
border-radius: 10rpx;
height: 80rpx;
line-height: 80rpx;
font-size: 30rpx;
margin: 0;
}
.logout-btn:active {
background-color: #f7f7f7;
color: #000;
}
</style>