wangfukang 3 weeks ago
parent
commit
9d30e7d512
  1. 83
      package1/address/addressList.vue
  2. 30
      package1/address/addressPage.vue
  3. 52
      package1/buyFood/buyFood.vue
  4. 83
      package1/order/orderDetail.vue
  5. 21
      package1/order/returnOrder.vue

83
package1/address/addressList.vue

@ -1,8 +1,10 @@
<template> <template>
<view class="address-popup-box"> <view class="address-popup-box" :class="{'address-popup-box--page': pageMode}">
<view style="height: 120rpx;line-height: 120rpx;font-size: 36rpx;font-weight: 700;text-align: center;position:relative;"> <view v-if="!hideHeader" :style="headerStyle" :class="{'address-header-page': pageMode}">
收货地址 <uni-icons v-if="pageMode" type="left" size="24" @tap="$emit('close')" class="address-back-icon"
<uni-icons type="closeempty" size="24" @tap="$emit('close')" style="position:absolute;right:30rpx;top:36rpx;"></uni-icons> :style="backIconStyle"></uni-icons>
<text class="address-header-title">收货地址</text>
<uni-icons v-if="!pageMode" type="closeempty" size="24" @tap="$emit('close')" style="position:absolute;right:30rpx;top:36rpx;"></uni-icons>
</view> </view>
<view style="padding-bottom: 140rpx;"> <view style="padding-bottom: 140rpx;">
<view v-for="(item, index) in addressList" :key="index" @tap="selectAddress(item)" <view v-for="(item, index) in addressList" :key="index" @tap="selectAddress(item)"
@ -104,6 +106,20 @@
<script> <script>
export default { export default {
props: {
pageMode: {
type: Boolean,
default: false
},
hideHeader: {
type: Boolean,
default: false
},
safeTop: {
type: Number,
default: 0
}
},
data() { data() {
return { return {
addressList: [], addressList: [],
@ -129,6 +145,35 @@
this.getAddressList(); this.getAddressList();
}, },
computed: { computed: {
headerStyle() {
if (this.pageMode) {
return {
height: (this.safeTop + 58) + 'px',
lineHeight: '44px',
paddingTop: this.safeTop + 'px',
fontSize: '36rpx',
fontWeight: 700,
textAlign: 'center',
position: 'relative',
boxSizing: 'border-box'
}
}
return {
height: '120rpx',
lineHeight: '120rpx',
fontSize: '36rpx',
fontWeight: 700,
textAlign: 'center',
position: 'relative'
}
},
backIconStyle() {
return {
position: 'absolute',
left: '30rpx',
top: (this.safeTop + 10) + 'px'
}
},
filteredAreaTitleList() { filteredAreaTitleList() {
const keyword = (this.areaSearchInput || '').toString(); const keyword = (this.areaSearchInput || '').toString();
if (!keyword) return this.areaTitleList; if (!keyword) return this.areaTitleList;
@ -319,6 +364,30 @@
height: 1200rpx; height: 1200rpx;
} }
.address-popup-box--page {
min-height: 100vh;
height: auto;
box-sizing: border-box;
}
.address-header-page {
display: flex;
align-items: flex-start;
justify-content: center;
}
.address-header-page .address-header-title {
display: block;
width: 100%;
height: 44px;
line-height: 44px;
text-align: center;
}
.address-back-icon {
z-index: 2;
}
.address-item { .address-item {
margin-bottom: 20rpx; margin-bottom: 20rpx;
display: flex; display: flex;
@ -383,6 +452,12 @@
margin: 20rpx auto; margin: 20rpx auto;
position: fixed; position: fixed;
bottom: 20rpx; bottom: 20rpx;
box-sizing: border-box;
z-index: 20;
}
.address-popup-box--page>.bottom-btn {
left: 5%;
} }
.book-popup-content{ .book-popup-content{
height: auto; height: auto;

30
package1/address/addressPage.vue

@ -0,0 +1,30 @@
<template>
<view class="address-page">
<address-list :page-mode="true" :hide-header="true" @close="goBack" @selectAddress="selectAddress" />
</view>
</template>
<script>
import addressList from '@/package1/address/addressList.vue'
export default {
components: {
addressList
},
methods: {
goBack() {
uni.navigateBack()
},
selectAddress(item) {
uni.setStorageSync('selectedAddress', item)
}
}
}
</script>
<style scoped>
.address-page {
min-height: 100vh;
background: #fff;
}
</style>

52
package1/buyFood/buyFood.vue

@ -553,7 +553,7 @@
<view class="free-order-subtitle">未支付免单资格会传递给下一个小伙伴</view> <view class="free-order-subtitle">未支付免单资格会传递给下一个小伙伴</view>
</view> </view>
</view> </view>
<common-loading /> <common-loading />
</view> </view>
</template> </template>
@ -1415,53 +1415,41 @@
} }
return list; return list;
}, },
getAppointmentEndTime(date) {
const endTime = new Date(date);
const fallbackEndTime = new Date(date);
fallbackEndTime.setHours(23, 0, 0, 0);
const endStr = this.shopItem.shopTakeaway && this.shopItem.shopTakeaway.businessHourEnd;
const parts = String(endStr || '').split(':').map(Number);
if (parts.length < 2 || isNaN(parts[0]) || isNaN(parts[1])) {
return fallbackEndTime;
}
endTime.setHours(parts[0], parts[1], 0, 0);
endTime.setMinutes(endTime.getMinutes() + 20);
return endTime > fallbackEndTime ? fallbackEndTime : endTime;
},
generateDeliveryTimes() { generateDeliveryTimes() {
const now = new Date(); const now = new Date();
const today = new Date(now); const today = new Date(now);
const tomorrow = new Date(now);
tomorrow.setDate(tomorrow.getDate() + 1);
// //
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
const todayWeekday = weekdays[today.getDay()]; const todayWeekday = weekdays[today.getDay()];
const todayStr = `今天 (${todayWeekday})`; const todayStr = `今天 (${todayWeekday})`;
// -
const month = tomorrow.getMonth() + 1;
const day = tomorrow.getDate();
const tomorrowStr = `${month}-${day}`;
// ----- ----- // ----- -----
const todayTimelist = [{
timestr: '自动送达'
}];
const earliestTime = new Date(now); const earliestTime = new Date(now);
earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveDeliveryDurationMinutes()); earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveDeliveryDurationMinutes());
const todayStartTime = this.getNextDeliverySlot(earliestTime); const todayStartTime = this.getNextDeliverySlot(earliestTime);
const todayEndTime = new Date(today); const todayEndTime = this.getAppointmentEndTime(today);
todayEndTime.setHours(23, 40, 0, 0); const todayTimelist = this.buildDeliveryTimeList(todayStartTime, todayEndTime);
todayTimelist.push(...this.buildDeliveryTimeList(todayStartTime, todayEndTime));
// ----- 00:00 ~ 23:40 20 -----
const tomorrowStartTime = new Date(tomorrow);
tomorrowStartTime.setHours(0, 0, 0, 0);
const tomorrowEndTime = new Date(tomorrow);
tomorrowEndTime.setHours(23, 40, 0, 0);
const tomorrowTimelist = this.buildDeliveryTimeList(tomorrowStartTime, tomorrowEndTime);
this.content = [{ this.content = [{
id: 'today', id: 'today',
timezh: todayStr, timezh: todayStr,
timelist: todayTimelist timelist: todayTimelist
}, }];
{
id: 'tomorrow',
timezh: tomorrowStr,
timelist: tomorrowTimelist
}
];
}, },
// //
timeCallback(val) { timeCallback(val) {

83
package1/order/orderDetail.vue

@ -67,16 +67,18 @@
</view> </view>
</view> </view>
<view class="kaituan21"> <view class="kaituan21">
<view class="kaituan221"> <view class="kaituan-member-list">
<img src="/static/images/img/songshu.png" <view class="kaituan221"
alt="" v-for="(item1,index1) in orderDetail.groupInfo.currentMembers"
style="width: 90rpx;height: 90rpx;border-radius: 90rpx;margin: 0 auto;display: block;" />
</view>
<view class="kaituan221 kaituan-plus-list">
<view class="weipincheng1"
v-for="(item1,index1) in (orderDetail.groupInfo.targetMembers - orderDetail.groupInfo.currentMembers)"
:key="index1"> :key="index1">
+ <img class="kaituan-member-icon" src="/static/images/img/songshu.png" alt="" />
</view>
<view class="kaituan-empty-list">
<view class="weipincheng1"
v-for="(item1,index1) in (orderDetail.groupInfo.targetMembers - orderDetail.groupInfo.currentMembers)"
:key="index1">
+
</view>
</view> </view>
</view> </view>
</view> </view>
@ -187,7 +189,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="content order-detail-content"> <view class="content order-detail-content" :class="{'order-detail-content-address-long': isStatusAddressLong}">
<view class="order-flow" v-if="orderDetail.status != 6"> <view class="order-flow" v-if="orderDetail.status != 6">
<view class="flow-item active"> <view class="flow-item active">
<view class="flow-dot"></view> <view class="flow-dot"></view>
@ -444,12 +446,12 @@
{{orderDetail.shopAddress == undefined ? '' : orderDetail.shopAddress}} {{orderDetail.shopAddress == undefined ? '' : orderDetail.shopAddress}}
</view> </view>
</view> </view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" <view style="min-height: 80rpx;line-height: 40rpx;display: flex;align-items: flex-start;padding: 20rpx 0;box-sizing: border-box;"
v-if="orderDetail.otherOrder == 1"> v-if="orderDetail.otherOrder == 1">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="width: 160rpx;flex-shrink: 0;color: #777;font-weight: 700;">
收件地址 收件地址
</view> </view>
<view style="color: #000;font-weight: 700;"> <view style="flex: 1;min-width: 0;color: #000;font-weight: 700;text-align: right;word-break: break-all;overflow-wrap: break-word;">
{{orderDetail.receiverAddress == undefined ? '' : orderDetail.receiverAddress}} {{orderDetail.receiverAddress == undefined ? '' : orderDetail.receiverAddress}}
</view> </view>
</view> </view>
@ -482,7 +484,7 @@
</view> </view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;"> <view style="height: 80rpx;line-height: 80rpx;display: flex;">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="flex: 1;color: #777;font-weight: 700;">
下单时间 创建时间
</view> </view>
<view style="color: #000;font-weight: 700;"> <view style="color: #000;font-weight: 700;">
{{orderDetail.createTime | formatTime}} {{orderDetail.createTime | formatTime}}
@ -610,7 +612,7 @@
</view> </view>
</view> </view>
<view style="height: 80rpx;line-height: 80rpx;display: flex;" <view style="height: 80rpx;line-height: 80rpx;display: flex;"
v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.finishTime == null"> v-if="orderDetail.deliveryType == 1 && orderDetail.deliveryInfo.finishTime == null && (orderDetail.deliveryInfo.status == 0 || orderDetail.deliveryInfo.status == 1 || orderDetail.deliveryInfo.status == 2)">
<view style="flex: 1;color: #777;font-weight: 700;"> <view style="flex: 1;color: #777;font-weight: 700;">
预计送达时间 预计送达时间
</view> </view>
@ -973,6 +975,12 @@
payAmountText() { payAmountText() {
let amount = Number(this.orderDetail.totalAmount || 0); let amount = Number(this.orderDetail.totalAmount || 0);
return amount ? amount.toFixed(2) : '0.00'; return amount ? amount.toFixed(2) : '0.00';
},
isStatusAddressLong() {
let address = this.orderDetail.deliveryInfo && this.orderDetail.deliveryInfo.receiverAddress
? this.orderDetail.deliveryInfo.receiverAddress
: '';
return String(address).length > 20;
} }
}, },
components: { components: {
@ -2200,6 +2208,10 @@
box-sizing: border-box; box-sizing: border-box;
} }
.order-detail-content-address-long {
padding-top: 456rpx;
}
.title-sreach { .title-sreach {
width: 100%; width: 100%;
display: flex; display: flex;
@ -2464,6 +2476,8 @@
color: #243f38; color: #243f38;
line-height: 40rpx; line-height: 40rpx;
word-break: break-all; word-break: break-all;
max-height: 80rpx;
overflow: hidden;
} }
.status-address-label { .status-address-label {
@ -2476,6 +2490,10 @@
min-width: 0; min-width: 0;
word-break: break-all; word-break: break-all;
overflow-wrap: break-word; overflow-wrap: break-word;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
} }
.status-btn { .status-btn {
@ -3166,27 +3184,44 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
flex-wrap: wrap; flex-wrap: nowrap;
width: 90%; width: 90%;
margin: 40rpx auto; margin: 40rpx auto;
overflow-x: auto;
overflow-y: hidden;
white-space: nowrap;
}
.kaituan-member-list {
display: flex;
align-items: center;
justify-content: flex-start;
flex-wrap: nowrap;
}
.kaituan-empty-list {
display: flex;
align-items: center;
flex-wrap: nowrap;
} }
.kaituan221 { .kaituan221 {
flex: 0 0 90rpx;
min-width: 90rpx; min-width: 90rpx;
margin: 12rpx 18rpx; margin: 12rpx 18rpx;
} }
.kaituan-plus-list { .kaituan-member-icon {
display: flex; width: 90rpx;
align-items: center; height: 90rpx;
justify-content: center; border-radius: 90rpx;
flex-wrap: wrap; margin: 0 auto;
gap: 14rpx; display: block;
} }
.kaituan-plus-list .weipincheng1 { .kaituan-member-list .weipincheng1 {
flex: 0 0 90rpx; flex: 0 0 90rpx;
margin: 0; margin: 12rpx 18rpx;
} }
.kaituan31 { .kaituan31 {

21
package1/order/returnOrder.vue

@ -501,18 +501,28 @@
} }
return Number(((couponAmount + freeAmount) / allAmount).toFixed(4)) return Number(((couponAmount + freeAmount) / allAmount).toFixed(4))
}, },
updateRefundShowAmount() { isPartialRefundType() {
let refundAmount = this.toAmount(this.returnData.refundAmount) return this.sellTime == 0 || this.sellTime == 1 || this.returnData.refundType == 1 || this.returnData.refundType == 2
},
getRefundApplyAmount() {
let originRefundAmount = this.toAmount(this.returnData.refundAmount)
let refundAmount = originRefundAmount
if (this.sellTime == 0 || this.sellTime == 1 || this.returnData.refundType == 1 || this.returnData.refundType == 2) { if (this.sellTime == 0 || this.sellTime == 1 || this.returnData.refundType == 1 || this.returnData.refundType == 2) {
let ratio = this.getRefundRatio() let ratio = this.getRefundRatio()
refundAmount = refundAmount - refundAmount * ratio refundAmount = refundAmount - refundAmount * ratio
} }
let refundShowAmount = Number(refundAmount.toFixed(2)) let refundShowAmount = Number(refundAmount.toFixed(2))
if (this.isPartialRefundType() && originRefundAmount > 0 && refundShowAmount <= 0.01) {
refundShowAmount = 0.01
}
let totalAmount = this.toAmount(this.orderDetail.totalAmount) let totalAmount = this.toAmount(this.orderDetail.totalAmount)
if (this.orderDetail.totalAmount != null && refundShowAmount > totalAmount) { if (this.orderDetail.totalAmount != null && refundShowAmount > totalAmount) {
refundShowAmount = totalAmount refundShowAmount = totalAmount
} }
this.refundShowAmount = refundShowAmount return refundShowAmount
},
updateRefundShowAmount() {
this.refundShowAmount = this.getRefundApplyAmount()
}, },
pictureAdd(id, huan) { pictureAdd(id, huan) {
let that = this let that = this
@ -593,10 +603,13 @@
}); });
return; return;
} }
let submitData = Object.assign({}, this.returnData, {
refundAmount: this.getRefundApplyAmount()
})
uni.showLoading({ uni.showLoading({
title: '提交售后中...' title: '提交售后中...'
}); });
this.tui.request("/mall/refund/create", "POST", this.returnData, false, false).then(res => { this.tui.request("/mall/refund/create", "POST", submitData, false, false).then(res => {
uni.hideLoading(); uni.hideLoading();
if (res.code == 200) { if (res.code == 200) {
uni.redirectTo({ uni.redirectTo({

Loading…
Cancel
Save