|
|
@@ -331,7 +331,6 @@
|
|
|
<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">
|
|
|
@@ -341,12 +340,6 @@
|
|
|
</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> -->
|
|
|
-
|
|
|
<view v-if="form.reductionRule == 1 && isHcMapRule()">
|
|
|
<input type="digit" placeholder="请填写运费" v-model="form.customSendCost" placeholder-class="tui-placeholder" style="border:1upx solid #eee;color:#3385FF;width:150upx;height:70upx;"/>
|
|
|
</view>
|
|
|
@@ -366,6 +359,30 @@
|
|
|
<text class="iconfont iconxiangyou icon-arrow-right"></text>
|
|
|
</view>
|
|
|
</tui-list-cell>
|
|
|
+ <tui-list-cell v-if="form.callErrand == 1" class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title">重量</view>
|
|
|
+ <view>
|
|
|
+ <view class="weight-input-wrapper">
|
|
|
+ <view class="weight-control">
|
|
|
+ <view class="control-btn minus-btn" @click="decreaseWeight">
|
|
|
+ <text>-</text>
|
|
|
+ </view>
|
|
|
+ <input type="number" v-model.number="form.weight" placeholder="请输入货物总重量" @blur="validateWeight" />
|
|
|
+ <view class="control-btn plus-btn" @click="increaseWeight">
|
|
|
+ <text>+</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <text class="unit">公斤</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </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="remark-action" @click="openRemarkModal">
|
|
|
+ <text :class="{ placeholder: !form.deliveryRemark }">{{ form.deliveryRemark || '请填写配送备注' }}</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">
|
|
|
@@ -581,6 +598,29 @@
|
|
|
|
|
|
<!-- 取件时间选择器 -->
|
|
|
<TimePicker ref="timePicker" @confirm="handleTimeConfirm" />
|
|
|
+
|
|
|
+ <!-- 备注输入弹窗 -->
|
|
|
+ <view class="remark-modal" v-if="showRemarkModal" @click="closeRemarkModal">
|
|
|
+ <view class="modal-content" @click.stop>
|
|
|
+ <view class="modal-header">
|
|
|
+ <text class="modal-title">填写备注信息</text>
|
|
|
+ </view>
|
|
|
+ <view class="modal-body">
|
|
|
+ <textarea
|
|
|
+ v-model="tempRemark"
|
|
|
+ placeholder="请输入备注信息"
|
|
|
+ maxlength="200"
|
|
|
+ :auto-height="true"
|
|
|
+ class="remark-textarea"
|
|
|
+ />
|
|
|
+ <view class="char-count">{{ tempRemark.length }}/200</view>
|
|
|
+ </view>
|
|
|
+ <view class="modal-footer">
|
|
|
+ <button class="modal-btn cancel-btn" @click="closeRemarkModal">取消</button>
|
|
|
+ <button class="modal-btn confirm-btn" @click="confirmRemark">确认</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
@@ -665,7 +705,9 @@ export default {
|
|
|
dealPrice: 0,
|
|
|
wlName: '',
|
|
|
reductionRule: 0,
|
|
|
- callErrand: 0 //现在呼叫 0 晚点呼叫 1
|
|
|
+ callErrand: 0, //现在呼叫 0 晚点呼叫 1
|
|
|
+ weight: 1,
|
|
|
+ deliveryRemark: '',
|
|
|
},
|
|
|
showCustomer: false,
|
|
|
customInfo: { discount: 1 },
|
|
|
@@ -683,7 +725,14 @@ export default {
|
|
|
book: 0,
|
|
|
selectStaff: { id: '', name: '' },
|
|
|
showFinance: 0,
|
|
|
- hasFinance: 0
|
|
|
+ hasFinance: 0,
|
|
|
+ // 备注弹窗相关
|
|
|
+ showRemarkModal: false,
|
|
|
+ tempRemark: '',
|
|
|
+ //-------------
|
|
|
+
|
|
|
+ // 重量输入防抖定时器
|
|
|
+ weightDebounceTimer: null,
|
|
|
};
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
@@ -778,6 +827,12 @@ export default {
|
|
|
onUnload() {
|
|
|
uni.removeStorageSync('newClient');
|
|
|
uni.$off('listenGetScanCode');
|
|
|
+
|
|
|
+ // 页面卸载时清除定时器
|
|
|
+ if (this.weightDebounceTimer) {
|
|
|
+ clearTimeout(this.weightDebounceTimer);
|
|
|
+ this.weightDebounceTimer = null;
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['getMerchantInfo', 'getMyShopInfo', 'getLoginInfo']),
|
|
|
@@ -845,6 +900,50 @@ export default {
|
|
|
return currentPrice;
|
|
|
}
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ // 监听重量变化
|
|
|
+ 'form.weight'(newVal, oldVal) {
|
|
|
+ // 清除之前的定时器
|
|
|
+ if (this.weightDebounceTimer) {
|
|
|
+ clearTimeout(this.weightDebounceTimer);
|
|
|
+ this.weightDebounceTimer = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果有运力列表且值变化了,清空运力列表
|
|
|
+ if (this.deliveryQuotes.length > 0) {
|
|
|
+ this.clearDeliveryList();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 设置新的定时器,1秒后自动加载运力
|
|
|
+ this.weightDebounceTimer = setTimeout(() => {
|
|
|
+ // 只有当重量值有效时才自动加载
|
|
|
+ if (newVal && Number(newVal) > 0 && this.form.sendType == 2) {
|
|
|
+ this.handleLoadDelivery();
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+ // 监听取件时间变化
|
|
|
+ pickupTime: {
|
|
|
+ handler(newVal, oldVal) {
|
|
|
+ if (this.deliveryQuotes.length > 0) {
|
|
|
+ this.clearDeliveryList();
|
|
|
+ }
|
|
|
+ if (this.form.sendType == 2) {
|
|
|
+ this.getDeliveryQuotes();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ },
|
|
|
+ // 监听备注变化
|
|
|
+ 'form.deliveryRemark'(newVal, oldVal) {
|
|
|
+ if (this.deliveryQuotes.length > 0) {
|
|
|
+ this.clearDeliveryList();
|
|
|
+ }
|
|
|
+ if (this.form.sendType == 2) {
|
|
|
+ this.getDeliveryQuotes();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
methods: {
|
|
|
init() {},
|
|
|
...mapActions(['initMerchantInfo']),
|
|
|
@@ -999,6 +1098,7 @@ export default {
|
|
|
params.deliveryPrice = this.selectedDeliveryData.priceNumber; // 报价金额
|
|
|
params.deliveryDistance = this.showDistance; // 配送距离
|
|
|
params.deliveryBracketContent = this.selectedDeliveryData.bracketContent; // 配送平台括号里的内容
|
|
|
+ params.deliveryAllParams = this.selectedDeliveryData; // 配送平台所有参数
|
|
|
if (this.form.callErrand == 1) {
|
|
|
params.pickupTime = this.pickupTime.value;
|
|
|
}
|
|
|
@@ -1118,7 +1218,8 @@ export default {
|
|
|
|
|
|
quickOrderAllDeliveryQuotes({
|
|
|
totalPrice: this.allPrice,
|
|
|
- weight: 1, //this.allCount.weight
|
|
|
+ weight: this.form.weight,
|
|
|
+ remark: this.form.deliveryRemark,
|
|
|
customId: this.option.customId,
|
|
|
pickupTime: this.pickupTime.value
|
|
|
})
|
|
|
@@ -1182,9 +1283,6 @@ export default {
|
|
|
},
|
|
|
handleTimeConfirm(time) {
|
|
|
this.pickupTime = time;
|
|
|
- if (this.form.sendType == 2) {
|
|
|
- this.getDeliveryQuotes();
|
|
|
- }
|
|
|
},
|
|
|
getCustomDetail() {
|
|
|
let that = this;
|
|
|
@@ -1198,7 +1296,58 @@ export default {
|
|
|
updateCustomAddress(){
|
|
|
this.isUpdateAddress = true;
|
|
|
this.$util.pageTo({ url: '/pagesClient/member/modify?id='+this.customInfo.id+'&name='+this.customInfo.name })
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 减少重量
|
|
|
+ decreaseWeight() {
|
|
|
+ if (this.form.weight > 1) {
|
|
|
+ this.form.weight = Number(this.form.weight) - 1;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 增加重量
|
|
|
+ increaseWeight() {
|
|
|
+ this.form.weight = Number(this.form.weight) + 1;
|
|
|
+ },
|
|
|
+ // 验证重量输入
|
|
|
+ validateWeight() {
|
|
|
+ // 确保重量至少为1
|
|
|
+ if (!this.form.weight || Number(this.form.weight) < 1) {
|
|
|
+ this.form.weight = 1;
|
|
|
+ }
|
|
|
+ // 确保是整数
|
|
|
+ this.form.weight = Math.floor(Number(this.form.weight));
|
|
|
+ },
|
|
|
+ openRemarkModal() {
|
|
|
+ // 打开弹窗时,将当前备注内容赋值给临时变量
|
|
|
+ this.tempRemark = this.form.deliveryRemark;
|
|
|
+ this.showRemarkModal = true;
|
|
|
+ },
|
|
|
+ closeRemarkModal() {
|
|
|
+ this.showRemarkModal = false;
|
|
|
+ this.form.deliveryRemark = '';
|
|
|
+ this.tempRemark = '';
|
|
|
+ },
|
|
|
+ confirmRemark() {
|
|
|
+ // 更新备注
|
|
|
+ this.form.deliveryRemark = this.tempRemark;
|
|
|
+ // 关闭弹窗
|
|
|
+ this.showRemarkModal = false;
|
|
|
+ this.tempRemark = '';
|
|
|
+ },
|
|
|
+ handleLoadDelivery() {
|
|
|
+ // 校验重量是否填写
|
|
|
+ if (!this.form.weight || Number(this.form .weight) <= 0) {
|
|
|
+ this.$msg('请先填写货物重量');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 执行加载运力
|
|
|
+ this.getDeliveryQuotes();
|
|
|
+ },
|
|
|
+ // 清空运力列表
|
|
|
+ clearDeliveryList() {
|
|
|
+ this.deliveryQuotes = [];
|
|
|
+ this.selectedDeliveryIndex = -1;
|
|
|
+ this.selectedDeliveryData = null;
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
@@ -1637,4 +1786,166 @@ export default {
|
|
|
margin-top: 6upx;
|
|
|
}
|
|
|
}
|
|
|
+.weight-input-wrapper {
|
|
|
+ flex-shrink: 0;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+
|
|
|
+ .weight-control {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ border: 1upx solid #e0e0e0;
|
|
|
+ border-radius: 8upx;
|
|
|
+ overflow: hidden;
|
|
|
+ background-color: #f9f9f9;
|
|
|
+
|
|
|
+ .control-btn {
|
|
|
+ width: 60rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background-color: #f5f5f5;
|
|
|
+ color: #666666;
|
|
|
+ font-size: 36rpx;
|
|
|
+ font-weight: bold;
|
|
|
+ transition: all 0.2s;
|
|
|
+ user-select: none;
|
|
|
+
|
|
|
+ &:active {
|
|
|
+ background-color: #e0e0e0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.minus-btn {
|
|
|
+ border-right: 1rpx solid #e0e0e0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.plus-btn {
|
|
|
+ border-left: 1rpx solid #e0e0e0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ input {
|
|
|
+ flex: 1;
|
|
|
+ width: 100rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #333333;
|
|
|
+ border: none;
|
|
|
+ background-color: #ffffff;
|
|
|
+ text-align: center;
|
|
|
+ padding: 0 10rpx;
|
|
|
+
|
|
|
+ &::placeholder {
|
|
|
+ color: #999999;
|
|
|
+ font-size: 24rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .unit {
|
|
|
+ font-size: 28upx;
|
|
|
+ color: #666666;
|
|
|
+ margin-left: 20upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+}
|
|
|
+.remark-action {
|
|
|
+ color: #3385FF;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 28upx;
|
|
|
+ flex: 1;
|
|
|
+ justify-content: flex-end;
|
|
|
+
|
|
|
+ text {
|
|
|
+ color: #333333;
|
|
|
+ margin-right: 8upx;
|
|
|
+
|
|
|
+ &.placeholder {
|
|
|
+ color: #999999;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+/* 备注输入弹窗 */
|
|
|
+.remark-modal {
|
|
|
+ position: fixed;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background-color: rgba(0, 0, 0, 0.5);
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ z-index: 9999;
|
|
|
+
|
|
|
+ .modal-content {
|
|
|
+ width: 600upx;
|
|
|
+ background-color: white;
|
|
|
+ border-radius: 16upx;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+
|
|
|
+ .modal-header {
|
|
|
+ padding: 30upx 30upx 20upx;
|
|
|
+ border-bottom: 1upx solid #f0f0f0;
|
|
|
+
|
|
|
+ .modal-title {
|
|
|
+ font-size: 32upx;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #333333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .modal-body {
|
|
|
+ padding: 30upx;
|
|
|
+
|
|
|
+ .remark-textarea {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 200upx;
|
|
|
+ padding: 20upx;
|
|
|
+ font-size: 28upx;
|
|
|
+ color: #333333;
|
|
|
+ background-color: #f9f9f9;
|
|
|
+ border-radius: 8upx;
|
|
|
+ border: 1upx solid #e0e0e0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .char-count {
|
|
|
+ margin-top: 10upx;
|
|
|
+ font-size: 24upx;
|
|
|
+ color: #999999;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .modal-footer {
|
|
|
+ display: flex;
|
|
|
+ border-top: 1upx solid #f0f0f0;
|
|
|
+
|
|
|
+ .modal-btn {
|
|
|
+ flex: 1;
|
|
|
+ height: 90upx;
|
|
|
+ line-height: 90upx;
|
|
|
+ font-size: 30upx;
|
|
|
+ border: none;
|
|
|
+ background-color: transparent;
|
|
|
+ margin: 0;
|
|
|
+ padding: 0;
|
|
|
+
|
|
|
+ &.cancel-btn {
|
|
|
+ color: #666666;
|
|
|
+ border-right: 1upx solid #f0f0f0;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.confirm-btn {
|
|
|
+ color: #3385FF;
|
|
|
+ font-weight: 500;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|