新增开启接单

This commit is contained in:
2025-03-16 20:11:17 +08:00
parent d75f6dbfc7
commit 53defb65fe
6 changed files with 93 additions and 23 deletions

View File

@ -28,6 +28,7 @@ export default {
PENDING:"提现审核中",APPROVED:"平台受理成功",REJECTED:"审核未通过"
}
},
setDelivering:(is_delivering)=>request.put('/api/user/deliveryman/set_delivering',{is_delivering}),
uploadImg(file,progress){
if(!app)app = getApp();
@ -41,7 +42,11 @@ export default {
url: request.baseUrl+'/api/upload/image',
success:(res)=>{
const response = JSON.parse(res.data);
rs(response.data);
if(response.code==200){
rs(response.data);
}else{
rj(response)
}
},
fail:(res)=>{
rj(res);

View File

@ -381,9 +381,12 @@ list-view{
}
switch{
width:84rpx;
}
switch .wx-switch-input{
background-color:#999999;
width:84rpx;
height: 48rpx;
}
switch .wx-switch-input.wx-switch-input-checked{
background-color:var(--main-color);

View File

@ -67,6 +67,13 @@
border-color:red;
}
.custom-modal-view .content-text{
color: #666666;
font-size: 28rpx;
text-align: center;
margin:32rpx 0 40rpx 0;
}
.modal-view-main .btns{
margin-top:32rpx;
display: flex;

View File

@ -67,7 +67,9 @@ Page({
markupStatusKV:orderApi.markUp.statusKV,
appConfig:{}
appConfig:{},
isShowConfirmDelivering:false
},
onLoad(){
this.orderBackgroundNotice = this.selectComponent('#orderBackgroundNotice');
@ -601,6 +603,20 @@ Page({
isStartLoopOrder:event.detail.value
})
},
switchOnTap(){
this.setData({
isShowConfirmDelivering:true
})
},
setDelivering(){
userApi.setDelivering(!this.data.userInfo.is_delivering).then(()=>{
return app.forceGetUserInfo();
}).then((data)=>{
this.setData({
userInfo:data
})
});
},
navToAgreement(){
wx.navigateTo({
url: `/pages/browser/index?url=${this.data.appConfig.url_user_agreement}`,

View File

@ -7,11 +7,11 @@
<image class="icon" src="/assets/icon/community.png"/>
<label>{{userInfo.community_name}}</label>
</view> -->
<view class="loop-order-switch">
<label>语音播报</label>
<view class="weui-loading" wx:if="{{bgNoticeLoadResult.loading}}"></view>
<view class="retry" wx:elif="{{bgNoticeLoadResult.error}}" bind:tap="bgNoticeRetry">重试</view>
<switch wx:else class="switch" checked="{{isStartLoopOrder}}" bindchange="loopOrderChange"/>
<view class="start-order-switch">
<label>
{{userInfo.is_delivering?'接单中':'暂停接单'}}
</label>
<switch class="switch" checked="{{userInfo.is_delivering}}" capture-catch:tap="switchOnTap"/>
</view>
</view>
@ -119,6 +119,11 @@
</list-view>
</view>
<view class="start-delivering" wx:if="{{userInfo&&userInfo.is_delivering==false}}">
<view>开启服务,立享配送收益</view>
<button class="button" type="primary" size="mini" bind:tap="switchOnTap">开启接单</button>
</view>
<page-container wx:if="{{isShowConfirm}}" model:show="{{isShowConfirm}}" position="bottom"
round class="confirm-sending" close-on-slide-down>
<view class="content">
@ -160,6 +165,15 @@
<view class="name">{{userInfo.nickname}}</view>
<view class="phone">{{userInfo.phone}}</view>
<view class="community-name">{{userInfo.community_name}}</view>
<view class="spliter spliter1"></view>
<view class="loop-order-switch">
<view>语音播报</view>
<view>
<view class="weui-loading" wx:if="{{bgNoticeLoadResult.loading}}"></view>
<view class="retry" wx:elif="{{bgNoticeLoadResult.error}}" bind:tap="bgNoticeRetry">重试</view>
<switch wx:else class="switch" checked="{{isStartLoopOrder}}" bindchange="loopOrderChange"/>
</view>
</view>
<view class="spliter"></view>
<view class="order-info">
<view class="item">
@ -223,3 +237,7 @@
<background-notice bind:onTrigger="findNewOrder" id="orderBackgroundNotice"
start="{{isStartLoopOrder}}" bind:initSuccess="bgNoticeSuccess"
bind:initError="bgNoticeError" bind:stop="stopBGNotice"/>
<modal-view titleText="{{userInfo.is_delivering?'确定关闭接单吗?':'确定开启接单吗?'}}"
bind:ok="setDelivering" model:show="{{isShowConfirmDelivering}}"
content="{{userInfo.is_delivering?'关闭后用户无法下单,请慎重关闭~':''}}"/>

View File

@ -8,11 +8,6 @@
display: flex;
align-items: center;
}
.nav-bar .retry{
text-decoration: underline;
color: rgb(250, 67, 67);
padding:14rpx;
}
.nav-bar .left-btn{
width:56rpx;
height:56rpx;
@ -31,7 +26,7 @@
width:20rpx;height:20rpx;
margin-right:8rpx;
}
.nav-bar .loop-order-switch{
.nav-bar .start-order-switch{
background: rgba(255, 255, 255, 0.08);
border-radius: 40rpx;
color: #fff;
@ -42,13 +37,6 @@
gap: 14rpx;
font-size: 28rpx;
}
.nav-bar .loop-order-switch .switch{
width:84rpx;
}
.nav-bar .loop-order-switch .switch .wx-switch-input{
width:84rpx;
height: 48rpx;
}
.head{
display: flex;
background-color: #111111;
@ -460,8 +448,20 @@
margin-top:60rpx;
font-size: 34rpx;
}
.left-panel .user-info .spliter{
margin-top:82rpx;
.left-panel .user-info .spliter.spliter1{
margin-top:50rpx;
}
.left-panel .user-info .loop-order-switch{
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #222222;
padding:24rpx 0;
}
.loop-order-switch .retry{
text-decoration: underline;
color: rgb(250, 67, 67);
}
.left-panel .user-info .order-info{
display: flex;
@ -541,3 +541,24 @@
background-color: #fff!important;
color:#222!important;
}
.start-delivering{
background-color: #222222;
font-weight: 500;
color:#ffffff;
position:fixed;
bottom:32rpx;
left:20rpx;
right:20rpx;
display: flex;
align-items: center;
border-radius: 18rpx;
justify-content: space-between;
padding:12rpx 12rpx 12rpx 34rpx;
}
.start-delivering .button{
margin:0;
font-size: 30rpx;
padding:22rpx;
line-height: 1;
}