wangfukang 1 day ago
parent
commit
67cffc6903
  1. 60
      package1/buyFood/buyFood.vue
  2. 2
      package1/ieBrowser/index.vue
  3. 2
      package1/planet/pkHall.vue

60
package1/buyFood/buyFood.vue

@ -688,6 +688,10 @@
}else{
return this.goodsAmountCalc;
}
},
deliveryDurationMinutes() {
const value = Number(this.shopItem.groupDeliveryTime);
return isNaN(value) || value < 25 ? 30 : value;
}
},
watch: {},
@ -695,16 +699,7 @@
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
this.initAddress()
//this.fetchCoupons();
const now = new Date();
const startTime = new Date(now);
const endTime = new Date(now);
startTime.setMinutes(startTime.getMinutes() + 20);
endTime.setMinutes(endTime.getMinutes() + 35);
const startStr =
`${startTime.getHours().toString().padStart(2, '0')}:${startTime.getMinutes().toString().padStart(2, '0')}`;
const endStr =
`${endTime.getHours().toString().padStart(2, '0')}:${endTime.getMinutes().toString().padStart(2, '0')}`;
this.immediateTimeStr = `${startStr}-${endStr}`;
this.updateImmediateTimeStr();
uni.$on('updateDeliveryWorker', (worker) => {
this.assignedWorker = worker;
@ -797,6 +792,26 @@
normalizeCustomCommission() {
this.customCommission = this.formatCommissionValue(this.customCommission);
},
updateImmediateTimeStr() {
const now = new Date();
const startTime = new Date(now);
const endTime = new Date(now);
startTime.setMinutes(startTime.getMinutes() + 25);
endTime.setMinutes(endTime.getMinutes() + this.deliveryDurationMinutes);
this.immediateTimeStr = `${this.formatClockTime(startTime)}-${this.formatClockTime(endTime)}`;
},
formatClockTime(date) {
return `${date.getHours().toString().padStart(2, '0')}:${date.getMinutes().toString().padStart(2, '0')}`;
},
formatDateTimeValue(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
},
initAddress() {
let cachedAddress = uni.getStorageSync('selectedAddress');
if (cachedAddress) {
@ -1037,14 +1052,8 @@
if (!this.formData.deliveryTime || this.formData.deliveryTime === '自动送达' || this.formData.deliveryTime ===
'尽快送达'){
const now = new Date();
now.setMinutes(now.getMinutes() + 35);
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0');
const day = String(now.getDate()).padStart(2, '0');
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day}T${hours}:${minutes}:${seconds}`;
now.setMinutes(now.getMinutes() + this.deliveryDurationMinutes);
return this.formatDateTimeValue(now);
}else{
let timeStr = this.formData.deliveryTime;
if (timeStr.length === 5) {
@ -1236,15 +1245,14 @@
timestr: '自动送达'
}];
const currentHour = now.getHours();
const currentMinute = now.getMinutes();
const earliestTime = new Date(now);
earliestTime.setMinutes(earliestTime.getMinutes() + this.deliveryDurationMinutes);
//
let nextHour = currentHour;
let nextMinute = 30;
if (currentMinute >= 30) {
nextHour = currentHour + 1;
nextMinute = 0;
//
let nextHour = earliestTime.getHours();
let nextMinute = earliestTime.getMinutes() <= 30 ? 30 : 0;
if (earliestTime.getMinutes() > 30) {
nextHour += 1;
}
// 23:30

2
package1/ieBrowser/index.vue

@ -191,7 +191,7 @@
</view>
<view class="target-close" @tap="closeCompanionEditor">×</view>
</view>
<input class="target-input companion-input" v-model="editCompanionIntent" maxlength="24" :adjust-position="false"
<input class="target-input companion-input" v-model="editCompanionIntent" maxlength="30" :adjust-position="false"
placeholder="例如:想找散步搭子" @focus="onCompanionInputFocus" @blur="onCompanionInputBlur" />
<view class="companion-save" :class="{ disabled: savingCompanionIntent }" @tap="saveCompanionIntent">
{{ savingCompanionIntent ? '保存中...' : '发布一句' }}

2
package1/planet/pkHall.vue

@ -79,7 +79,7 @@
<view class="modal" v-if="showCreate">
<view class="modal-card">
<view class="modal-title">创建星球擂台</view>
<input class="field" v-model="form.roomName" 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.tickets" type="number" min="1" placeholder="入场券数量" @blur="normalizeTickets" />
<input class="field" v-model="form.password" placeholder="私密房密码,不填则公开" />

Loading…
Cancel
Save