wangfukang 1 day ago
parent
commit
f88438066b
  1. 16
      package1/address/addressList.vue
  2. 87
      package1/buyFood/buyFood.vue
  3. 71
      package1/index/deliveryPersonList.vue
  4. 25
      package1/order/orderDetail.vue
  5. 2
      package1/planet/pkHall.vue
  6. 34
      package1/runErrand/runErrand.vue

16
package1/address/addressList.vue

@ -109,6 +109,8 @@
addressList: [], addressList: [],
areaList: [], areaList: [],
areaTitleList: [], areaTitleList: [],
areaListLoaded: false,
areaListLoading: false,
areaTitleInput: '', areaTitleInput: '',
areaSearchInput: '', areaSearchInput: '',
addressForm: { addressForm: {
@ -125,7 +127,6 @@
}, },
created() { created() {
this.getAddressList(); this.getAddressList();
this.getAreaList();
}, },
computed: { computed: {
filteredAreaTitleList() { filteredAreaTitleList() {
@ -166,14 +167,20 @@
} }
}, },
getAreaList() { getAreaList() {
if (this.areaListLoaded || this.areaListLoading) return Promise.resolve(this.areaList);
this.areaListLoading = true;
let that = this; let that = this;
that.tui.request("/app/shopArea/getByParentId/"+JSON.parse(uni.getStorageSync('area')).id, "GET", {}, false, true).then((res) => { return that.tui.request("/app/shopArea/getByParentId/"+JSON.parse(uni.getStorageSync('area')).id, "GET", {}, false, true).then((res) => {
if (res.code == 200 && res.result) { if (res.code == 200 && res.result) {
that.$emit('shopAreaList',res.result) that.$emit('shopAreaList',res.result)
that.areaList = res.result; that.areaList = res.result;
that.areaTitleList = res.result.map(item => item.title); that.areaTitleList = res.result.map(item => item.title);
that.areaListLoaded = true;
} }
}).catch(() => {}); return that.areaList;
}).catch(() => {}).finally(() => {
that.areaListLoading = false;
});
}, },
selectAddress(item) { selectAddress(item) {
this.$emit('selectAddress', item); this.$emit('selectAddress', item);
@ -191,6 +198,7 @@
}; };
this.areaTitleInput = ''; this.areaTitleInput = '';
this.areaSearchInput = ''; this.areaSearchInput = '';
this.getAreaList();
this.$refs.addBookPopup.open('bottom'); this.$refs.addBookPopup.open('bottom');
}, },
openEdit(item) { openEdit(item) {
@ -204,6 +212,7 @@
receiverPhone: item.receiverPhone, receiverPhone: item.receiverPhone,
isDefault: item.isDefault || 0 isDefault: item.isDefault || 0
}; };
this.getAreaList();
let match = this.areaList.find(a => a.id === item.areaId); let match = this.areaList.find(a => a.id === item.areaId);
this.areaTitleInput = match ? match.title : (item.areaName || ''); this.areaTitleInput = match ? match.title : (item.areaName || '');
this.areaSearchInput = ''; this.areaSearchInput = '';
@ -211,6 +220,7 @@
}, },
openAreaPopup() { openAreaPopup() {
this.areaSearchInput = this.areaTitleInput; this.areaSearchInput = this.areaTitleInput;
this.getAreaList();
this.$refs.areaPopup.open(); this.$refs.areaPopup.open();
}, },
closeAreaPopup() { closeAreaPopup() {

87
package1/buyFood/buyFood.vue

@ -111,6 +111,18 @@
</view> </view>
</view> </view>
<view class="delivery-options"> <view class="delivery-options">
<view class="delivery-option" v-if="supportShopDelivery">
<view class="delivery-choice">
<view class="radio-check" v-if="selected === 'shopDelivery'">
<uni-icons type="checkmarkempty" size="12"></uni-icons>
</view>
<view class="radio-no-check" @tap="checkVoucher('shopDelivery')" v-else></view>
商家自配送
</view>
<view class="worker-entry" @tap.stop>
{{shopDeliveryText}}
</view>
</view>
<view class="delivery-option"> <view class="delivery-option">
<view class="delivery-choice"> <view class="delivery-choice">
<view class="radio-check" v-if="selected === 'buzhiding'"> <view class="radio-check" v-if="selected === 'buzhiding'">
@ -321,9 +333,9 @@
</view> </view>
</view> </view>
<!-- 地址簿弹出层 --> <!-- 地址簿弹出层 -->
<uni-popup ref="bookPopup" background-color="#fff"> <uni-popup ref="bookPopup" background-color="#fff" @change="onAddressPopupChange">
<view class="book-popup-content"> <view class="book-popup-content">
<address-list @selectAddress="handleSelectAddress" @syncAddress="handleSyncAddress" <address-list v-if="addressBookVisible" @selectAddress="handleSelectAddress" @syncAddress="handleSyncAddress"
@close="closeAddressBook"></address-list> @close="closeAddressBook"></address-list>
</view> </view>
</uni-popup> </uni-popup>
@ -560,6 +572,7 @@
isPaymentSuccessGroupInitiate: false, isPaymentSuccessGroupInitiate: false,
availableCoupons: [], availableCoupons: [],
selectedCoupon: null, selectedCoupon: null,
addressBookVisible: false,
freeOrderEffectVisible: false, freeOrderEffectVisible: false,
freeOrderAmount: '0.00' freeOrderAmount: '0.00'
} }
@ -605,6 +618,10 @@
this.isPack = 0; this.isPack = 0;
this.totalPackageFee = 0; this.totalPackageFee = 0;
} }
if (this.supportShopDelivery) {
this.selected = 'shopDelivery';
}
this.fetchCoupons();
}, },
computed: { computed: {
goodsAmountCalc() { goodsAmountCalc() {
@ -626,6 +643,7 @@
return this.orderScene === 'storeGroup' || (this.groupItem && this.groupItem.orderScene === 'storeGroup') || this.shopItem.merchantType == 2; return this.orderScene === 'storeGroup' || (this.groupItem && this.groupItem.orderScene === 'storeGroup') || this.shopItem.merchantType == 2;
}, },
highFloorFeeCalc() { highFloorFeeCalc() {
if (this.selected === 'shopDelivery') return 0;
if (this.selected === 'zhiding' && this.assignedWorker) { if (this.selected === 'zhiding' && this.assignedWorker) {
let hFee = parseFloat(this.assignedWorker.highFloorFee || 0); let hFee = parseFloat(this.assignedWorker.highFloorFee || 0);
if (hFee > 0 && this.formData.address && parseInt(this.formData.address.floor) > 3) { if (hFee > 0 && this.formData.address && parseInt(this.formData.address.floor) > 3) {
@ -655,7 +673,9 @@
if (isJoiningFaceToFace) if (isJoiningFaceToFace)
return 0; // Front-end doesn't know exact fee, relies on backend after order creation return 0; // Front-end doesn't know exact fee, relies on backend after order creation
let commission = 0; let commission = 0;
if (this.selected === 'zhiding') { if (this.selected === 'shopDelivery') {
commission = parseFloat(this.shopItem.orderBkge || 0);
} else if (this.selected === 'zhiding') {
if (!this.assignedWorker) return 0; if (!this.assignedWorker) return 0;
commission = parseFloat(this.assignedWorker.orderBkge || 3); commission = parseFloat(this.assignedWorker.orderBkge || 3);
} else { } else {
@ -690,20 +710,36 @@
} }
}, },
deliveryDurationMinutes() { deliveryDurationMinutes() {
if (this.selected === 'shopDelivery') {
const selfDeliveryDuration = Number(this.shopItem.shopDeliveryDuration);
const cookingTime = Number(this.shopItem.shopTakeaway && this.shopItem.shopTakeaway.cookingTime ? this.shopItem.shopTakeaway.cookingTime : 0);
const validCookingTime = isNaN(cookingTime) || cookingTime < 0 ? 0 : cookingTime;
return isNaN(selfDeliveryDuration) || selfDeliveryDuration <= 0 ? validCookingTime + 30 : validCookingTime + selfDeliveryDuration;
}
const value = Number(this.shopItem.groupDeliveryTime); const value = Number(this.shopItem.groupDeliveryTime);
return isNaN(value) || value < 25 ? 30 : value; return isNaN(value) || value < 25 ? 30 : value;
},
supportShopDelivery() {
return this.shopItem && this.shopItem.supportShopDelivery == 1 && this.shopItem.workerId;
},
shopDeliveryText() {
const fee = parseFloat(this.shopItem.orderBkge || 0);
const feeText = fee > 0 ? `¥${fee.toFixed(1)}` : '免配送费';
const locationText = this.shopItem.shopDeliveryLocation == 1 ? '送到宿舍' : '送到楼下';
const workerText = this.shopItem.workerName ? ` ${this.shopItem.workerName}` : '';
return `${feeText} ${locationText}${workerText}`;
} }
}, },
watch: {}, watch: {},
onShow() { onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.initAddress() this.initAddress()
//this.fetchCoupons();
this.updateImmediateTimeStr(); this.updateImmediateTimeStr();
uni.$on('updateDeliveryWorker', (worker) => { uni.$on('updateDeliveryWorker', (worker) => {
this.assignedWorker = worker; this.assignedWorker = worker;
this.selected = 'zhiding'; this.selected = 'zhiding';
this.refreshDeliveryTimeByModeChange();
}); });
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
@ -800,6 +836,13 @@
endTime.setMinutes(endTime.getMinutes() + this.deliveryDurationMinutes); endTime.setMinutes(endTime.getMinutes() + this.deliveryDurationMinutes);
this.immediateTimeStr = `${this.formatClockTime(startTime)}-${this.formatClockTime(endTime)}`; this.immediateTimeStr = `${this.formatClockTime(startTime)}-${this.formatClockTime(endTime)}`;
}, },
refreshDeliveryTimeByModeChange() {
this.updateImmediateTimeStr();
if (this.formData.isImmediately === false) {
this.formData.deliveryTime = '';
this.generateDeliveryTimes();
}
},
formatClockTime(date) { formatClockTime(date) {
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`; return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
}, },
@ -834,12 +877,19 @@
this.formData.address = address; this.formData.address = address;
uni.setStorageSync('selectedAddress', address); uni.setStorageSync('selectedAddress', address);
this.$refs.bookPopup.close(); this.$refs.bookPopup.close();
this.addressBookVisible = false;
}, },
handleSyncAddress(address) { handleSyncAddress(address) {
this.formData.address = address; this.formData.address = address;
}, },
closeAddressBook() { closeAddressBook() {
this.$refs.bookPopup.close(); this.$refs.bookPopup.close();
this.addressBookVisible = false;
},
onAddressPopupChange(e) {
if (!e.show) {
this.addressBookVisible = false;
}
}, },
getSpecDisplayString(specs) { getSpecDisplayString(specs) {
if (!specs) return ''; if (!specs) return '';
@ -878,6 +928,13 @@
this.$refs.warnPopup.open(); this.$refs.warnPopup.open();
return; return;
} }
if (this.isPaotui && this.selected === 'shopDelivery' && !this.supportShopDelivery && !isJoiningFaceToFace) {
uni.showToast({
title: '商家自配送配置不完整',
icon: 'none'
})
return;
}
this.submitOrderToBackend(); this.submitOrderToBackend();
}, },
goDetail() { goDetail() {
@ -923,7 +980,10 @@
this.$refs.couponPopup.close(); this.$refs.couponPopup.close();
}, },
openAddressBook() { openAddressBook() {
this.addressBookVisible = true;
this.$nextTick(() => {
this.$refs.bookPopup.open('bottom') this.$refs.bookPopup.open('bottom')
});
}, },
checkTime(type) { checkTime(type) {
if (type === this.formData.isImmediately) { if (type === this.formData.isImmediately) {
@ -945,7 +1005,11 @@
if (this.selected == 'buzhiding') { if (this.selected == 'buzhiding') {
this.formData.peisongyuan = ""; this.formData.peisongyuan = "";
this.assignedWorker = null; this.assignedWorker = null;
} else if (this.selected == 'shopDelivery') {
this.formData.peisongyuan = "";
this.assignedWorker = null;
} }
this.refreshDeliveryTimeByModeChange();
}, },
wxPayment() { wxPayment() {
let that = this; let that = this;
@ -1154,14 +1218,24 @@
payload.groupParam = { payload.groupParam = {
targetMembers: parseInt(this.groupItem.groupRule.groupCount), targetMembers: parseInt(this.groupItem.groupRule.groupCount),
isFaceToFace: this.groupItem.isFaceToFace ? 1 : 0, isFaceToFace: this.groupItem.isFaceToFace ? 1 : 0,
selfCommission: this.selected === 'buzhiding' ? parseFloat(this.customCommission || 0) : selfCommission: this.selected === 'shopDelivery' ? parseFloat(this.shopItem.orderBkge || 0) : (this.selected === 'buzhiding' ? parseFloat(this.customCommission || 0) :
null null
)
}; };
} }
} }
if (this.isPaotui && !isJoiningFaceToFace) { if (this.isPaotui && !isJoiningFaceToFace) {
if (this.selected === 'zhiding' && this.assignedWorker) { if (this.selected === 'shopDelivery') {
payload.shopDelivery = 1;
payload.workerParam = {
workerId: this.shopItem.workerId,
workerPhone: this.shopItem.workerPhone,
workerName: this.shopItem.workerName,
orderBkge: parseFloat(this.shopItem.orderBkge || 0)
};
} else if (this.selected === 'zhiding' && this.assignedWorker) {
payload.shopDelivery = 0;
payload.workerParam = { payload.workerParam = {
workerId: this.assignedWorker.workerId, workerId: this.assignedWorker.workerId,
workerPhone: this.assignedWorker.mobile, workerPhone: this.assignedWorker.mobile,
@ -1169,6 +1243,7 @@
orderBkge: parseFloat(this.assignedWorker.orderBkge || 0) + this.highFloorFeeCalc orderBkge: parseFloat(this.assignedWorker.orderBkge || 0) + this.highFloorFeeCalc
}; };
} else if (this.selected === 'buzhiding') { } else if (this.selected === 'buzhiding') {
payload.shopDelivery = 0;
payload.workerParam = { payload.workerParam = {
orderBkge: parseFloat(this.customCommission || 0) orderBkge: parseFloat(this.customCommission || 0)
}; };

71
package1/index/deliveryPersonList.vue

@ -51,7 +51,7 @@
alt="" style="width: 140rpx;height: 32rpx;margin-top: 18rpx;" alt="" style="width: 140rpx;height: 32rpx;margin-top: 18rpx;"
v-if="worker.rebateAmount > 0" /> v-if="worker.rebateAmount > 0" />
</view> </view>
<view class="shop-menu-purchase man-name"> <view class="worker-price">
¥{{worker.orderBkge}} ¥{{worker.orderBkge}}
</view> </view>
</view> </view>
@ -83,10 +83,13 @@
</view> </view>
</view> </view>
<view class="man-mank"> <view class="man-mank">
<view style="flex: 1;"> <view class="worker-remark">
备注:<text style="color: #000;">{{worker.remark || '无'}}</text> 备注:<text style="color: #000;">{{worker.remark || '无'}}</text>
</view> </view>
<view class="" @tap.stop="getLoca(worker)"> <view class="delivery-location">
{{formatDeliveryLocation(worker.deliveryLocation)}}
</view>
<view class="location-btn" @tap.stop="getLoca(worker)">
查看位置 查看位置
</view> </view>
</view> </view>
@ -187,6 +190,9 @@
this.latitude = this.markers[0].latitude this.latitude = this.markers[0].latitude
this.longitude = this.markers[0].longitude this.longitude = this.markers[0].longitude
}, },
formatDeliveryLocation(value) {
return value == 1 ? '送到宿舍门口' : '送上楼'
},
getShopList() { getShopList() {
this.loadStatus = 'loading'; this.loadStatus = 'loading';
// Fake request to our new endpoint // Fake request to our new endpoint
@ -398,6 +404,7 @@
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
padding-right: 20rpx; padding-right: 20rpx;
align-items: center;
} }
.man-name { .man-name {
@ -450,21 +457,61 @@
} }
.man-mank { .man-mank {
line-height: 40rpx; line-height: 44rpx;
color: #777; color: #777;
font-weight: 700; font-weight: 700;
display: flex; display: flex;
align-items: center;
} }
.shop-menu-purchase { .worker-remark {
display: flex; flex: 1;
background: rgba(255, 57, 57, 0.1); min-width: 0;
height: 36rpx; overflow: hidden;
line-height: 36rpx; text-overflow: ellipsis;
padding: 0 0 0 4rpx; white-space: nowrap;
border-radius: 8rpx; }
.delivery-location {
height: 44rpx;
line-height: 44rpx;
padding: 0 18rpx;
margin-right: 20rpx;
border-radius: 10rpx;
background: rgba(166, 255, 234, 0.22);
border: 1rpx solid rgba(166, 255, 234, 1);
color: #00231C;
font-size: 22rpx;
font-weight: 700; font-weight: 700;
margin-top: 10rpx; white-space: nowrap;
}
.location-btn {
height: 44rpx;
line-height: 44rpx;
padding: 0 18rpx;
border-radius: 10rpx;
background: rgba(247, 248, 248, 0.9);
border: 1rpx solid #E7E7E7;
color: #777; color: #777;
font-size: 22rpx;
white-space: nowrap;
}
.worker-price {
display: flex;
align-items: center;
justify-content: center;
min-width: 118rpx;
height: 58rpx;
line-height: 58rpx;
padding: 0 18rpx;
border-radius: 12rpx;
background: linear-gradient(90deg, rgba(227, 255, 150, 0.55), rgba(166, 255, 234, 0.55));
border: 2rpx solid rgba(166, 255, 234, 1);
font-weight: 700;
font-size: 32rpx;
color: #00231C;
box-shadow: 0 4rpx 12rpx rgba(0, 35, 28, 0.08);
} }
</style> </style>

25
package1/order/orderDetail.vue

@ -132,8 +132,8 @@
<view class="status-text"> <view class="status-text">
<view class="status-zhu"> <view class="status-zhu">
<text v-if="orderDetail.status == 0">待支付</text> <text v-if="orderDetail.status == 0">待支付</text>
<text v-if="orderDetail.status == 2">等待配送员接单</text> <text v-if="orderDetail.status == 2">{{orderDetail.shopDelivery == 1 ? '等待商家配送接单' : '等待配送员接单'}}</text>
<text v-if="orderDetail.status == 3 && orderDetail.deliveryType == 1">配送员已接单</text> <text v-if="orderDetail.status == 3 && orderDetail.deliveryType == 1">{{orderDetail.shopDelivery == 1 ? '商家配送已接单' : '配送员已接单'}}</text>
<text v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2">待消费</text> <text v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2">待消费</text>
<text v-if="orderDetail.status == 4 && orderDetail.deliveryType == 1">配送员已取货</text> <text v-if="orderDetail.status == 4 && orderDetail.deliveryType == 1">配送员已取货</text>
<text v-if="orderDetail.status == 5">订单已完成</text> <text v-if="orderDetail.status == 5">订单已完成</text>
@ -207,10 +207,10 @@
@tap="makeMeal" style="background: rgba(0, 35, 28, 1);color:rgba(166, 255, 234, 1);"> @tap="makeMeal" style="background: rgba(0, 35, 28, 1);color:rgba(166, 255, 234, 1);">
立即备餐 立即备餐
</view> </view>
<view class="btn" style="width: 40%;" v-if="orderDetail.status == 2" @tap="openAddFeePopup"> <view class="btn" style="width: 40%;" v-if="orderDetail.status == 2 && orderDetail.shopDelivery != 1" @tap="openAddFeePopup">
增加配送佣金 增加配送佣金
</view> </view>
<view class="btn" style="width: 40%;" v-if="orderDetail.status == 2" @tap="goAssignWorker"> <view class="btn" style="width: 40%;" v-if="orderDetail.status == 2 && orderDetail.shopDelivery != 1" @tap="goAssignWorker">
改派配送员 改派配送员
</view> </view>
<!-- <view class="btn"> <!-- <view class="btn">
@ -446,7 +446,7 @@
<view style="height: 80rpx;line-height: 80rpx;display: flex;" <view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1"> v-if="orderDetail.deliveryType == 1">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="flex: 1;color: #777;font-weight: 700;">
配送员 {{orderDetail.shopDelivery == 1 ? '商家配送员' : '配送员'}}
</view> </view>
<view style="color: #000;font-weight: 700;display: flex;" <view style="color: #000;font-weight: 700;display: flex;"
v-if="orderDetail.deliveryInfo && orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''"> v-if="orderDetail.deliveryInfo && orderDetail.deliveryInfo.workerId != null && orderDetail.deliveryInfo.workerId != ''">
@ -459,10 +459,19 @@
未指定等待接单中 未指定等待接单中
</view> </view>
</view> </view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1 && orderDetail.shopDelivery == 1">
<view style="flex: 1;color: #777;font-weight: 700;">
配送方式
</view>
<view style="color: #ff6f2c;font-weight: 700;">
商家自配送
</view>
</view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" <view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId"> v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="flex: 1;color: #777;font-weight: 700;">
配送员接单时间 {{orderDetail.shopDelivery == 1 ? '商家配送接单时间' : '配送员接单时间'}}
</view> </view>
<view style="color: #000;font-weight: 700;"> <view style="color: #000;font-weight: 700;">
{{orderDetail.deliveryInfo.acceptTime | formatTime}} {{orderDetail.deliveryInfo.acceptTime | formatTime}}
@ -481,7 +490,7 @@
<view style="height: 80rpx;line-height: 80rpx;display: flex;" <view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != '' && orderDetail.otherOrder == null"> v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != '' && orderDetail.otherOrder == null">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="flex: 1;color: #777;font-weight: 700;">
配送员到店时间 {{orderDetail.shopDelivery == 1 ? '商家到店时间' : '配送员到店时间'}}
</view> </view>
<view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo"> <view style="color: #000;font-weight: 700;" v-if="orderDetail.deliveryInfo">
{{orderDetail.deliveryInfo.arriveTime ? orderDetail.deliveryInfo.arriveTime : '' | formatTime}} {{orderDetail.deliveryInfo.arriveTime ? orderDetail.deliveryInfo.arriveTime : '' | formatTime}}
@ -490,7 +499,7 @@
<view style="height: 80rpx;line-height: 80rpx;display: flex;" <view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''"> v-if="orderDetail.deliveryInfo && orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.workerId != ''">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="flex: 1;color: #777;font-weight: 700;">
配送员取货时间 {{orderDetail.shopDelivery == 1 ? '商家取货时间' : '配送员取货时间'}}
</view> </view>
<view style="color: #000;font-weight: 700;"> <view style="color: #000;font-weight: 700;">
{{orderDetail.deliveryInfo.getTime ? orderDetail.deliveryInfo.getTime : '' | formatTime}} {{orderDetail.deliveryInfo.getTime ? orderDetail.deliveryInfo.getTime : '' | formatTime}}

2
package1/planet/pkHall.vue

@ -80,7 +80,7 @@
<view class="modal-card"> <view class="modal-card">
<view class="modal-title">创建星球擂台</view> <view class="modal-title">创建星球擂台</view>
<input class="field" v-model="form.roomName" maxlength="20" placeholder="房间名称" /> <input class="field" v-model="form.roomName" maxlength="20" placeholder="房间名称" />
<input class="field" v-model.number="form.maxPlayers" type="number" placeholder="人数 2-5" /> <input class="field" v-model.number="form.maxPlayers" type="number" min="2" max="8" placeholder="人数 2-8" />
<input class="field" v-model.number="form.tickets" type="number" min="1" placeholder="入场券数量" @blur="normalizeTickets" /> <input class="field" v-model.number="form.tickets" type="number" min="1" placeholder="入场券数量" @blur="normalizeTickets" />
<input class="field" v-model="form.password" placeholder="私密房密码,不填则公开" /> <input class="field" v-model="form.password" placeholder="私密房密码,不填则公开" />
<view class="modal-actions"> <view class="modal-actions">

34
package1/runErrand/runErrand.vue

@ -252,7 +252,8 @@
<!-- 收货/取货地址簿弹出层 --> <!-- 收货/取货地址簿弹出层 -->
<uni-popup ref="bookPopup" background-color="#fff" @change="onBookPopupChange"> <uni-popup ref="bookPopup" background-color="#fff" @change="onBookPopupChange">
<view class="book-popup-content"> <view class="book-popup-content">
<address-list @selectAddress="handleSelectAddress" @syncAddress="handleSyncAddress" @shopAreaList="updateArea" @close="$refs.bookPopup.close()"></address-list> <address-list v-if="addressBookVisible" @selectAddress="handleSelectAddress"
@syncAddress="handleSyncAddress" @shopAreaList="updateArea" @close="closeAddressBook"></address-list>
</view> </view>
</uni-popup> </uni-popup>
@ -387,9 +388,12 @@
commissionInputValue: '', commissionInputValue: '',
shopArea: [], shopArea: [],
kuaidiAreaList: [], kuaidiAreaList: [],
shopAreaLoaded: false,
shopAreaLoading: false,
selectedPickupArea: null, selectedPickupArea: null,
addressSelectMode: 'put', // 'put' | 'get' addressSelectMode: 'put', // 'put' | 'get'
isBookPopupOpen: false, isBookPopupOpen: false,
addressBookVisible: false,
formData: { formData: {
address: null, // putArea address: null, // putArea
pickupAddress: null, // getArea () pickupAddress: null, // getArea ()
@ -539,20 +543,29 @@
this.$refs.couponPopup.close(); this.$refs.couponPopup.close();
}, },
getShopArea(){ getShopArea(){
if (this.shopAreaLoaded || this.shopAreaLoading) return Promise.resolve(this.shopArea);
this.shopAreaLoading = true;
let that = this let that = this
let areaStorage = uni.getStorageSync('area'); let areaStorage = uni.getStorageSync('area');
if(!areaStorage) return; if(!areaStorage) {
that.tui.request("/app/shopArea/getByParentId/"+JSON.parse(areaStorage).id, "GET", {}, false, true).then((res) => { this.shopAreaLoading = false;
return Promise.resolve([]);
}
return that.tui.request("/app/shopArea/getByParentId/"+JSON.parse(areaStorage).id, "GET", {}, false, true).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if(res.result != null){ if(res.result != null){
that.shopArea = res.result; that.shopArea = res.result;
that.kuaidiAreaList = that.shopArea.filter(item => item.isCanteen === 2); that.kuaidiAreaList = that.shopArea.filter(item => item.isCanteen === 2);
that.shopAreaLoaded = true;
} }
} else { } else {
that.tui.toast(res.message) that.tui.toast(res.message)
return return
} }
}).catch((res) => {}) return that.shopArea;
}).catch((res) => {}).finally(() => {
that.shopAreaLoading = false;
})
}, },
initAddress() { initAddress() {
let cachedAddress = uni.getStorageSync('selectedAddress'); let cachedAddress = uni.getStorageSync('selectedAddress');
@ -576,10 +589,21 @@
openAddressBook(mode) { openAddressBook(mode) {
this.addressSelectMode = mode; this.addressSelectMode = mode;
this.isBookPopupOpen = true; this.isBookPopupOpen = true;
this.addressBookVisible = true;
this.$nextTick(() => {
this.$refs.bookPopup.open('bottom'); this.$refs.bookPopup.open('bottom');
});
}, },
onBookPopupChange(e) { onBookPopupChange(e) {
this.isBookPopupOpen = !!e.show; this.isBookPopupOpen = !!e.show;
if (!e.show) {
this.addressBookVisible = false;
}
},
closeAddressBook() {
this.isBookPopupOpen = false;
this.addressBookVisible = false;
this.$refs.bookPopup.close();
}, },
handleSelectAddress(address) { handleSelectAddress(address) {
if (this.addressSelectMode === 'put') { if (this.addressSelectMode === 'put') {
@ -589,6 +613,7 @@
this.formData.pickupAddress = address; this.formData.pickupAddress = address;
} }
this.isBookPopupOpen = false; this.isBookPopupOpen = false;
this.addressBookVisible = false;
this.$refs.bookPopup.close(); this.$refs.bookPopup.close();
}, },
updateArea(v){ updateArea(v){
@ -601,6 +626,7 @@
} }
}, },
openKuaidiPicker() { openKuaidiPicker() {
this.getShopArea();
this.$refs.kuaidiPickerPopup.open(); this.$refs.kuaidiPickerPopup.open();
}, },
selectKuaidiArea(item) { selectKuaidiArea(item) {

Loading…
Cancel
Save