加价政策,合并 ai 识别驿站

This commit is contained in:
2025-04-03 18:26:35 +08:00
parent a66df12632
commit 17aa16a972
13 changed files with 117 additions and 13 deletions

View File

@ -117,7 +117,7 @@ Component({
if(valid.length>0)return; if(valid.length>0)return;
} }
this.setData({ this.setData({
show:false _show:false
}); });
this.triggerEvent('ok',this.properties.content); this.triggerEvent('ok',this.properties.content);
}, },
@ -125,6 +125,7 @@ Component({
this.setData({ this.setData({
show:false show:false
}) })
this.triggerEvent('afterLeave')
} }
}, },

View File

@ -201,7 +201,7 @@ Page({
params.packages = realItem; params.packages = realItem;
} }
if(res.data.price_request.pickup_images){ if(res.data.price_request.pickup_images){
params.pickup_images_count = res.data.price_request.pickup_images_count; // params.pickup_images_count = res.data.price_request.pickup_images_count;
params.pickup_images = res.data.price_request.pickup_images; params.pickup_images = res.data.price_request.pickup_images;
} }
userApi.order.pre(params).then((data)=>{ userApi.order.pre(params).then((data)=>{

View File

@ -23,13 +23,33 @@ Page({
isShowStationEditor:false, isShowStationEditor:false,
currentEditStation:{} currentEditStation:{},
isShowSameStation:false,
ignoreSameStation:false,
sameStationName:''
}, },
async bottomBarButtonTap(){ async bottomBarButtonTap(){
const data = []; const data = [];
const pickupImgs = [];
let hasSame = false; let hasSame = false;
this.data.choosedStationList.find((item,index)=>{ this.data.choosedStationList.find((item,index)=>{
//查找ai识别中相同驿站
//代码写好,暂不开启
if(false){
let sameStations = this.data.choosedStationList.filter((_item)=>{
return (_item.name==item.name)&&!_item.id;
});
if(sameStations.length>1&&!this.data.ignoreSameStation){
hasSame = true;
this.setData({
isShowSameStation:true,
sameStationName:sameStations[0].name
})
return true;
}
}
if(item.pickup_codes.length>0&&item.pickup_codes[0]!=''){ if(item.pickup_codes.length>0&&item.pickup_codes[0]!=''){
//倒着找相同的索引 因为需要从后往前找 //倒着找相同的索引 因为需要从后往前找
const codes = item.pickup_codes.join(',').split(',').reverse(); const codes = item.pickup_codes.join(',').split(',').reverse();
@ -50,12 +70,14 @@ Page({
icon:'none', icon:'none',
title: '取件码重复', title: '取件码重复',
}) })
console.log(this.data.choosedStationList[index],'----');
this.setData({ this.setData({
[`choosedStationList[${index}]`]:this.data.choosedStationList[index] [`choosedStationList[${index}]`]:this.data.choosedStationList[index]
}) })
return true; return true;
} }
if(item.imgUrl){
pickupImgs.push(item.imgUrl);
}
data.push({ data.push({
id:item.id||'', id:item.id||'',
name:item.name, name:item.name,
@ -70,7 +92,7 @@ Page({
if(data.length>0){ if(data.length>0){
let priceRequest = { let priceRequest = {
packages:data, packages:data,
pickup_images:data[0].imgUrl pickup_images:pickupImgs.join(',')
}; };
if(this.data.timePeriodsIndex==-1){ if(this.data.timePeriodsIndex==-1){
wx.showToast({ wx.showToast({
@ -374,6 +396,34 @@ Page({
urls: [url], urls: [url],
}) })
}, },
ignoreSameStation(){
this.data.ignoreSameStation = true;
},
sameStationAfterLeave(){
console.log(this.data.ignoreSameStation);
if(this.data.ignoreSameStation){
this.bottomBarButtonTap();
}
},
mergeStation(){
this.data.ignoreSameStation = false;
this.data.choosedStationList.map((item,index)=>{
if(!item.id){
//从当前往后找所有的
this.data.choosedStationList.map((_item,_index)=>{
if(_index>index){
if(_item.name == item.name&&!_item.id){
item.pickup_codes = item.pickup_codes.concat(_item.pickup_codes);
this.data.choosedStationList.splice(_index,1);
}
}
})
}
});
this.setData({
choosedStationList:this.data.choosedStationList
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -102,3 +102,11 @@
<modal-view editable titleText="修改驿站" content="{{currentEditStation.name||''}}" <modal-view editable titleText="修改驿站" content="{{currentEditStation.name||''}}"
model:show="{{isShowStationEditor}}" use-input auto-focus bind:ok="editStationName" model:show="{{isShowStationEditor}}" use-input auto-focus bind:ok="editStationName"
contentPlaceholder="驿站名不能为空"/> contentPlaceholder="驿站名不能为空"/>
<modal-view class="same-station-view" titleText="合并驿站" show="{{isShowSameStation}}"
bind:ok="ignoreSameStation" bind:cancel="mergeStation" ok-button-text="直接保存" cancel-button-text="立即合并" bind:afterLeave="sameStationAfterLeave">
<view class="content-text">
检测到有多个<label style="color:red;font-weight: bold;">{{sameStationName}}</label>,是否需要合并,
多个驿站会产生额外配送费用。
</view>
</modal-view>

View File

@ -259,3 +259,11 @@
width:28rpx;height:28rpx; width:28rpx;height:28rpx;
margin-right:12rpx; margin-right:12rpx;
} }
.same-station-view .content-text{
color: #666666;
font-size: 28rpx;
text-align: center;
margin:22rpx 0 40rpx 0;
line-height: 48rpx;
}

View File

@ -7,7 +7,10 @@
<view bind:tap="navToSetting"> <view bind:tap="navToSetting">
<image class="avatar" src="{{userInfo.optimized_avatar||'/assets/icon/my/avatar.png'}}"/> <image class="avatar" src="{{userInfo.optimized_avatar||'/assets/icon/my/avatar.png'}}"/>
</view> </view>
<view class="name">{{userInfo.nickname}}</view> <view class="name">
<view>{{userInfo.nickname}}</view>
<view class="phone">{{userInfo.phone}}</view>
</view>
<image src="/assets/icon/help/qrcode.png" class="qrcode" bind:tap="showQRCode" <image src="/assets/icon/help/qrcode.png" class="qrcode" bind:tap="showQRCode"
wx:if="{{userInfo.userid}}"/> wx:if="{{userInfo.userid}}"/>
</view> </view>
@ -32,7 +35,7 @@
<view class="cell-bd"> <view class="cell-bd">
<view> <view>
<view>邀请好友下单</view> <view>邀请好友下单</view>
<view class="spec">邀请好友领券下单自己再得1张跑腿券</view> <view class="spec">邀请好友领券下单自己再得1张配送券</view>
</view> </view>
</view> </view>
<view class="cell-ft"></view> <view class="cell-ft"></view>

View File

@ -29,6 +29,12 @@
flex:1; flex:1;
margin-left:30rpx; margin-left:30rpx;
} }
.user-info .content .phone{
margin-top:18rpx;
font-size: 30rpx;
font-weight: normal;
color: #333;
}
.user-info .content .qrcode{ .user-info .content .qrcode{
width:56rpx;height:56rpx; width:56rpx;height:56rpx;
} }

View File

@ -110,6 +110,11 @@ Page({
url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_delivery_contract)}`, url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_delivery_contract)}`,
}) })
}, },
navToFee(){
wx.navigateTo({
url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_addition_fee_policy)}`,
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -27,6 +27,10 @@
<view class="cell-bd">配送服务协议</view> <view class="cell-bd">配送服务协议</view>
<view class="cell-ft"></view> <view class="cell-ft"></view>
</view> </view>
<view class="cell" bind:tap="navToFee">
<view class="cell-bd">加价收费标准</view>
<view class="cell-ft"></view>
</view>
</view> </view>
<button type="default" class="logout-btn" bind:tap="logout">退出登录</button> <button type="default" class="logout-btn" bind:tap="logout">退出登录</button>

View File

@ -14,7 +14,7 @@
</view> --> </view> -->
<!-- <swiper style="height:{{scrollViewHeight*2}}rpx"> --> <!-- <swiper style="height:{{scrollViewHeight*2}}rpx"> -->
<!-- 跑腿列表 --> <!-- 配送列表 -->
<!-- <swiper-item> --> <!-- <swiper-item> -->
<list-view class="order-list main" wx:if="{{tabIndex==0}}" <list-view class="order-list main" wx:if="{{tabIndex==0}}"

View File

@ -1,4 +1,6 @@
import userApi from '../../../api/user'; import userApi from '../../../api/user';
const app = getApp();
Page({ Page({
/** /**
@ -10,7 +12,9 @@ Page({
cancelling:false, cancelling:false,
isShowCancelView:false, isShowCancelView:false,
isShowAcceptView:false, isShowAcceptView:false,
refresherTriggered:false refresherTriggered:false,
appConfig:{}
}, },
/** /**
@ -19,6 +23,11 @@ Page({
onLoad(options) { onLoad(options) {
this.data.orderId = options.orderid; this.data.orderId = options.orderid;
this.getDetail(); this.getDetail();
app.getAppConfig().then((data)=>{
this.setData({
appConfig:data
})
})
}, },
getDetail(){ getDetail(){
this.setData({ this.setData({
@ -87,6 +96,11 @@ Page({
current:event.currentTarget.dataset.item current:event.currentTarget.dataset.item
}) })
}, },
navToFee(){
wx.navigateTo({
url: `/pages/browser/index?url=${encodeURIComponent(this.data.appConfig.url_addition_fee_policy)}`,
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */

View File

@ -2,5 +2,6 @@
"usingComponents": { "usingComponents": {
"modal-view":"/components/modalView", "modal-view":"/components/modalView",
"merchant-order":"/components/merchantOrder" "merchant-order":"/components/merchantOrder"
} },
"navigationBarTitleText": "订单加价申请"
} }

View File

@ -13,7 +13,7 @@
</view> </view>
</view> </view>
<view class="page-container delivery-man"> <view class="page-container delivery-man">
<view class="head">跑腿员</view> <view class="head">配送员</view>
<view class="spliter"></view> <view class="spliter"></view>
<view class="info"> <view class="info">
<image class="avatar" src="{{applyDetail.deliveryman_avatar||'/assets/icon/my/avatar.png'}}"/> <image class="avatar" src="{{applyDetail.deliveryman_avatar||'/assets/icon/my/avatar.png'}}"/>
@ -28,11 +28,15 @@
<view class="head">加价原因</view> <view class="head">加价原因</view>
<view class="spliter"></view> <view class="spliter"></view>
<view class="reason">{{applyDetail.reason}}</view> <view class="reason">{{applyDetail.reason}}</view>
<view class="imgs"> <view class="imgs" wx:if="{{applyDetail.photo_urls&&applyDetail.photo_urls.length>0}}">
<image class="item" src="{{item}}" wx:for="{{applyDetail.photo_urls}}" <image class="item" src="{{item}}" wx:for="{{applyDetail.photo_urls}}"
wx:key="index" data-item="{{item}}" bind:tap="viewImage"/> wx:key="index" data-item="{{item}}" bind:tap="viewImage"/>
</view> </view>
</view> </view>
<view class="page-container markup-money" bind:tap="navToFee">
<view>加价收费标准</view>
<view class="right-arrow"></view>
</view>
<view class="page-container markup-money"> <view class="page-container markup-money">
<view>加价金额</view> <view>加价金额</view>
<view class="value">{{applyDetail.additional_fee_amount}}元</view> <view class="value">{{applyDetail.additional_fee_amount}}元</view>