|
|
@@ -155,10 +155,80 @@
|
|
|
<button @click="form.getGoods = 0" class="admin-button-com middle" style="width:140upx;" :class="form.getGoods == 0 ? 'blue' : 'default'">未取货</button>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="form.sendType == 2">
|
|
|
- <view class="tui-title">运费</view>
|
|
|
- <input type="digit" placeholder="请填写运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
|
|
|
- </tui-list-cell>
|
|
|
+ <view v-if="form.sendType == 2">
|
|
|
+ <view v-if="openIntraCity == 1" class="delivery-section">
|
|
|
+ <tui-list-cell v-if="openIntraCity == 1" class="line-cell" :hover="false">
|
|
|
+ <!-- 跑腿平台报价列表 -->
|
|
|
+ <view v-if="deliveryQuotes.length > 0" class="delivery-quotes-container">
|
|
|
+ <view class="delivery-quotes-grid">
|
|
|
+ <view
|
|
|
+ v-for="(item, index) in deliveryQuotes"
|
|
|
+ :key="index"
|
|
|
+ class="delivery-quote-item"
|
|
|
+ :class="{
|
|
|
+ 'active': selectedDeliveryIndex === index,
|
|
|
+ 'disabled': !item.isAble,
|
|
|
+ 'fixed-width': deliveryQuotes.length <= 2
|
|
|
+ }"
|
|
|
+ @click="selectDelivery(item, index)"
|
|
|
+ >
|
|
|
+ <view class="platform-name">{{ item.displayName || item.name }}</view>
|
|
|
+ <view class="platform-price">{{ item.priceText }}元</view>
|
|
|
+ <view v-if="item.type" class="platform-type">{{ item.type }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-else class="empty-quotes-view">
|
|
|
+ <text>正在获取运费...</text>
|
|
|
+ <!-- <text class="error-tips">上面地址缺失或有问题,请修改</text> -->
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false">
|
|
|
+ <view class="tui-title">距离</view>
|
|
|
+ <view class="distance-box">
|
|
|
+ <text v-if="showDistance > 100" class="blue-text">{{ (showDistance/1000).toFixed(1) }}公里</text>
|
|
|
+ <text v-else class="blue-text">{{ showDistance }} 米</text>
|
|
|
+ <!-- <input type="digit" :value="showDistance/1000" placeholder-class="tui-placeholder" style="text-align:left;width:70upx;margin-right:10upx;"/>公里 -->
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title title-reduction" style="width: 150upx;">满减规则</view>
|
|
|
+ <button @tap="form.reductionRule = 0" class="admin-button-com mini-btn btn-reduction" :class="form.reductionRule == 0 ? 'active' : 'default'">没有满减</button>
|
|
|
+ <button @tap="form.reductionRule = 1" class="admin-button-com mini-btn btn-reduction" :class="form.reductionRule == 1 ? 'active' : 'default'">用花材</button>
|
|
|
+ <button @tap="form.reductionRule = 2" class="admin-button-com mini-btn btn-reduction-last" :class="form.reductionRule == 2 ? 'active' : 'default'">用花束</button>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title">运费</view>
|
|
|
+ <text v-if="form.reductionRule == 0" class="blue-text">¥{{ form.sendCost }}</text>
|
|
|
+ <text v-if="form.reductionRule == 1" class="free-delivery-tag">
|
|
|
+ <text v-if="isHcMapRule()"><text class="strike-through">¥{{ form.sendCost }}</text>【花材免跑腿费】</text>
|
|
|
+ <text v-else>¥{{ form.sendCost }}</text>
|
|
|
+ </text>
|
|
|
+ <text v-if="form.reductionRule == 2" class="free-delivery-tag">
|
|
|
+ <text v-if="isHsMapRule()"><text class="strike-through">¥{{ form.sendCost }}</text>【花束免跑腿费】</text>
|
|
|
+ <text v-else>¥{{ form.sendCost }}</text>
|
|
|
+ </text>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title">呼叫跑腿</view>
|
|
|
+ <button @tap="form.callErrand = 0" class="admin-button-com middle btn-call" :class="form.callErrand == 0? 'active' : 'default'">晚点呼叫</button>
|
|
|
+ <button @tap="form.callErrand = 1" class="admin-button-com middle btn-call" :class="form.callErrand == 1 ? 'active' : 'default'">现在呼叫</button>
|
|
|
+ </tui-list-cell>
|
|
|
+ <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title">取件时间</view>
|
|
|
+ <view class="time-action-view" @click.stop="openTimePicker">
|
|
|
+ <text>{{ pickupTime.label || '立即取件' }}</text>
|
|
|
+ <text class="iconfont iconxiangyou icon-arrow-right"></text>
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+ <view v-else class="delivery-section">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title">运费</view>
|
|
|
+ <input type="digit" placeholder="请填写运费" v-model="form.sendCost" placeholder-class="tui-placeholder"/>
|
|
|
+ </tui-list-cell>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
<view class="tui-title">打印小票</view>
|
|
|
@@ -170,7 +240,7 @@
|
|
|
<view class="tui-title">
|
|
|
<text>合计金额</text>
|
|
|
</view>
|
|
|
- <text style="color: #3385FF;width:170upx;">¥{{parseFloat(finalPrice)}}</text>
|
|
|
+ <text style="color: #3385FF;width:170upx;">¥{{parseFloat(systemPrice)}}</text>
|
|
|
<button @tap="showDiscount()" class="admin-button-com middle default" style="width:140upx;">打折</button>
|
|
|
<text v-if="discountValue>0 && discountValue<1">{{ Number(discountValue)*10 }}折</text>
|
|
|
</tui-list-cell>
|
|
|
@@ -180,8 +250,8 @@
|
|
|
<view v-else-if="form.hasPay == 3" class="tui-title">余额扣减</view>
|
|
|
<view v-else class="tui-title">{{form.forward==0?'实收':'实付'}}金额</view>
|
|
|
<input style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;" type="digit" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
|
|
|
- <text v-if="modifyPrice > 0 && modifyPrice > finalPrice" style="font-size:25upx;margin-left:20upx;color:red;">人工包装费 ¥{{parseFloat((modifyPrice-finalPrice).toFixed(2))}}</text>
|
|
|
- <text v-if="modifyPrice > 0 && modifyPrice < finalPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((finalPrice-modifyPrice).toFixed(2))}}</text>
|
|
|
+ <text v-if="modifyPrice > 0 && modifyPrice > systemPrice" style="font-size:25upx;margin-left:20upx;color:red;">人工包装费 ¥{{parseFloat((modifyPrice-systemPrice).toFixed(2))}}</text>
|
|
|
+ <text v-if="modifyPrice > 0 && modifyPrice < systemPrice" style="font-size:25upx;margin-left:20upx;color:green;">优惠 ¥{{parseFloat((systemPrice-modifyPrice).toFixed(2))}}</text>
|
|
|
</tui-list-cell>
|
|
|
|
|
|
<tui-list-cell class="line-cell" :hover="false" :arrow="true">
|
|
|
@@ -395,40 +465,32 @@
|
|
|
|
|
|
<mx-date-picker :show="reachDatePickerShow" format="yyyy-mm-dd" type="date" :value="reachDatePickerValue" :show-tips="true" @confirm="confirmReachDatePicker" @cancel="reachDatePickerShow = false" />
|
|
|
|
|
|
+ <!-- 取件时间选择器 -->
|
|
|
+ <TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
|
|
|
+
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import TuiListCell from "@/components/plugin/list-cell";
|
|
|
-import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
-import SimpleAddress from "@/components/plugin/simple-address";
|
|
|
-import AppAreaSel from "@/components/app-area-sel";
|
|
|
import productMins from "@/mixins/product";
|
|
|
-import appFormRadioBtn from "@/components/app-formRadio-btn";
|
|
|
-import appAddressGroup from "@/components/app-address-group";
|
|
|
-import appSendTime from "@/components/app-send-time";
|
|
|
-import appFormSend from "@/components/app-form-send";
|
|
|
-const formUtil = require("@/utils/formValidation.js");
|
|
|
import { createOrder } from "@/api/order/index";
|
|
|
import { getAllStaff } from "@/api/shop-admin"
|
|
|
import { mapActions, mapGetters } from "vuex";
|
|
|
import { getCustomInfo} from "@/api/custom"
|
|
|
+import { quickOrderAllDeliveryQuotes } from '@/api/express/delivery'
|
|
|
import ModalModule from "@/components/plugin/modal"
|
|
|
import MxDatePicker from '@/components/mx-datepicker/mx-datepicker.vue';
|
|
|
+import TimePicker from '@/components/plugin/TimePicker';
|
|
|
+import dayjs from 'dayjs';
|
|
|
export default {
|
|
|
name: "affirm",
|
|
|
components: {
|
|
|
TuiListCell,
|
|
|
- AppAvatarModule,
|
|
|
- SimpleAddress,
|
|
|
- AppAreaSel,
|
|
|
- appFormRadioBtn,
|
|
|
- appAddressGroup,
|
|
|
- appSendTime,
|
|
|
- appFormSend,
|
|
|
ModalModule,
|
|
|
- MxDatePicker
|
|
|
+ MxDatePicker,
|
|
|
+ TimePicker
|
|
|
},
|
|
|
mixins: [productMins],
|
|
|
data () {
|
|
|
@@ -472,7 +534,9 @@ export default {
|
|
|
forward:0,
|
|
|
needWork:0,
|
|
|
forwardStock:1,
|
|
|
- fromType:1//门店来的订单
|
|
|
+ fromType:1,//门店来的订单
|
|
|
+ reductionRule: 0,
|
|
|
+ callErrand: 0 //现在呼叫 0 晚点呼叫 1
|
|
|
},
|
|
|
showCustomer: false,
|
|
|
customInfo:{discount:1,balance:0},
|
|
|
@@ -486,22 +550,47 @@ export default {
|
|
|
calc:'add',
|
|
|
diffPriceList:[],
|
|
|
currentShop:{default:0},
|
|
|
+ openIntraCity: 0,
|
|
|
+ hcFreeKm: 0, //跑腿免费公里数
|
|
|
+ hcMap: [], //花材满减规则
|
|
|
+ hsFreeKm: 0, //花束免费公里数
|
|
|
+ hsMap: [], //花束满减规则
|
|
|
+ deliveryQuotes: [], // 跑腿平台报价列表
|
|
|
+ selectedDeliveryIndex: -1,
|
|
|
+ selectedDeliveryData: null,
|
|
|
+ showDistance: 0,
|
|
|
forwardPayWay:0,//不影响原有的form.payWay方式,重新定义一个
|
|
|
reduceStock:0,
|
|
|
timeOptions: [['00', '01', '02','03','04','05','06','07','08','09','10','11','12','13', '14','15','16','17','18','19','20','21','22','23'],['00', '05', '10','15','20','25','30','35','40','45','50','55']],
|
|
|
selectedHour: '12', // 选中的小时
|
|
|
selectedMinute: '00', // 选中的分钟
|
|
|
+ pickupTime: {
|
|
|
+ label: '立即取件',
|
|
|
+ value: dayjs().format('YYYY-MM-DD HH:mm'),
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
onLoad (option) {
|
|
|
-
|
|
|
-
|
|
|
+ this.option = option
|
|
|
this.kdType = option.kdType
|
|
|
|
|
|
let that = this
|
|
|
this.initMerchantInfo().then((data) => {
|
|
|
uni.setNavigationBarTitle({ title: data.name })
|
|
|
that.currentShop = data.shopInfo
|
|
|
+ that.openIntraCity = data.openIntraCity
|
|
|
+ that.hcFreeKm = data.hcFreeKm
|
|
|
+ try {
|
|
|
+ that.hcMap = typeof data.hcMap === 'string' ? JSON.parse(data.hcMap) : data.hcMap
|
|
|
+ } catch (e) {
|
|
|
+ that.hcMap = []
|
|
|
+ }
|
|
|
+ that.hsFreeKm = data.hsFreeKm
|
|
|
+ try {
|
|
|
+ that.hsMap = typeof data.hsMap === 'string' ? JSON.parse(data.hsMap) : data.hsMap
|
|
|
+ } catch (e) {
|
|
|
+ that.hsMap = []
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
if(Number(option.customId) > 0){
|
|
|
@@ -516,7 +605,6 @@ export default {
|
|
|
//用于混入product的已选中花材!!!!!
|
|
|
this.selectJobId = option.customId
|
|
|
this.selectJobType = 'bill'
|
|
|
-
|
|
|
}
|
|
|
|
|
|
//默认欠款是首选项
|
|
|
@@ -538,7 +626,6 @@ export default {
|
|
|
|
|
|
},
|
|
|
onShow(){
|
|
|
-
|
|
|
if(!this.$util.isEmpty(uni.getStorageSync("newClient"))){
|
|
|
this.showCustomer = true;
|
|
|
}
|
|
|
@@ -550,6 +637,10 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+ //获取跑腿平台报价
|
|
|
+ if(this.form.sendType == 2){
|
|
|
+ this.getDeliveryQuotes()
|
|
|
+ }
|
|
|
},
|
|
|
onUnload(){
|
|
|
uni.removeStorageSync('newClient')
|
|
|
@@ -557,32 +648,92 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(["getMerchantInfo","getMyShopInfo", "getLoginInfo"]),
|
|
|
- finalPrice(){
|
|
|
+ systemPrice(){
|
|
|
let totalPrice = this.allPrice.toFixed(2)
|
|
|
let finalPrice = Number(totalPrice)
|
|
|
if(this.form.sendType == 2){
|
|
|
- finalPrice = Number(finalPrice) + Number(this.form.sendCost)
|
|
|
+ const sendCost = Number(this.form.sendCost)
|
|
|
+
|
|
|
+ if(this.form.reductionRule == 0){
|
|
|
+ finalPrice = Number(finalPrice) + sendCost
|
|
|
+ }else if(this.form.reductionRule == 1){
|
|
|
+ if(this.isHcMapRule()){
|
|
|
+ finalPrice = Number(finalPrice)
|
|
|
+ }else{
|
|
|
+ finalPrice = Number(finalPrice) + sendCost
|
|
|
+ }
|
|
|
+ }else if(this.form.reductionRule == 2){
|
|
|
+ if(this.isHsMapRule()){
|
|
|
+ finalPrice = Number(finalPrice)
|
|
|
+ }else{
|
|
|
+ finalPrice = Number(finalPrice) + sendCost
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- finalPrice = Number(finalPrice).toFixed(2)
|
|
|
- let currentPrice = parseFloat(finalPrice)
|
|
|
- this.modifyPrice = currentPrice
|
|
|
- return currentPrice
|
|
|
+ return parseFloat(Number(finalPrice).toFixed(2))
|
|
|
},
|
|
|
labourCost(){
|
|
|
let cost = 0
|
|
|
- if(Number(this.modifyPrice)>Number(this.finalPrice)){
|
|
|
- cost = Number(this.modifyPrice) - Number(this.finalPrice)
|
|
|
+ if(Number(this.modifyPrice)>Number(this.systemPrice)){
|
|
|
+ cost = Number(this.modifyPrice) - Number(this.systemPrice)
|
|
|
cost = Number(cost).toFixed(2)
|
|
|
}
|
|
|
return cost
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ systemPrice: {
|
|
|
+ handler(val) {
|
|
|
+ this.modifyPrice = val
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ init () {},
|
|
|
...mapActions(["initMerchantInfo"]),
|
|
|
+ checkMapRule(type){
|
|
|
+ const distanceInMeters = Number(this.showDistance) || 0
|
|
|
+ const freeKm = type === 'hc' ? this.hcFreeKm : this.hsFreeKm
|
|
|
+ const freeKmInMeters = (Number(freeKm) || 0) * 1000
|
|
|
+ if(distanceInMeters < freeKmInMeters){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ let map = type === 'hc' ? this.hcMap : this.hsMap
|
|
|
+ if(map && Array.isArray(map) && map.length > 0){
|
|
|
+ const flowerCount = this.allCountFun.bigLength || 0
|
|
|
+ const flowerPrice = this.allPriceFun || 0
|
|
|
+ for(const rule of map){
|
|
|
+ const ruleNum = Number(rule.num) || 0
|
|
|
+ const rulePrice = Number(rule.price) || 0
|
|
|
+ const ruleDistance = (Number(rule.distance) || 0) * 1000
|
|
|
+ if(flowerCount >= ruleNum && flowerPrice >= rulePrice && distanceInMeters <= ruleDistance){
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return false
|
|
|
+ },
|
|
|
+ isHcMapRule(){
|
|
|
+ return this.checkMapRule('hc')
|
|
|
+ },
|
|
|
+ isHsMapRule(){
|
|
|
+ return this.checkMapRule('hs')
|
|
|
+ },
|
|
|
setSendType (type) {
|
|
|
this.form.sendType = type
|
|
|
if (type !== 2) {
|
|
|
this.form.sendCost = ""
|
|
|
+ // 切换到其他配送方式时清空报价数据
|
|
|
+ this.deliveryQuotes = []
|
|
|
+ this.selectedDeliveryIndex = -1
|
|
|
+ this.selectedDeliveryData = null
|
|
|
+ } else {
|
|
|
+ // 如果切换回跑腿,且之前有获取过但被清空了,可能需要重新获取,或者保持现状等待用户操作
|
|
|
+ // 这里根据 affirmGhs 的逻辑,如果在此处重新获取,可能需要在 onShow 或其他地方触发
|
|
|
+ if(this.openIntraCity == 1 && type == 2){
|
|
|
+ this.getDeliveryQuotes()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
bindHistoryDateChange(){
|
|
|
@@ -632,7 +783,7 @@ export default {
|
|
|
},
|
|
|
setDiscount(num){
|
|
|
this.discountValue = Number(num)
|
|
|
- let price = Number(this.finalPrice)*Number(num)
|
|
|
+ let price = Number(this.systemPrice)*Number(num)
|
|
|
price = parseFloat(price.toFixed(2))
|
|
|
this.modifyPrice = price
|
|
|
this.$refs.discountRef.close()
|
|
|
@@ -666,9 +817,6 @@ export default {
|
|
|
this.kdType = 'HIT';
|
|
|
this.replaceItemFn(item,0,'add')
|
|
|
},
|
|
|
- init () {
|
|
|
-
|
|
|
- },
|
|
|
kdChange(e){
|
|
|
let index = e.detail.value
|
|
|
if(!this.$util.isEmpty(this.staffList)){
|
|
|
@@ -744,7 +892,16 @@ export default {
|
|
|
self.formSubmit()
|
|
|
})
|
|
|
},
|
|
|
+ validateForm() {
|
|
|
+ if(Number(this.modifyPrice) <= 0){
|
|
|
+ this.$msg('收款金额必须大于0');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ return true
|
|
|
+ },
|
|
|
async formSubmit () {
|
|
|
+ if(!this.validateForm()) return;
|
|
|
+
|
|
|
let that = this
|
|
|
let formData = this.form;
|
|
|
const product = this.selectList.map((ele) => {
|
|
|
@@ -753,19 +910,27 @@ export default {
|
|
|
let unitPrice = ele.userPrice ? ele.userPrice : 0
|
|
|
return {productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount, classId: ele.classId,
|
|
|
itemId: ele.itemId, unitPrice:unitPrice,remark:ele.remark,property:ele.property,unitType:unitType,num:num}
|
|
|
- });
|
|
|
+ }
|
|
|
+ );
|
|
|
formData.product = JSON.stringify(product);
|
|
|
if (!this.getMerchantInfo) {
|
|
|
await this.initMerchantInfo();
|
|
|
}
|
|
|
formData.shopId = this.getMerchantInfo.id;
|
|
|
- if(Number(this.modifyPrice) <= 0){
|
|
|
- this.$msg('收款金额必须大于0');
|
|
|
- return false
|
|
|
- }
|
|
|
|
|
|
let params = {...formData,modifyPrice: this.modifyPrice,labourCost:this.labourCost};
|
|
|
|
|
|
+ // 如果选择了跑腿配送并且有选中的平台数据,则添加配送平台信息
|
|
|
+ if (this.form.sendType == 2 && this.selectedDeliveryData) {
|
|
|
+ params.deliveryPlatform = this.selectedDeliveryData.en_name // 平台名称
|
|
|
+ params.deliveryPrice = this.selectedDeliveryData.priceNumber // 报价金额
|
|
|
+ params.deliveryDistance = this.showDistance // 配送距离
|
|
|
+ params.deliveryBracketContent = this.selectedDeliveryData.bracketContent // 配送平台括号里的内容
|
|
|
+ if(this.form.callErrand == 1){
|
|
|
+ params.pickupTime = this.pickupTime.value
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//多颜色
|
|
|
let xj = uni.getStorageSync("xj"+this.option.customId)
|
|
|
//orderType 开单类型,1商品开单 2花材开单
|
|
|
@@ -776,7 +941,7 @@ export default {
|
|
|
let book = this.option.book ? this.option.book : 0
|
|
|
let reduceStock = this.option.reduceStock?this.option.reduceStock:0
|
|
|
params = {...params,orderId:orderId,book:book,reduceStock:reduceStock,version:3}
|
|
|
-console.log(params)
|
|
|
+ //console.log(params)
|
|
|
uni.showLoading({mask:true})
|
|
|
createOrder(params).then((res) => {
|
|
|
uni.hideLoading()
|
|
|
@@ -803,7 +968,6 @@ console.log(params)
|
|
|
}else{
|
|
|
this.$msg('提交失败')
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
@@ -823,7 +987,81 @@ console.log(params)
|
|
|
this.$util.pageTo({url: '/admin/billing/hs?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
|
|
|
}
|
|
|
|
|
|
- }
|
|
|
+ },
|
|
|
+ getDeliveryQuotes(){
|
|
|
+ this.deliveryQuotes = []
|
|
|
+ this.selectedDeliveryIndex = -1
|
|
|
+ this.selectedDeliveryData = null
|
|
|
+
|
|
|
+ quickOrderAllDeliveryQuotes({
|
|
|
+ totalPrice: this.allPrice,
|
|
|
+ weight: 1, //this.allCount.weight
|
|
|
+ customId: this.option.customId,
|
|
|
+ pickupTime: this.pickupTime.value,
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.code == 1 && res.data && res.data.deliveryList){
|
|
|
+ // 处理报价数据
|
|
|
+ this.deliveryQuotes = res.data.deliveryList
|
|
|
+ .filter(item => item.isAble !== false)
|
|
|
+ .map(item => {
|
|
|
+ // 价格从分转换为元
|
|
|
+ const price = item.price ? (item.price / 100).toFixed(1) : '0.0'
|
|
|
+
|
|
|
+ // 提取平台名称(去掉括号内的内容)
|
|
|
+ let displayName = item.name || ''
|
|
|
+ let bracketContent = ''
|
|
|
+ if (displayName && displayName.indexOf('(') !== -1) {
|
|
|
+ const parts = displayName.split('(');
|
|
|
+ if(parts.length > 1) {
|
|
|
+ displayName = parts[0].trim();
|
|
|
+ bracketContent = parts[1].replace(')', '');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //滴滴特殊处理,括号里的内容作为类型
|
|
|
+ if(item.en_name == 'didi' && bracketContent != ''){
|
|
|
+ item.type = bracketContent
|
|
|
+ }
|
|
|
+
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ displayName: displayName,
|
|
|
+ priceText: price,
|
|
|
+ priceNumber: parseFloat(price),
|
|
|
+ bracketContent: bracketContent
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // 自动选中第一个可用的报价
|
|
|
+ const firstAvailableIndex = this.deliveryQuotes.findIndex(item => item.isAble)
|
|
|
+ if (firstAvailableIndex !== -1) {
|
|
|
+ this.selectDelivery(this.deliveryQuotes[firstAvailableIndex], firstAvailableIndex)
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ uni.showToast({ title: '暂无跑腿可用', icon: 'none' })
|
|
|
+ }
|
|
|
+ }).catch(err=>{
|
|
|
+ this.$msg('获取跑腿平台报价失败')
|
|
|
+ console.log('获取跑腿平台报价失败:', err)
|
|
|
+ this.deliveryQuotes = []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 选择跑腿平台
|
|
|
+ selectDelivery(item, index) {
|
|
|
+ this.selectedDeliveryIndex = index
|
|
|
+ this.selectedDeliveryData = item
|
|
|
+ this.form.sendCost = item.priceNumber
|
|
|
+ this.showDistance = item.distance || 0
|
|
|
+ },
|
|
|
+ openTimePicker() {
|
|
|
+ this.$refs.timePicker.open();
|
|
|
+ },
|
|
|
+ handleTimeConfirm(time) {
|
|
|
+ this.pickupTime = time;
|
|
|
+ if (this.form.sendType == 2) {
|
|
|
+ this.getDeliveryQuotes();
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -831,6 +1069,11 @@ console.log(params)
|
|
|
<style lang="scss" scoped>
|
|
|
.admin-button-com {
|
|
|
margin-right: 30upx;
|
|
|
+ &.active {
|
|
|
+ background-color: #09C567 !important;
|
|
|
+ color: #fff !important;
|
|
|
+ border: 1upx solid #09C567 !important;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1315,4 +1558,232 @@ console.log(params)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ /* 跑腿平台报价样式 */
|
|
|
+.delivery-quotes-container {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 20upx;
|
|
|
+}
|
|
|
+
|
|
|
+.delivery-quotes-grid {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 10upx;
|
|
|
+ padding: 0;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.delivery-quote-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ flex: 0 0 calc(33% - 7upx);
|
|
|
+ width: calc(33% - 7upx);
|
|
|
+ min-height: 140upx;
|
|
|
+ padding: 16upx 10upx;
|
|
|
+ margin-bottom: 5upx;
|
|
|
+ background: #FFFFFF;
|
|
|
+ border: 2upx solid #DDDDDD;
|
|
|
+ border-radius: 8upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ transition: all 0.3s;
|
|
|
+
|
|
|
+ // 当只有1-2项时使用固定宽度
|
|
|
+ &.fixed-width {
|
|
|
+ flex: 0 0 220rpx;
|
|
|
+ width: 220rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .platform-name {
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 8upx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 1.3;
|
|
|
+ max-width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+
|
|
|
+ .platform-price {
|
|
|
+ font-size: 30upx;
|
|
|
+ color: #333;
|
|
|
+ font-weight: bold;
|
|
|
+ margin-bottom: 4upx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .platform-type {
|
|
|
+ font-size: 20upx;
|
|
|
+ color: #868686;
|
|
|
+ margin-top: 4upx;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 1.3;
|
|
|
+ max-width: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ line-clamp: 2;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 选中状态
|
|
|
+ &.active {
|
|
|
+ background: #09C567;
|
|
|
+ border-color: #09C567;
|
|
|
+
|
|
|
+ .platform-name,
|
|
|
+ .platform-price {
|
|
|
+ color: #FFFFFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .platform-type {
|
|
|
+ color: rgba(255, 255, 255, 0.85);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 不可用状态
|
|
|
+ &.disabled {
|
|
|
+ opacity: 0.5;
|
|
|
+ background: #F5F5F5;
|
|
|
+
|
|
|
+ .platform-name,
|
|
|
+ .platform-price,
|
|
|
+ .platform-type {
|
|
|
+ color: #CCCCCC;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/* 跑腿费价格样式 */
|
|
|
+.delivery-price-normal {
|
|
|
+ color: #3385FF;
|
|
|
+}
|
|
|
+
|
|
|
+.delivery-price-free {
|
|
|
+ color: #999;
|
|
|
+ text-decoration: line-through;
|
|
|
+}
|
|
|
+
|
|
|
+.free-delivery-tag {
|
|
|
+ color: #3385FF;
|
|
|
+ margin-left: 5upx;
|
|
|
+}
|
|
|
+
|
|
|
+.delivery-policy-link {
|
|
|
+ color: rgb(201, 52, 52);
|
|
|
+ font-size: 30upx;
|
|
|
+ margin-left: 30upx;
|
|
|
+ font-weight:bold;
|
|
|
+ text-decoration: underline;
|
|
|
+}
|
|
|
+
|
|
|
+.policy-icon {
|
|
|
+ font-size: 28upx;
|
|
|
+ margin-left: 4upx;
|
|
|
+}
|
|
|
+
|
|
|
+.policy-popup-content {
|
|
|
+ width: 600upx;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20upx;
|
|
|
+ padding: 30upx;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.policy-title {
|
|
|
+ font-size: 34upx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+.policy-scroll {
|
|
|
+ width: 100%;
|
|
|
+ max-height: 50vh;
|
|
|
+ margin-bottom: 30upx;
|
|
|
+}
|
|
|
+.policy-list {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.policy-item {
|
|
|
+ font-size: 30upx;
|
|
|
+ color: #666;
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ text-align: left;
|
|
|
+ line-height: 1.5;
|
|
|
+ display: list-item;
|
|
|
+ list-style-type: disc;
|
|
|
+ margin-left: 40upx;
|
|
|
+}
|
|
|
+.policy-btn {
|
|
|
+ width: 50%;
|
|
|
+ height: 80upx;
|
|
|
+ line-height: 80upx;
|
|
|
+ text-align: center;
|
|
|
+ background-color: #3385ff;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 32upx;
|
|
|
+ border-radius: 40upx;
|
|
|
+}
|
|
|
+
|
|
|
+.delivery-section {
|
|
|
+ border: 1upx solid #eee;
|
|
|
+ margin: 8upx 20upx;
|
|
|
+ border-radius: 8upx;
|
|
|
+}
|
|
|
+.empty-quotes-view {
|
|
|
+ text-align: center;
|
|
|
+ padding: 20upx 0;
|
|
|
+}
|
|
|
+.error-tips {
|
|
|
+ color: red;
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 32upx;
|
|
|
+}
|
|
|
+.distance-box {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.blue-text {
|
|
|
+ color: #3385FF;
|
|
|
+}
|
|
|
+.title-reduction {
|
|
|
+ width: 150upx;
|
|
|
+}
|
|
|
+.btn-reduction {
|
|
|
+ margin-right: 12upx;
|
|
|
+ height: 70upx;
|
|
|
+ line-height: 46upx;
|
|
|
+}
|
|
|
+.btn-reduction-last {
|
|
|
+ margin-right: 0upx;
|
|
|
+ height: 70upx;
|
|
|
+ line-height: 46upx;
|
|
|
+}
|
|
|
+.strike-through {
|
|
|
+ text-decoration: line-through;
|
|
|
+}
|
|
|
+.btn-call {
|
|
|
+ width: 170upx;
|
|
|
+}
|
|
|
+.time-action-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #049E2C;
|
|
|
+ font-size: 28upx;
|
|
|
+}
|
|
|
+.icon-arrow-right {
|
|
|
+ font-size: 24upx;
|
|
|
+ color: #049E2C;
|
|
|
+ margin-left: 5upx;
|
|
|
+}
|
|
|
+
|
|
|
</style>
|