|
|
|
@ -43,7 +43,7 @@ |
|
|
|
<view class="dizhi-ming"> |
|
|
|
沁园春第三食堂A20窗口 |
|
|
|
</view> |
|
|
|
<view class="dizhi-btn"> |
|
|
|
<view class="dizhi-btn" @tap="openAddressBook"> |
|
|
|
地址簿 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -57,7 +57,7 @@ |
|
|
|
<view class="dizhi-ming"> |
|
|
|
沁园春第三食堂A20窗口 |
|
|
|
</view> |
|
|
|
<view class="dizhi-btn"> |
|
|
|
<view class="dizhi-btn" @tap="openAddressBook"> |
|
|
|
地址簿 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -142,72 +142,30 @@ |
|
|
|
</view> |
|
|
|
<view class="content-box"> |
|
|
|
<view class="content-title"> |
|
|
|
取件重量<text>*</text> |
|
|
|
特殊情况<text>*</text> |
|
|
|
</view> |
|
|
|
<view style="flex: 1;"> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('weight','5公斤以内')" |
|
|
|
:style="{'background':addFormData.weight == '5公斤以内' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
5公斤以内 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('weight','5-10公斤')" |
|
|
|
:style="{'background':addFormData.weight == '5-10公斤' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
5-10公斤 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('weight','10-15公斤')" |
|
|
|
:style="{'background':addFormData.weight == '10-15公斤' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
10-15公斤 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('weight','15-20公斤')" |
|
|
|
:style="{'background':addFormData.weight == '15-20公斤' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
15-20公斤 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('weight','20公斤以上')" |
|
|
|
:style="{'background':addFormData.weight == '20公斤以上' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
20公斤以上 |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume" |
|
|
|
:style="{'background':addFormData.isOverweightOrOvervolume?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
超重超大 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-box"> |
|
|
|
<view class="content-title"> |
|
|
|
物品体积<text>*</text> |
|
|
|
</view> |
|
|
|
<view style="flex: 1;"> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('volume','0.5立方米以下')" |
|
|
|
:style="{'background':addFormData.volume == '0.5立方米以下' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
0.5立方米以下 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('volume','0.5-1立方米')" |
|
|
|
:style="{'background':addFormData.volume == '0.5-1立方米' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
0.5-1立方米 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('volume','1.1-1.5立方米')" |
|
|
|
:style="{'background':addFormData.volume == '1.1-1.5立方米' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
1.1-1.5立方米 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('volume','1.6-2立方米')" |
|
|
|
:style="{'background':addFormData.volume == '1.6-2立方米' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
1.6-2立方米 |
|
|
|
</view> |
|
|
|
<view class="duoxuan" @tap="checkWeightOrVolume('volume','2.1立方米以上')" |
|
|
|
:style="{'background':addFormData.volume == '2.1立方米以上' ?'rgba(166, 255, 234, 1)':'#eee'}"> |
|
|
|
2.1立方米以上 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-box"> |
|
|
|
<view class="content-box" style="line-height: 100px;"> |
|
|
|
<view class="content-title"> |
|
|
|
订单备注<text>*</text> |
|
|
|
</view> |
|
|
|
<view style="flex: 1;"> |
|
|
|
<textarea name="" id="" cols="30" rows="10" placeholder="请填写备注"></textarea> |
|
|
|
<view style="height: 100px;background: #eee;border-radius: 20px;padding: 10px;width: 70%;"> |
|
|
|
<textarea name="" id="" cols="30" rows="10" placeholder="请填写备注" |
|
|
|
style="height: 80px;width: 100%;"></textarea> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="content-box"> |
|
|
|
<view class="content-title"> |
|
|
|
送达时间<text>*</text> |
|
|
|
</view> |
|
|
|
<view style="flex: 1;" @tap="$refs.model.open();"> |
|
|
|
选择送达时间 <uni-icons type="right"></uni-icons> |
|
|
|
<view style="flex: 1;font-size: 14px;font-weight: 700;" @tap="checkTime"> |
|
|
|
{{addFormData.deliveryTime}} <uni-icons type="right"></uni-icons> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view style="width: 100%;height: 120px;"></view> |
|
|
|
@ -217,6 +175,13 @@ |
|
|
|
直接购买 |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 地址簿弹出层 --> |
|
|
|
<uni-popup ref="bookPopup" background-color="#fff"> |
|
|
|
<view class="book-popup-content"> |
|
|
|
<address-list></address-list> |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<delivery-time-op @dataCallback="dataCallback" @timeCallback="timeCallback" :dodge="true" ref='model' |
|
|
|
:content="content" :barHidth='600' title="选择预送达时间"> |
|
|
|
> </delivery-time-op> |
|
|
|
@ -225,6 +190,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import deliveryTimeOp from '@/components/delivery-time-op/delivery-time-op.vue' |
|
|
|
import addressList from '@/package1/address/addressList.vue' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
@ -240,35 +206,15 @@ |
|
|
|
code: '' |
|
|
|
}], |
|
|
|
picture: [], |
|
|
|
weight: '', |
|
|
|
volume: '' |
|
|
|
isOverweightOrOvervolume: false, |
|
|
|
deliveryTime: '立即送达' |
|
|
|
}, |
|
|
|
content: [{ |
|
|
|
timezh: "今天 (周三)", |
|
|
|
timeformatter: "8-10", |
|
|
|
id: 108, |
|
|
|
timelist: [{ |
|
|
|
timestr: "立即送达", |
|
|
|
}, { |
|
|
|
timestr: "15:35", |
|
|
|
}, { |
|
|
|
timestr: "16:05", |
|
|
|
}, { |
|
|
|
timestr: "16:35", |
|
|
|
}, { |
|
|
|
timestr: "17:05", |
|
|
|
}, { |
|
|
|
timestr: "17:35", |
|
|
|
}, { |
|
|
|
timestr: "18:05", |
|
|
|
}, { |
|
|
|
timestr: "18:35", |
|
|
|
}] |
|
|
|
}] |
|
|
|
content: [] |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
deliveryTimeOp |
|
|
|
deliveryTimeOp, |
|
|
|
addressList |
|
|
|
}, |
|
|
|
onLoad() { |
|
|
|
|
|
|
|
@ -277,12 +223,94 @@ |
|
|
|
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
checkWeightOrVolume(type, value) { |
|
|
|
if (type == 'weight') { |
|
|
|
this.addFormData.weight = value |
|
|
|
} else { |
|
|
|
this.addFormData.volume = value |
|
|
|
openAddressBook(){ |
|
|
|
this.$refs.bookPopup.open('bottom') |
|
|
|
|
|
|
|
}, |
|
|
|
checkTime(){ |
|
|
|
this.$refs.model.open(); |
|
|
|
this.generateDeliveryTimes() |
|
|
|
}, |
|
|
|
//时间选择器获取时间数据 |
|
|
|
generateDeliveryTimes() { |
|
|
|
const now = new Date(); |
|
|
|
const today = new Date(now); |
|
|
|
const tomorrow = new Date(now); |
|
|
|
tomorrow.setDate(tomorrow.getDate() + 1); |
|
|
|
|
|
|
|
// 星期几 |
|
|
|
const weekdays = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']; |
|
|
|
const todayWeekday = weekdays[today.getDay()]; |
|
|
|
const todayStr = `今天 (${todayWeekday})`; |
|
|
|
|
|
|
|
// 明天的日期格式:月-日(不补零) |
|
|
|
const month = tomorrow.getMonth() + 1; |
|
|
|
const day = tomorrow.getDate(); |
|
|
|
const tomorrowStr = `${month}-${day}`; |
|
|
|
|
|
|
|
// ----- 生成今天的时间列表 ----- |
|
|
|
const todayTimelist = [{ |
|
|
|
timestr: '自动送达' |
|
|
|
}]; |
|
|
|
|
|
|
|
const currentHour = now.getHours(); |
|
|
|
const currentMinute = now.getMinutes(); |
|
|
|
|
|
|
|
// 计算下一个半小时点 |
|
|
|
let nextHour = currentHour; |
|
|
|
let nextMinute = 30; |
|
|
|
if (currentMinute >= 30) { |
|
|
|
nextHour = currentHour + 1; |
|
|
|
nextMinute = 0; |
|
|
|
} |
|
|
|
|
|
|
|
// 从下一个半小时点开始,直到 23:30 |
|
|
|
for (let h = nextHour; h <= 23; h++) { |
|
|
|
const startMin = (h === nextHour) ? nextMinute : 0; |
|
|
|
for (let m = startMin; m < 60; m += 30) { |
|
|
|
if (h === 23 && m > 30) continue; // 不超过 23:30 |
|
|
|
const timeStr = `${h.toString().padStart(2, '0')}:${m.toString().padStart(2, '0')}`; |
|
|
|
todayTimelist.push({ |
|
|
|
timestr: timeStr |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// ----- 生成明天的时间列表(全天 00:00 ~ 23:30)----- |
|
|
|
const tomorrowTimelist = []; |
|
|
|
for (let h = 0; h <= 23; h++) { |
|
|
|
for (let m = 0; m < 60; m += 30) { |
|
|
|
if (h === 23 && m > 30) continue; |
|
|
|
const timeStr = `${h.toString().padStart(2, '0')}:${m.toString().padStart(2, '0')}`; |
|
|
|
tomorrowTimelist.push({ |
|
|
|
timestr: timeStr |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.content = [{ |
|
|
|
timezh: todayStr, |
|
|
|
timelist: todayTimelist |
|
|
|
}, |
|
|
|
{ |
|
|
|
timezh: tomorrowStr, |
|
|
|
timelist: tomorrowTimelist |
|
|
|
} |
|
|
|
]; |
|
|
|
}, |
|
|
|
|
|
|
|
//切换日期 |
|
|
|
dataCallback(type) { |
|
|
|
console.log("11111111111") |
|
|
|
}, |
|
|
|
//时间选择器点击后 |
|
|
|
timeCallback(val) { |
|
|
|
this.addFormData.deliveryTime = val.timestr |
|
|
|
this.$refs.model.close() |
|
|
|
}, |
|
|
|
checkWeightOrVolume() { |
|
|
|
this.addFormData.isOverweightOrOvervolume = !this.addFormData.isOverweightOrOvervolume |
|
|
|
|
|
|
|
}, |
|
|
|
addCode() { |
|
|
|
this.addFormData.codeList.push({ |
|
|
|
|