From 5d6b2486d0e818b0348e42b7c8a15835800f341b Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 10 Nov 2026 15:52:28 +0800 Subject: [PATCH] 1 --- package1/address/addAddress.vue | 8 +++- package1/buyFood/buyFood.vue | 75 ++++++++++++++++++++++++++++--- package1/campus/campusRelease.vue | 18 +++++--- package1/post/postDetail.vue | 32 +++++++------ package1/tabbar/fishRelease.vue | 20 ++++++--- 5 files changed, 118 insertions(+), 35 deletions(-) diff --git a/package1/address/addAddress.vue b/package1/address/addAddress.vue index 31b99f3..e99736e 100644 --- a/package1/address/addAddress.vue +++ b/package1/address/addAddress.vue @@ -31,9 +31,9 @@ placeholder="所在楼层,仅限整数" placeholder-class="form-placeholder" /> - {{isSocialArea ? '门牌号' : '门牌号'}} + 门牌号 + @input="onRoomNumInput" :placeholder="useSocialText ? '例:3号楼2单元301室' : '例:5号楼203室'" placeholder-class="form-placeholder" /> 设为默认地址 @@ -116,6 +116,10 @@ const area = this.getCurrentArea(); return area && Number(area.areaKind) === 2; }, + useSocialText() { + const area = this.getCurrentArea(); + return this.isSocialArea && (!area || Number(area.campusTextEnabled) !== 1); + }, filteredAreaList() { const keyword = (this.areaSearchInput || '').toString(); if (!keyword) return this.areaList; diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue index 394a83a..b55aa35 100644 --- a/package1/buyFood/buyFood.vue +++ b/package1/buyFood/buyFood.vue @@ -348,7 +348,15 @@ - 如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐 + 选择“否”需预约用餐时间,系统会在用餐前30分钟提醒商家出餐 + + + + 用餐时间 + + + {{formData.deliveryTime || '选择时间 >'}} + @@ -445,7 +453,7 @@ 是否立即出餐 请选择是否需要商家立即出餐。 - 如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐 + 选择“否”后需要预约用餐时间,系统会在用餐前30分钟通知商家并打印小票 否 @@ -596,7 +604,7 @@ + :title="timePickerTitle"> > @@ -649,6 +657,7 @@ deliveryTime: '', peisongyuan: '' }, + timePickerScene: 'delivery', nowMake:null, pageToastText: '', pageToastTimer: null, @@ -777,6 +786,12 @@ shouldChooseNowMake() { return this.isPaotui == false && !this.isStoreGroupOrder; }, + needsPickupAppointment() { + return this.shouldChooseNowMake && this.nowMake === false; + }, + timePickerTitle() { + return this.timePickerScene === 'pickup' ? '选择用餐时间' : '选择送达时间'; + }, highFloorFeeCalc() { if (this.selected === 'shopDelivery') return 0; if (this.selected === 'zhiding' && this.assignedWorker) { @@ -1003,6 +1018,11 @@ methods: { checkNowMake(value){ this.nowMake = value; + if (value === true) { + this.formData.isImmediately = true; + return; + } + this.openPickupTimePicker(); }, openNowMakePopup() { this.$refs.nowMakePopup.open('center'); @@ -1011,9 +1031,19 @@ this.nowMake = value; this.$refs.nowMakePopup.close(); this.$nextTick(() => { - this.submitOrderToBackend(); + if (value === false) { + this.openPickupTimePicker(); + return; + } + this.submitPay(); }); }, + openPickupTimePicker() { + this.formData.isImmediately = false; + this.timePickerScene = 'pickup'; + this.generateDeliveryTimes(); + this.$refs.model.open(); + }, checkPack(type) { if (this.isPack === type) return; this.isPack = type; @@ -1334,6 +1364,13 @@ const duration = Number(this.deliveryDurationMinutes); return !isNaN(duration) && duration > 0 ? duration : 30; }, + getEffectiveAppointmentLeadMinutes() { + if (this.timePickerScene === 'pickup') { + const cookingTime = Number(this.shopItem.shopTakeaway && this.shopItem.shopTakeaway.cookingTime ? this.shopItem.shopTakeaway.cookingTime : 0); + return !isNaN(cookingTime) && cookingTime > 0 ? cookingTime : 30; + } + return this.getEffectiveDeliveryDurationMinutes(); + }, updateImmediateTimeStr() { const now = new Date(); const startTime = new Date(now); @@ -1529,6 +1566,14 @@ this.openNowMakePopup(); return; } + if (this.needsPickupAppointment && !this.formData.deliveryTime) { + uni.showToast({ + title: '请选择用餐时间', + icon: 'none' + }); + this.openPickupTimePicker(); + return; + } this.submitOrderToBackend(); }, goDetail() { @@ -1585,6 +1630,7 @@ }); }, checkTime(type) { + this.timePickerScene = 'delivery'; if (type === this.formData.isImmediately) { if (type === false) { this.generateDeliveryTimes() @@ -1726,7 +1772,10 @@ let [h, m] = timeStr.split(':'); let targetHour = parseInt(h); let d = new Date(); - if (targetHour < d.getHours()) d.setDate(d.getDate() + 1); + let targetMinute = parseInt(m); + if (targetHour < d.getHours() || (targetHour === d.getHours() && targetMinute <= d.getMinutes())) { + d.setDate(d.getDate() + 1); + } let yyyy = d.getFullYear(); let MM = String(d.getMonth() + 1).padStart(2, '0'); let DD = String(d.getDate()).padStart(2, '0'); @@ -1804,7 +1853,8 @@ }; let mft = this.getMustFinishTime(); - if (mft) payload.mustFinishTime = mft; + if (deliveryType === 1 && mft) payload.mustFinishTime = mft; + if (this.needsPickupAppointment && mft) payload.userRequireMakeTime = mft; payload.appointmentDelivery = deliveryType === 1 && this.formData.isImmediately === false ? 1 : 0; if (deliveryType === 1 && !isJoiningFaceToFace) { @@ -1992,7 +2042,7 @@ // ----- 生成今天的时间列表 ----- const earliestTime = new Date(now); - earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveDeliveryDurationMinutes()); + earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveAppointmentLeadMinutes()); const todayStartTime = this.getNextDeliverySlot(earliestTime); const todayEndTime = this.getAppointmentEndTime(today); @@ -2732,6 +2782,17 @@ font-weight: 800; } + .pickup-time-value { + color: $primary; + font-size: 26rpx; + font-weight: 800; + } + + .pickup-time-placeholder { + color: #8b9993; + font-weight: normal; + } + .pack-options { display: flex; align-items: center; diff --git a/package1/campus/campusRelease.vue b/package1/campus/campusRelease.vue index 119ce2e..857f37a 100644 --- a/package1/campus/campusRelease.vue +++ b/package1/campus/campusRelease.vue @@ -110,6 +110,7 @@ publishCampusPost, uploadCampusReleaseImage } from '@/common/campusApi.js' + import { resolveCampusTextEnabled, shouldUseSocialText } from '@/utils/areaTextMode.js' import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue' export default { @@ -147,25 +148,29 @@ contactPhone: '', anonymous: false }, - areaKind: 1 + areaKind: 1, + campusTextEnabled: 0 } }, computed: { isSocialArea() { return Number(this.areaKind) === 2 }, + useSocialText() { + return shouldUseSocialText(this.areaKind, this.campusTextEnabled) + }, pageTitle() { - if (this.isSocialArea) return this.isEdit ? '编辑同城圈' : '发布同城圈' + if (this.useSocialText) return this.isEdit ? '编辑同城圈' : '发布同城圈' return this.isEdit ? '编辑校园圈' : '发布校园圈' }, wallTabName() { - return this.isSocialArea ? '同城墙' : '校园墙' + return this.useSocialText ? '同城墙' : '校园墙' }, anonymousName() { - return this.isSocialArea ? '半径好友' : '半径同学' + return this.useSocialText ? '半径好友' : '半径同学' }, circleName() { - return this.isSocialArea ? '同城圈' : '校园圈' + return this.useSocialText ? '同城圈' : '校园圈' }, navHeight() { return this.statusBarTop + uni.upx2px(120) @@ -211,6 +216,7 @@ let area = areaObj || this.getArea() const kind = area ? Number(area.areaKind) : 1 this.areaKind = kind === 2 ? 2 : 1 + this.campusTextEnabled = resolveCampusTextEnabled(area) }, getArea() { const area = uni.getStorageSync('area') @@ -378,7 +384,7 @@ const profile = await getIeProfile().catch(() => null) const ok = await ensureIeVerifiedBeforeAction({ profile: profile || {}, - actionText: this.isSocialArea ? '发布同城圈内容' : '发布校园圈内容', + actionText: this.useSocialText ? '发布同城圈内容' : '发布校园圈内容', authDialog: { badge: this.circleName, title: '实名认证', desc: '发布、评论和聊天前需要完成实名认证' }, reload: getIeProfile, requireProfileSetup: false diff --git a/package1/post/postDetail.vue b/package1/post/postDetail.vue index c55f4f7..22ec382 100644 --- a/package1/post/postDetail.vue +++ b/package1/post/postDetail.vue @@ -117,6 +117,7 @@ import { getIeProfile } from '@/common/ieApi.js' import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js' import { buildHomeSharePath } from '@/utils/sharePath.js' + import { resolveCampusTextEnabled, shouldUseSocialText } from '@/utils/areaTextMode.js' import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue' export default { @@ -141,25 +142,29 @@ defaultShareImage: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png', likeLocked: false, imageSizeMap: {}, - areaKind: 1 + areaKind: 1, + campusTextEnabled: 0 } }, computed: { isSocialArea() { return Number(this.areaKind) === 2 }, + useSocialText() { + return shouldUseSocialText(this.areaKind, this.campusTextEnabled) + }, pageTitle() { if (this.post && this.post.postType === 'partner') return '搭子详情' - return this.isSocialArea ? '同城墙详情' : '校园墙详情' + return this.useSocialText ? '同城墙详情' : '校园墙详情' }, circleName() { - return this.isSocialArea ? '同城圈' : '校园圈' + return this.useSocialText ? '同城圈' : '校园圈' }, defaultUserName() { - return this.isSocialArea ? '半径好友' : '半径同学' + return this.useSocialText ? '半径好友' : '半径同学' }, defaultRegionName() { - return this.isSocialArea ? '本区域' : '本校' + return this.useSocialText ? '本区域' : '本校' }, navHeight() { return this.statusBarTop + uni.upx2px(104) }, imageList() { return this.post && this.post.imageList ? this.post.imageList : [] }, @@ -202,6 +207,7 @@ } const kind = area ? Number(area.areaKind) : 1 this.areaKind = kind === 2 ? 2 : 1 + this.campusTextEnabled = resolveCampusTextEnabled(area) }, loadDetail() { getCampusPostDetail(this.id).then(post => { @@ -293,11 +299,11 @@ const title = this.post && this.post.title ? this.post.title : (isPartner - ? (this.isSocialArea ? '同城搭子' : '校园搭子') - : (this.isSocialArea ? '同城圈内容' : '校园圈内容')) + ? (this.useSocialText ? '同城搭子' : '校园搭子') + : (this.useSocialText ? '同城圈内容' : '校园圈内容')) const prefix = isPartner - ? (this.isSocialArea ? '好友正在找搭子:' : '同学正在找搭子:') - : (this.isSocialArea ? '同城圈:' : '校园圈:') + ? (this.useSocialText ? '好友正在找搭子:' : '同学正在找搭子:') + : (this.useSocialText ? '同城圈:' : '校园圈:') const targetPath = `/package1/post/postDetail?id=${this.id || ''}&source=campus` return { title: prefix + title, @@ -316,7 +322,7 @@ }) }, async focusComment() { - const ok = await this.ensureVerified(this.isSocialArea ? '评论同城圈内容' : '评论校园圈内容') + const ok = await this.ensureVerified(this.useSocialText ? '评论同城圈内容' : '评论校园圈内容') if (!ok) return this.replyTarget = {} this.commentText = '' @@ -324,7 +330,7 @@ this.$refs.commentPopup.open() }, async replyComment(item) { - const ok = await this.ensureVerified(this.isSocialArea ? '评论同城圈内容' : '评论校园圈内容') + const ok = await this.ensureVerified(this.useSocialText ? '评论同城圈内容' : '评论校园圈内容') if (!ok) return this.replyTarget = item || {} this.commentText = '' @@ -343,7 +349,7 @@ uni.showToast({ title: '请输入评论内容', icon: 'none' }) return } - const ok = await this.ensureVerified(this.isSocialArea ? '评论同城圈内容' : '评论校园圈内容') + const ok = await this.ensureVerified(this.useSocialText ? '评论同城圈内容' : '评论校园圈内容') if (!ok) return this.commentSubmitting = true try { @@ -427,7 +433,7 @@ }, async goChat() { if (!this.canUsePartnerChat) return - const ok = await this.ensureVerified(this.isSocialArea ? '联系同城圈搭子' : '联系校园圈搭子') + const ok = await this.ensureVerified(this.useSocialText ? '联系同城圈搭子' : '联系校园圈搭子') if (!ok) return createCampusChatSession(this.id).then(session => { if (!session || !session.sessionId) return diff --git a/package1/tabbar/fishRelease.vue b/package1/tabbar/fishRelease.vue index bd0f9df..ba519c4 100644 --- a/package1/tabbar/fishRelease.vue +++ b/package1/tabbar/fishRelease.vue @@ -131,6 +131,7 @@ import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js' import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue' import SpEditor from '@/package1/components/sp-editor/components/sp-editor/sp-editor.vue' + import { resolveCampusTextEnabled, shouldUseSocialText } from '@/utils/areaTextMode.js' import { listFishCategories, getFishGoodsDetail, @@ -184,19 +185,23 @@ phone: '', tags: ['可小刀'] }, - areaKind: 1 + areaKind: 1, + campusTextEnabled: 0 } }, computed: { isSocialArea() { return Number(this.areaKind) === 2 }, + useSocialText() { + return shouldUseSocialText(this.areaKind, this.campusTextEnabled) + }, pageTitle() { - if (this.isSocialArea) return this.isEdit ? '编辑同城二手' : '发布同城二手' + if (this.useSocialText) return this.isEdit ? '编辑同城二手' : '发布同城二手' return this.isEdit ? '编辑校园二手' : '发布校园二手' }, fishBadgeText() { - return this.isSocialArea ? '同城二手' : '校园二手' + return this.useSocialText ? '同城二手' : '校园二手' }, categoryNames() { return this.categories.map(item => item.name) @@ -269,7 +274,8 @@ const area = areaObj || this.getArea() const kind = area ? Number(area.areaKind) : 1 this.areaKind = kind === 2 ? 2 : 1 - this.tagOptions = this.isSocialArea + this.campusTextEnabled = resolveCampusTextEnabled(area) + this.tagOptions = this.useSocialText ? ['可小刀', '当天可取', '门口自提', '可送上门', '急出', '九成新'] : ['可小刀', '当天可取', '宿舍自提', '可送宿舍', '急出', '九成新'] }, @@ -280,7 +286,7 @@ 门口自提: '宿舍自提', 可送上门: '可送宿舍' } - if (!this.isSocialArea) { + if (!this.useSocialText) { if (tag === '门口自提') return '宿舍自提' if (tag === '可送上门') return '可送宿舍' return tag @@ -379,7 +385,7 @@ const profile = await getIeProfile().catch(() => null) const verified = await ensureIeVerifiedBeforeAction({ profile: profile || {}, - actionText: this.isSocialArea ? '发布二手信息' : '发布校园二手信息', + actionText: this.useSocialText ? '发布二手信息' : '发布校园二手信息', authDialog: this.fishAuthDialogOptions(), reload: getIeProfile, requireProfileSetup: false @@ -562,7 +568,7 @@ const profile = await getIeProfile().catch(() => null) const verified = await ensureIeVerifiedBeforeAction({ profile: profile || {}, - actionText: this.isSocialArea ? '发布二手信息' : '发布校园二手信息', + actionText: this.useSocialText ? '发布二手信息' : '发布校园二手信息', authDialog: this.fishAuthDialogOptions(), reload: getIeProfile, requireProfileSetup: false