wangfukang 2 days ago
parent
commit
5d6b2486d0
  1. 8
      package1/address/addAddress.vue
  2. 75
      package1/buyFood/buyFood.vue
  3. 18
      package1/campus/campusRelease.vue
  4. 32
      package1/post/postDetail.vue
  5. 20
      package1/tabbar/fishRelease.vue

8
package1/address/addAddress.vue

@ -31,9 +31,9 @@
placeholder="所在楼层,仅限整数" placeholder-class="form-placeholder" /> placeholder="所在楼层,仅限整数" placeholder-class="form-placeholder" />
</view> </view>
<view class="form-row"> <view class="form-row">
<text class="form-label">{{isSocialArea ? '门牌号' : '门牌号'}}</text> <text class="form-label">门牌号</text>
<input class="form-input" type="text" maxlength="30" v-model="addressForm.roomNum" <input class="form-input" type="text" maxlength="30" v-model="addressForm.roomNum"
@input="onRoomNumInput" :placeholder="isSocialArea ? '例:3号楼2单元301室' : '例:5号楼203室'" placeholder-class="form-placeholder" /> @input="onRoomNumInput" :placeholder="useSocialText ? '例:3号楼2单元301室' : '例:5号楼203室'" placeholder-class="form-placeholder" />
</view> </view>
<view class="form-row form-row--switch"> <view class="form-row form-row--switch">
<text class="form-label">设为默认地址</text> <text class="form-label">设为默认地址</text>
@ -116,6 +116,10 @@
const area = this.getCurrentArea(); const area = this.getCurrentArea();
return area && Number(area.areaKind) === 2; return area && Number(area.areaKind) === 2;
}, },
useSocialText() {
const area = this.getCurrentArea();
return this.isSocialArea && (!area || Number(area.campusTextEnabled) !== 1);
},
filteredAreaList() { filteredAreaList() {
const keyword = (this.areaSearchInput || '').toString(); const keyword = (this.areaSearchInput || '').toString();
if (!keyword) return this.areaList; if (!keyword) return this.areaList;

75
package1/buyFood/buyFood.vue

@ -348,7 +348,15 @@
</view> </view>
</view> </view>
<view class="now-make-inline-tip" v-if="isPaotui ==false && !isStoreGroupOrder"> <view class="now-make-inline-tip" v-if="isPaotui ==false && !isStoreGroupOrder">
如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐 选择“否”需预约用餐时间,系统会在用餐前30分钟提醒商家出餐
</view>
<view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder && nowMake === false" @tap="openPickupTimePicker">
<view class="fee-label">
用餐时间
</view>
<view class="pickup-time-value" :class="{'pickup-time-placeholder': !formData.deliveryTime}">
{{formData.deliveryTime || '选择时间 >'}}
</view>
</view> </view>
<view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder"> <view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder">
<view class="fee-label"> <view class="fee-label">
@ -445,7 +453,7 @@
<view class="now-make-popup-title">是否立即出餐</view> <view class="now-make-popup-title">是否立即出餐</view>
<view class="now-make-popup-desc">请选择是否需要商家立即出餐。</view> <view class="now-make-popup-desc">请选择是否需要商家立即出餐。</view>
<view class="now-make-popup-tip"> <view class="now-make-popup-tip">
如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐 选择“否”后需要预约用餐时间,系统会在用餐前30分钟通知商家并打印小票
</view> </view>
<view class="now-make-popup-actions"> <view class="now-make-popup-actions">
<view class="now-make-popup-cancel" @tap="confirmNowMake(false)">否</view> <view class="now-make-popup-cancel" @tap="confirmNowMake(false)">否</view>
@ -596,7 +604,7 @@
</view> </view>
</uni-popup> </uni-popup>
<delivery-time-op @timeCallback="timeCallback" :dodge="false" ref='model' :content="content" :barHidth='600' <delivery-time-op @timeCallback="timeCallback" :dodge="false" ref='model' :content="content" :barHidth='600'
title="选择送达时间"> :title="timePickerTitle">
> </delivery-time-op> > </delivery-time-op>
<view class="free-order-mask" v-if="freeOrderEffectVisible" @tap.stop="closeFreeOrderEffect"> <view class="free-order-mask" v-if="freeOrderEffectVisible" @tap.stop="closeFreeOrderEffect">
<view class="free-order-card" @tap.stop> <view class="free-order-card" @tap.stop>
@ -649,6 +657,7 @@
deliveryTime: '', deliveryTime: '',
peisongyuan: '' peisongyuan: ''
}, },
timePickerScene: 'delivery',
nowMake:null, nowMake:null,
pageToastText: '', pageToastText: '',
pageToastTimer: null, pageToastTimer: null,
@ -777,6 +786,12 @@
shouldChooseNowMake() { shouldChooseNowMake() {
return this.isPaotui == false && !this.isStoreGroupOrder; return this.isPaotui == false && !this.isStoreGroupOrder;
}, },
needsPickupAppointment() {
return this.shouldChooseNowMake && this.nowMake === false;
},
timePickerTitle() {
return this.timePickerScene === 'pickup' ? '选择用餐时间' : '选择送达时间';
},
highFloorFeeCalc() { highFloorFeeCalc() {
if (this.selected === 'shopDelivery') return 0; if (this.selected === 'shopDelivery') return 0;
if (this.selected === 'zhiding' && this.assignedWorker) { if (this.selected === 'zhiding' && this.assignedWorker) {
@ -1003,6 +1018,11 @@
methods: { methods: {
checkNowMake(value){ checkNowMake(value){
this.nowMake = value; this.nowMake = value;
if (value === true) {
this.formData.isImmediately = true;
return;
}
this.openPickupTimePicker();
}, },
openNowMakePopup() { openNowMakePopup() {
this.$refs.nowMakePopup.open('center'); this.$refs.nowMakePopup.open('center');
@ -1011,9 +1031,19 @@
this.nowMake = value; this.nowMake = value;
this.$refs.nowMakePopup.close(); this.$refs.nowMakePopup.close();
this.$nextTick(() => { 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) { checkPack(type) {
if (this.isPack === type) return; if (this.isPack === type) return;
this.isPack = type; this.isPack = type;
@ -1334,6 +1364,13 @@
const duration = Number(this.deliveryDurationMinutes); const duration = Number(this.deliveryDurationMinutes);
return !isNaN(duration) && duration > 0 ? duration : 30; 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() { updateImmediateTimeStr() {
const now = new Date(); const now = new Date();
const startTime = new Date(now); const startTime = new Date(now);
@ -1529,6 +1566,14 @@
this.openNowMakePopup(); this.openNowMakePopup();
return; return;
} }
if (this.needsPickupAppointment && !this.formData.deliveryTime) {
uni.showToast({
title: '请选择用餐时间',
icon: 'none'
});
this.openPickupTimePicker();
return;
}
this.submitOrderToBackend(); this.submitOrderToBackend();
}, },
goDetail() { goDetail() {
@ -1585,6 +1630,7 @@
}); });
}, },
checkTime(type) { checkTime(type) {
this.timePickerScene = 'delivery';
if (type === this.formData.isImmediately) { if (type === this.formData.isImmediately) {
if (type === false) { if (type === false) {
this.generateDeliveryTimes() this.generateDeliveryTimes()
@ -1726,7 +1772,10 @@
let [h, m] = timeStr.split(':'); let [h, m] = timeStr.split(':');
let targetHour = parseInt(h); let targetHour = parseInt(h);
let d = new Date(); 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 yyyy = d.getFullYear();
let MM = String(d.getMonth() + 1).padStart(2, '0'); let MM = String(d.getMonth() + 1).padStart(2, '0');
let DD = String(d.getDate()).padStart(2, '0'); let DD = String(d.getDate()).padStart(2, '0');
@ -1804,7 +1853,8 @@
}; };
let mft = this.getMustFinishTime(); 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; payload.appointmentDelivery = deliveryType === 1 && this.formData.isImmediately === false ? 1 : 0;
if (deliveryType === 1 && !isJoiningFaceToFace) { if (deliveryType === 1 && !isJoiningFaceToFace) {
@ -1992,7 +2042,7 @@
// ----- 生成今天的时间列表 ----- // ----- 生成今天的时间列表 -----
const earliestTime = new Date(now); const earliestTime = new Date(now);
earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveDeliveryDurationMinutes()); earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveAppointmentLeadMinutes());
const todayStartTime = this.getNextDeliverySlot(earliestTime); const todayStartTime = this.getNextDeliverySlot(earliestTime);
const todayEndTime = this.getAppointmentEndTime(today); const todayEndTime = this.getAppointmentEndTime(today);
@ -2732,6 +2782,17 @@
font-weight: 800; font-weight: 800;
} }
.pickup-time-value {
color: $primary;
font-size: 26rpx;
font-weight: 800;
}
.pickup-time-placeholder {
color: #8b9993;
font-weight: normal;
}
.pack-options { .pack-options {
display: flex; display: flex;
align-items: center; align-items: center;

18
package1/campus/campusRelease.vue

@ -110,6 +110,7 @@
publishCampusPost, publishCampusPost,
uploadCampusReleaseImage uploadCampusReleaseImage
} from '@/common/campusApi.js' } from '@/common/campusApi.js'
import { resolveCampusTextEnabled, shouldUseSocialText } from '@/utils/areaTextMode.js'
import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue' import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue'
export default { export default {
@ -147,25 +148,29 @@
contactPhone: '', contactPhone: '',
anonymous: false anonymous: false
}, },
areaKind: 1 areaKind: 1,
campusTextEnabled: 0
} }
}, },
computed: { computed: {
isSocialArea() { isSocialArea() {
return Number(this.areaKind) === 2 return Number(this.areaKind) === 2
}, },
useSocialText() {
return shouldUseSocialText(this.areaKind, this.campusTextEnabled)
},
pageTitle() { pageTitle() {
if (this.isSocialArea) return this.isEdit ? '编辑同城圈' : '发布同城圈' if (this.useSocialText) return this.isEdit ? '编辑同城圈' : '发布同城圈'
return this.isEdit ? '编辑校园圈' : '发布校园圈' return this.isEdit ? '编辑校园圈' : '发布校园圈'
}, },
wallTabName() { wallTabName() {
return this.isSocialArea ? '同城墙' : '校园墙' return this.useSocialText ? '同城墙' : '校园墙'
}, },
anonymousName() { anonymousName() {
return this.isSocialArea ? '半径好友' : '半径同学' return this.useSocialText ? '半径好友' : '半径同学'
}, },
circleName() { circleName() {
return this.isSocialArea ? '同城圈' : '校园圈' return this.useSocialText ? '同城圈' : '校园圈'
}, },
navHeight() { navHeight() {
return this.statusBarTop + uni.upx2px(120) return this.statusBarTop + uni.upx2px(120)
@ -211,6 +216,7 @@
let area = areaObj || this.getArea() let area = areaObj || this.getArea()
const kind = area ? Number(area.areaKind) : 1 const kind = area ? Number(area.areaKind) : 1
this.areaKind = kind === 2 ? 2 : 1 this.areaKind = kind === 2 ? 2 : 1
this.campusTextEnabled = resolveCampusTextEnabled(area)
}, },
getArea() { getArea() {
const area = uni.getStorageSync('area') const area = uni.getStorageSync('area')
@ -378,7 +384,7 @@
const profile = await getIeProfile().catch(() => null) const profile = await getIeProfile().catch(() => null)
const ok = await ensureIeVerifiedBeforeAction({ const ok = await ensureIeVerifiedBeforeAction({
profile: profile || {}, profile: profile || {},
actionText: this.isSocialArea ? '发布同城圈内容' : '发布校园圈内容', actionText: this.useSocialText ? '发布同城圈内容' : '发布校园圈内容',
authDialog: { badge: this.circleName, title: '实名认证', desc: '发布、评论和聊天前需要完成实名认证' }, authDialog: { badge: this.circleName, title: '实名认证', desc: '发布、评论和聊天前需要完成实名认证' },
reload: getIeProfile, reload: getIeProfile,
requireProfileSetup: false requireProfileSetup: false

32
package1/post/postDetail.vue

@ -117,6 +117,7 @@
import { getIeProfile } from '@/common/ieApi.js' import { getIeProfile } from '@/common/ieApi.js'
import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js' import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js'
import { buildHomeSharePath } from '@/utils/sharePath.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' import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue'
export default { export default {
@ -141,25 +142,29 @@
defaultShareImage: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png', defaultShareImage: 'https://jewel-shop.oss-cn-beijing.aliyuncs.com/f7227759d693497a8beab87ff437a875.png',
likeLocked: false, likeLocked: false,
imageSizeMap: {}, imageSizeMap: {},
areaKind: 1 areaKind: 1,
campusTextEnabled: 0
} }
}, },
computed: { computed: {
isSocialArea() { isSocialArea() {
return Number(this.areaKind) === 2 return Number(this.areaKind) === 2
}, },
useSocialText() {
return shouldUseSocialText(this.areaKind, this.campusTextEnabled)
},
pageTitle() { pageTitle() {
if (this.post && this.post.postType === 'partner') return '搭子详情' if (this.post && this.post.postType === 'partner') return '搭子详情'
return this.isSocialArea ? '同城墙详情' : '校园墙详情' return this.useSocialText ? '同城墙详情' : '校园墙详情'
}, },
circleName() { circleName() {
return this.isSocialArea ? '同城圈' : '校园圈' return this.useSocialText ? '同城圈' : '校园圈'
}, },
defaultUserName() { defaultUserName() {
return this.isSocialArea ? '半径好友' : '半径同学' return this.useSocialText ? '半径好友' : '半径同学'
}, },
defaultRegionName() { defaultRegionName() {
return this.isSocialArea ? '本区域' : '本校' return this.useSocialText ? '本区域' : '本校'
}, },
navHeight() { return this.statusBarTop + uni.upx2px(104) }, navHeight() { return this.statusBarTop + uni.upx2px(104) },
imageList() { return this.post && this.post.imageList ? this.post.imageList : [] }, imageList() { return this.post && this.post.imageList ? this.post.imageList : [] },
@ -202,6 +207,7 @@
} }
const kind = area ? Number(area.areaKind) : 1 const kind = area ? Number(area.areaKind) : 1
this.areaKind = kind === 2 ? 2 : 1 this.areaKind = kind === 2 ? 2 : 1
this.campusTextEnabled = resolveCampusTextEnabled(area)
}, },
loadDetail() { loadDetail() {
getCampusPostDetail(this.id).then(post => { getCampusPostDetail(this.id).then(post => {
@ -293,11 +299,11 @@
const title = this.post && this.post.title const title = this.post && this.post.title
? this.post.title ? this.post.title
: (isPartner : (isPartner
? (this.isSocialArea ? '同城搭子' : '校园搭子') ? (this.useSocialText ? '同城搭子' : '校园搭子')
: (this.isSocialArea ? '同城圈内容' : '校园圈内容')) : (this.useSocialText ? '同城圈内容' : '校园圈内容'))
const prefix = isPartner const prefix = isPartner
? (this.isSocialArea ? '好友正在找搭子:' : '同学正在找搭子:') ? (this.useSocialText ? '好友正在找搭子:' : '同学正在找搭子:')
: (this.isSocialArea ? '同城圈:' : '校园圈:') : (this.useSocialText ? '同城圈:' : '校园圈:')
const targetPath = `/package1/post/postDetail?id=${this.id || ''}&source=campus` const targetPath = `/package1/post/postDetail?id=${this.id || ''}&source=campus`
return { return {
title: prefix + title, title: prefix + title,
@ -316,7 +322,7 @@
}) })
}, },
async focusComment() { async focusComment() {
const ok = await this.ensureVerified(this.isSocialArea ? '评论同城圈内容' : '评论校园圈内容') const ok = await this.ensureVerified(this.useSocialText ? '评论同城圈内容' : '评论校园圈内容')
if (!ok) return if (!ok) return
this.replyTarget = {} this.replyTarget = {}
this.commentText = '' this.commentText = ''
@ -324,7 +330,7 @@
this.$refs.commentPopup.open() this.$refs.commentPopup.open()
}, },
async replyComment(item) { async replyComment(item) {
const ok = await this.ensureVerified(this.isSocialArea ? '评论同城圈内容' : '评论校园圈内容') const ok = await this.ensureVerified(this.useSocialText ? '评论同城圈内容' : '评论校园圈内容')
if (!ok) return if (!ok) return
this.replyTarget = item || {} this.replyTarget = item || {}
this.commentText = '' this.commentText = ''
@ -343,7 +349,7 @@
uni.showToast({ title: '请输入评论内容', icon: 'none' }) uni.showToast({ title: '请输入评论内容', icon: 'none' })
return return
} }
const ok = await this.ensureVerified(this.isSocialArea ? '评论同城圈内容' : '评论校园圈内容') const ok = await this.ensureVerified(this.useSocialText ? '评论同城圈内容' : '评论校园圈内容')
if (!ok) return if (!ok) return
this.commentSubmitting = true this.commentSubmitting = true
try { try {
@ -427,7 +433,7 @@
}, },
async goChat() { async goChat() {
if (!this.canUsePartnerChat) return if (!this.canUsePartnerChat) return
const ok = await this.ensureVerified(this.isSocialArea ? '联系同城圈搭子' : '联系校园圈搭子') const ok = await this.ensureVerified(this.useSocialText ? '联系同城圈搭子' : '联系校园圈搭子')
if (!ok) return if (!ok) return
createCampusChatSession(this.id).then(session => { createCampusChatSession(this.id).then(session => {
if (!session || !session.sessionId) return if (!session || !session.sessionId) return

20
package1/tabbar/fishRelease.vue

@ -131,6 +131,7 @@
import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js' import { ensureIeVerifiedBeforeAction } from '@/common/ieRealNameAuth.js'
import IeAuthDialog from '@/package1/components/ie-auth-dialog/ie-auth-dialog.vue' 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 SpEditor from '@/package1/components/sp-editor/components/sp-editor/sp-editor.vue'
import { resolveCampusTextEnabled, shouldUseSocialText } from '@/utils/areaTextMode.js'
import { import {
listFishCategories, listFishCategories,
getFishGoodsDetail, getFishGoodsDetail,
@ -184,19 +185,23 @@
phone: '', phone: '',
tags: ['可小刀'] tags: ['可小刀']
}, },
areaKind: 1 areaKind: 1,
campusTextEnabled: 0
} }
}, },
computed: { computed: {
isSocialArea() { isSocialArea() {
return Number(this.areaKind) === 2 return Number(this.areaKind) === 2
}, },
useSocialText() {
return shouldUseSocialText(this.areaKind, this.campusTextEnabled)
},
pageTitle() { pageTitle() {
if (this.isSocialArea) return this.isEdit ? '编辑同城二手' : '发布同城二手' if (this.useSocialText) return this.isEdit ? '编辑同城二手' : '发布同城二手'
return this.isEdit ? '编辑校园二手' : '发布校园二手' return this.isEdit ? '编辑校园二手' : '发布校园二手'
}, },
fishBadgeText() { fishBadgeText() {
return this.isSocialArea ? '同城二手' : '校园二手' return this.useSocialText ? '同城二手' : '校园二手'
}, },
categoryNames() { categoryNames() {
return this.categories.map(item => item.name) return this.categories.map(item => item.name)
@ -269,7 +274,8 @@
const area = areaObj || this.getArea() const area = areaObj || this.getArea()
const kind = area ? Number(area.areaKind) : 1 const kind = area ? Number(area.areaKind) : 1
this.areaKind = kind === 2 ? 2 : 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 '宿舍自提'
if (tag === '可送上门') return '可送宿舍' if (tag === '可送上门') return '可送宿舍'
return tag return tag
@ -379,7 +385,7 @@
const profile = await getIeProfile().catch(() => null) const profile = await getIeProfile().catch(() => null)
const verified = await ensureIeVerifiedBeforeAction({ const verified = await ensureIeVerifiedBeforeAction({
profile: profile || {}, profile: profile || {},
actionText: this.isSocialArea ? '发布二手信息' : '发布校园二手信息', actionText: this.useSocialText ? '发布二手信息' : '发布校园二手信息',
authDialog: this.fishAuthDialogOptions(), authDialog: this.fishAuthDialogOptions(),
reload: getIeProfile, reload: getIeProfile,
requireProfileSetup: false requireProfileSetup: false
@ -562,7 +568,7 @@
const profile = await getIeProfile().catch(() => null) const profile = await getIeProfile().catch(() => null)
const verified = await ensureIeVerifiedBeforeAction({ const verified = await ensureIeVerifiedBeforeAction({
profile: profile || {}, profile: profile || {},
actionText: this.isSocialArea ? '发布二手信息' : '发布校园二手信息', actionText: this.useSocialText ? '发布二手信息' : '发布校园二手信息',
authDialog: this.fishAuthDialogOptions(), authDialog: this.fishAuthDialogOptions(),
reload: getIeProfile, reload: getIeProfile,
requireProfileSetup: false requireProfileSetup: false

Loading…
Cancel
Save