jufubao-mall 1.0.97 → 1.0.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/JfbMallBrandWall/JfbMallBrandWall.vue +14 -2
- package/src/components/JfbMallConfirm/Api.js +15 -0
- package/src/components/JfbMallConfirm/JfbMallConfirm.vue +208 -54
- package/src/components/JfbMallConfirm/XdSelectTime.vue +89 -5
- package/src/components/JfbMallConfirm/orderMixin.js +2 -0
package/package.json
CHANGED
|
@@ -193,6 +193,8 @@
|
|
|
193
193
|
stateCity: state => state.cityLocation.city
|
|
194
194
|
}),
|
|
195
195
|
showTabs(){
|
|
196
|
+
console.log(this.tabs,'showTabs');
|
|
197
|
+
|
|
196
198
|
this.tabs.forEach((item1, index) => {
|
|
197
199
|
const item2 = this.newLabel.find((item) => item.value === item1.value);
|
|
198
200
|
|
|
@@ -202,7 +204,12 @@
|
|
|
202
204
|
item1.isShow = item2.isShow
|
|
203
205
|
}
|
|
204
206
|
});
|
|
205
|
-
this.tabs = this.tabs.filter(item =>
|
|
207
|
+
this.tabs = this.tabs.filter(item =>{
|
|
208
|
+
if(typeof item.isShow!=='boolean') {
|
|
209
|
+
return true
|
|
210
|
+
}
|
|
211
|
+
return item.isShow
|
|
212
|
+
})
|
|
206
213
|
|
|
207
214
|
this.tabs.sort((a,b)=>a.sort - b.sort)
|
|
208
215
|
console.log(this.tabs,this.has_sell,'pappapp');
|
|
@@ -259,6 +266,12 @@
|
|
|
259
266
|
deep:true,
|
|
260
267
|
handler(n,o) {
|
|
261
268
|
if(this.isPreview) {
|
|
269
|
+
n = n.map(item=>{
|
|
270
|
+
if(!('isShow' in item)) {
|
|
271
|
+
item.isShow = true
|
|
272
|
+
}
|
|
273
|
+
return item;
|
|
274
|
+
})
|
|
262
275
|
n = n.filter(item => item.isShow)
|
|
263
276
|
this.tabs = n
|
|
264
277
|
this.tabs.sort((a,b)=>a.sort - b.sort)
|
|
@@ -327,7 +340,6 @@
|
|
|
327
340
|
{label: "电子码", value: "code",sort:4,isShow: true}
|
|
328
341
|
]);
|
|
329
342
|
console.log(this.newLabel,'newLabel');
|
|
330
|
-
|
|
331
343
|
},
|
|
332
344
|
switchTab(i){
|
|
333
345
|
this.tabIndex = i;
|
|
@@ -288,5 +288,20 @@ module.exports = [
|
|
|
288
288
|
},
|
|
289
289
|
isConsole: true,
|
|
290
290
|
disabled: true
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
mapFnName: "getTimeInfo",
|
|
294
|
+
title: "获取预约时间",
|
|
295
|
+
path: "/order/v1/order/get-subscribe-time-info",
|
|
296
|
+
isRule: false,
|
|
297
|
+
data: {
|
|
298
|
+
product_info_items: ['商品信息', 'array', true],
|
|
299
|
+
address_nnid: ['地址id', 'string', true],
|
|
300
|
+
address_nnid_items: ['地址id集合', 'array', true],
|
|
301
|
+
date: ['时间', 'string', true],
|
|
302
|
+
business_code: ['业务线', 'string', true],
|
|
303
|
+
},
|
|
304
|
+
isConsole: true,
|
|
305
|
+
disabled: true
|
|
291
306
|
}
|
|
292
307
|
];
|
|
@@ -18,17 +18,34 @@
|
|
|
18
18
|
'--main-color': mainColor,
|
|
19
19
|
}">
|
|
20
20
|
<template>
|
|
21
|
-
<view v-if="
|
|
22
|
-
<view v-if="
|
|
21
|
+
<view v-if="show_pick_up_address==='Y'" class="shipping-address section" @click="toAddress('Y')">
|
|
22
|
+
<view v-if="curCacheAddr" class="addr_l">
|
|
23
23
|
<view class="person_info">
|
|
24
|
-
<view v-if="
|
|
25
|
-
<view>{{
|
|
24
|
+
<view v-if="curCacheAddr.is_default == 'Y'" class="default_tag">默认</view>
|
|
25
|
+
<view>{{curCacheAddr.name}}</view>
|
|
26
|
+
<view style="margin-left: 16rpx;">{{curCacheAddr.phone}}</view>
|
|
27
|
+
</view>
|
|
28
|
+
<view class="addr_detail">{{curCacheAddr.address_detail}}{{curCacheAddr.house_number}}</view>
|
|
29
|
+
<view class="addr_info">{{curCacheAddr.province_name}}{{curCacheAddr.city_name}}{{curCacheAddr.area_name}}{{curCacheAddr.street_name}}</view>
|
|
30
|
+
</view>
|
|
31
|
+
<view v-else class="addr_l" style="text-align:left;">请设置地址</view>
|
|
32
|
+
<xd-font-icon size="32" style="color: #B1B1B1;" icon="iconxiangyou_xian"></xd-font-icon>
|
|
33
|
+
</view>
|
|
34
|
+
<view v-if="show_receive_address==='Y'" class="shipping-address section" @click="toAddress">
|
|
35
|
+
<view v-if="curAddr" class="addr_l">
|
|
36
|
+
<view>
|
|
37
|
+
<view class="person_info">
|
|
38
|
+
<view v-if="curAddr.is_default == 'Y'" class="default_tag">默认</view>
|
|
39
|
+
<view>{{curAddr.name}}</view>
|
|
26
40
|
<view style="margin-left: 16rpx;">{{curAddr.phone}}</view>
|
|
41
|
+
</view>
|
|
42
|
+
<view class="addr_detail">{{curAddr.address_detail}}{{curAddr.house_number}}</view>
|
|
43
|
+
<view class="addr_info">{{curAddr.province_name}}{{curAddr.city_name}}{{curAddr.area_name}}{{curAddr.street_name}}</view>
|
|
27
44
|
</view>
|
|
28
|
-
<view class="addr_detail">{{curAddr.address_detail}}{{curAddr.house_number}}</view>
|
|
29
|
-
<view class="addr_info">{{curAddr.province_name}}{{curAddr.city_name}}{{curAddr.area_name}}{{curAddr.street_name}}</view>
|
|
30
45
|
</view>
|
|
31
|
-
<view v-else class="addr_l" style="text-align:left;"
|
|
46
|
+
<view v-else class="addr_l" style="text-align:left;">
|
|
47
|
+
请设置地址
|
|
48
|
+
</view>
|
|
32
49
|
<xd-font-icon size="32" style="color: #B1B1B1;" icon="iconxiangyou_xian"></xd-font-icon>
|
|
33
50
|
</view>
|
|
34
51
|
<view v-if="showBuyer == 'Y'" class="buyer_info section">
|
|
@@ -70,11 +87,9 @@
|
|
|
70
87
|
</view>
|
|
71
88
|
</view>
|
|
72
89
|
</view>
|
|
73
|
-
|
|
74
|
-
<!-- <template v-if="shop.is_support_delivery === 'Y'"> -->
|
|
75
90
|
<!-- 配送信息 -->
|
|
76
|
-
<view v-if="
|
|
77
|
-
<xd-list-item label="配送方式" showRight paddingLR="60rpx" showBottom size="large">
|
|
91
|
+
<view v-if="shop.support_delivery_method_options.length" class="delivery">
|
|
92
|
+
<xd-list-item v-if="shop.sub_show_delivery_method==='Y'" label="配送方式" showRight paddingLR="60rpx" showBottom size="large">
|
|
78
93
|
<picker @change="e => bindPickerChange(e, shopIndex)"
|
|
79
94
|
range-key="label" :range="shop.support_delivery_method_options"
|
|
80
95
|
:value="shop.support_delivery_method_options.findIndex(ll => ll.value == shop.deliveryPickValue)"
|
|
@@ -82,40 +97,30 @@
|
|
|
82
97
|
<view style="color: #999999;">{{shop.deliveryPickLabel || "选择配送方式"}}</view>
|
|
83
98
|
</picker>
|
|
84
99
|
</xd-list-item>
|
|
85
|
-
<
|
|
86
|
-
<
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
<view>
|
|
101
|
+
<xd-list-item v-if="shop.sub_show_delivery_price==='Y'" label="配送费" paddingLR="50rpx">
|
|
102
|
+
<xd-unit :price="shop.user_logistics_amount_origin" :isOld="false"></xd-unit>
|
|
103
|
+
</xd-list-item>
|
|
104
|
+
<xd-list-item v-if="shop.deliveryPickValue === 'samecity' && shop.is_support_delivery == 'Y'" :label="shop.time_label" showRight paddingLR="50rpx" @click="toSetSelectTime(shopIndex,shop)">
|
|
105
|
+
{{shop.selectTime ? shop.selectTime.dateTime : "请选择"}}
|
|
106
|
+
</xd-list-item>
|
|
107
|
+
<view v-if="shop.deliveryPickValue === 'takeout'" >
|
|
108
|
+
<!-- 配送方式:到店自提 -->
|
|
109
|
+
<xd-list-item label="选择门店" show-right paddingLR="50rpx" @click="toSetSelectShop(shopIndex)">
|
|
110
|
+
<view style="color: #999999;">
|
|
111
|
+
{{shop.choseShop ? shop.choseShop.resource_shop_name : "请选择"}}
|
|
95
112
|
</view>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
{{shop.choseShop ? shop.choseShop.resource_shop_name : "请选择"}}
|
|
103
|
-
</view>
|
|
104
|
-
</xd-list-item>
|
|
105
|
-
<xd-list-item v-if="shop.takeoutTimeList" label="到店时间" show-right paddingLR="50rpx" @click="toSetTakeoutTime(shopIndex)">
|
|
106
|
-
<view style="color: #999999;">{{shop.takeoutTime ? shop.takeoutTime.dateTime : '请选择'}}</view>
|
|
107
|
-
</xd-list-item>
|
|
108
|
-
</view>
|
|
109
|
-
</template>
|
|
110
|
-
</template>
|
|
113
|
+
</xd-list-item>
|
|
114
|
+
<xd-list-item v-if="shop.takeoutTimeList" :label="shop.time_label" show-right paddingLR="50rpx" @click="toSetTakeoutTime(shopIndex,shop)">
|
|
115
|
+
<view style="color: #999999;">{{shop.takeoutTime ? shop.takeoutTime.dateTime : '请选择'}}</view>
|
|
116
|
+
</xd-list-item>
|
|
117
|
+
</view>
|
|
118
|
+
</view>
|
|
111
119
|
</view>
|
|
112
120
|
<xd-list-item v-if="shop.delivery_message" :label="shop.delivery_message" paddingLR="60rpx" size="large"></xd-list-item>
|
|
113
|
-
<!-- </template>
|
|
114
|
-
<template v-else> -->
|
|
115
121
|
<view v-if="shop.is_support_delivery == 'N'" :style="{background:bgColor,color:warningColor}" class="err_message">
|
|
116
122
|
{{shop.message}}
|
|
117
123
|
</view>
|
|
118
|
-
<!-- </template> -->
|
|
119
124
|
</view>
|
|
120
125
|
</view>
|
|
121
126
|
|
|
@@ -131,11 +136,10 @@
|
|
|
131
136
|
<xd-list-item label="商品总额" paddingLR="60rpx" size="small">
|
|
132
137
|
<xd-unit :price="gift_id ? orderFee.product_amount : goodTotal" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
|
|
133
138
|
</xd-list-item>
|
|
134
|
-
|
|
135
|
-
<xd-list-item v-if="showLogisticsAmount" label="配送费用" paddingLR="60rpx" paddingTB="0" size="small">
|
|
139
|
+
<xd-list-item v-if="showLogisticsAmount&&main_show_delivery_price==='Y'" label="配送费用" paddingLR="60rpx" paddingTB="0" size="small">
|
|
136
140
|
<xd-unit :price="orderFee.user_logistics_amount_origin" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
|
|
137
141
|
</xd-list-item>
|
|
138
|
-
<xd-list-item v-if="showLogisticsDiscount" label="运费减免" showBottom paddingLR="60rpx" size="small">
|
|
142
|
+
<xd-list-item v-if="showLogisticsDiscount&&main_show_delivery_price==='Y'" label="运费减免" showBottom paddingLR="60rpx" size="small">
|
|
139
143
|
<xd-unit :price="orderFee.user_logistics_discount_amount" :isOld="false" :fontSize="24" :iconSize="0.3"></xd-unit>
|
|
140
144
|
</xd-list-item>
|
|
141
145
|
</template>
|
|
@@ -261,12 +265,24 @@
|
|
|
261
265
|
:setSettleSelectCoupon="setSettleSelectCoupon"
|
|
262
266
|
></CusCouponChose>
|
|
263
267
|
<xd-select-time
|
|
268
|
+
v-if="showSelectTime"
|
|
264
269
|
:show.sync="showSelectTime"
|
|
270
|
+
:is_sync="selectTimeIsSync"
|
|
271
|
+
:product_info_items="selectTimeProductInfoItems"
|
|
272
|
+
:address_nnid_items="selectTimeAddressNnidItems"
|
|
273
|
+
:address_nnid="curAddr.address_nnid"
|
|
274
|
+
:business_code="xnamespace"
|
|
265
275
|
@onTimeSlotList="handleTimeSlotList"
|
|
266
276
|
@onSelect="handleTimeSelect"
|
|
267
277
|
></xd-select-time>
|
|
268
278
|
<xd-select-time
|
|
279
|
+
v-if="showTakeoutTime"
|
|
269
280
|
:show.sync="showTakeoutTime"
|
|
281
|
+
:is_sync="selectTimeIsSync"
|
|
282
|
+
:product_info_items="selectTimeProductInfoItems"
|
|
283
|
+
:address_nnid_items="selectTimeAddressNnidItems"
|
|
284
|
+
:address_nnid="curAddr.address_nnid"
|
|
285
|
+
:business_code="xnamespace"
|
|
270
286
|
@onTimeSlotList="handleTakeoutTimeSlotList"
|
|
271
287
|
@onSelect="handleTakeoutTimeSelect"
|
|
272
288
|
></xd-select-time>
|
|
@@ -341,6 +357,8 @@
|
|
|
341
357
|
order_id: "",
|
|
342
358
|
addressList: [],
|
|
343
359
|
address_nnid: "",
|
|
360
|
+
addressCacheList: [], //临时缓存地址列表,在收货地址和取货地址都需要选择的情况下,当做收货地址列表使用
|
|
361
|
+
address_cache_nnid: "",
|
|
344
362
|
productList: [],
|
|
345
363
|
shopList: [],
|
|
346
364
|
tempShopList: [],
|
|
@@ -392,13 +410,13 @@
|
|
|
392
410
|
xnamespace: "",
|
|
393
411
|
showBuyer: "",
|
|
394
412
|
showWish: "",
|
|
395
|
-
showDelivery: "",
|
|
396
413
|
showOrderComment: "",
|
|
397
414
|
shipAddressPath: "",
|
|
398
415
|
payPath: "",
|
|
399
416
|
paySuccessPath: "",
|
|
400
417
|
choseCityPath: "", //选择城市路径
|
|
401
418
|
bgColor: '',
|
|
419
|
+
bgColor2: '',
|
|
402
420
|
preview: "N",
|
|
403
421
|
showActivityPrice: 'N',
|
|
404
422
|
bindCard: '1',
|
|
@@ -413,6 +431,15 @@
|
|
|
413
431
|
couponBtnTextStyle: {}, //优惠券包登录按钮文字背景色设置
|
|
414
432
|
couponUseBtnPadding: {},
|
|
415
433
|
couponImageUrl: "",
|
|
434
|
+
|
|
435
|
+
show_pick_up_address: 'N', //显示取货地址
|
|
436
|
+
show_receive_address: 'Y', //显示收货地址
|
|
437
|
+
main_show_delivery_price: 'Y', //显示主单配送费
|
|
438
|
+
selectTimeIsSync: 'Y', //是否同步获取时间
|
|
439
|
+
selectTimeProductInfoItems: [],
|
|
440
|
+
selectTimeAddressNnidItems: [],
|
|
441
|
+
|
|
442
|
+
isFirst: true,
|
|
416
443
|
}
|
|
417
444
|
},
|
|
418
445
|
computed: {
|
|
@@ -431,6 +458,15 @@
|
|
|
431
458
|
return curClickChoose || curSelect || curDefault || this.addressList[0];
|
|
432
459
|
}
|
|
433
460
|
},
|
|
461
|
+
curCacheAddr(){
|
|
462
|
+
if(!this.addressCacheList.length) return null;
|
|
463
|
+
else{
|
|
464
|
+
let curClickChoose = this.addressCacheList.find(item => item.address_nnid == this.address_cache_nnid);
|
|
465
|
+
let curSelect = this.addressCacheList.find(item => item.is_select == "Y");
|
|
466
|
+
let curDefault = this.addressCacheList.find(item => item.is_default == "Y");
|
|
467
|
+
return curClickChoose || curSelect || curDefault || this.addressCacheList[0];
|
|
468
|
+
}
|
|
469
|
+
},
|
|
434
470
|
showLogisticsAmount(){
|
|
435
471
|
let amount = this.orderFee.user_logistics_amount_origin;
|
|
436
472
|
return !(amount === "" || amount === "-1" || amount === null || amount === undefined);
|
|
@@ -526,6 +562,9 @@
|
|
|
526
562
|
let total_amount = this.orderFee.total_amount ? this.orderFee.total_amount : 0;
|
|
527
563
|
let result = this.$xdUniHelper.cutFloatNumber(total_amount, total);
|
|
528
564
|
return result;
|
|
565
|
+
},
|
|
566
|
+
isSame() {
|
|
567
|
+
return (this.curAddr.address_nnid === this.curCacheAddr.address_nnid);
|
|
529
568
|
}
|
|
530
569
|
},
|
|
531
570
|
watch: {
|
|
@@ -540,6 +579,13 @@
|
|
|
540
579
|
this.p_getCartConfirm();
|
|
541
580
|
}
|
|
542
581
|
},
|
|
582
|
+
curCacheAddr(n, o){
|
|
583
|
+
if((n != o || n.address_nnid != o.address_nnid)){
|
|
584
|
+
this.shopList = [];
|
|
585
|
+
this.tempShopList = [];
|
|
586
|
+
this.p_getCartConfirm();
|
|
587
|
+
}
|
|
588
|
+
},
|
|
543
589
|
curSubscribeTimeInfo(n, o){
|
|
544
590
|
console.log("watch shopList 1", n, o)
|
|
545
591
|
// this.p_getCartConfirm();
|
|
@@ -564,7 +610,8 @@
|
|
|
564
610
|
this.scene = options.scene || "";
|
|
565
611
|
|
|
566
612
|
await this.p_getAddrList();
|
|
567
|
-
this.
|
|
613
|
+
await this.p_getCacheAddrList();
|
|
614
|
+
await this.p_getCartConfirm();
|
|
568
615
|
this.validImageAPIUrl = this.brandInfo['api_host'] + '/common/v1/valid_code/image/show'
|
|
569
616
|
// #ifdef H5
|
|
570
617
|
jfbRootExec("getH5WxAuthorize", {
|
|
@@ -583,9 +630,9 @@
|
|
|
583
630
|
*/
|
|
584
631
|
init(container) {
|
|
585
632
|
this.bgColor = this.$colorChange(this.warningColor).alpha(0.1).toString();
|
|
633
|
+
this.bgColor2 = this.$colorChange(this.mainColor).alpha(0.1).toString();
|
|
586
634
|
this.xnamespace = getContainerPropsValue(container, 'content.xnamespace', this.projectAttr.business_code);
|
|
587
635
|
this.showBuyer = getContainerPropsValue(container, 'content.showBuyer');
|
|
588
|
-
this.showDelivery = getContainerPropsValue(container, 'content.showDelivery', "Y");
|
|
589
636
|
this.showOrderComment = getContainerPropsValue(container, 'content.showOrderComment', "Y");
|
|
590
637
|
this.shipAddressPath = getContainerPropsValue(container, 'content.shipAddressPath', {value: ""}).value;
|
|
591
638
|
this.payPath = getContainerPropsValue(container, 'content.payPath', { value: "" }).value;
|
|
@@ -764,12 +811,14 @@
|
|
|
764
811
|
},
|
|
765
812
|
//使用钱包跟票券一同支付
|
|
766
813
|
useTickAndWalletPay(selected_card_list, selected_wallet_list){
|
|
814
|
+
let address_nnid_items = this.handleGetAddressItems()
|
|
767
815
|
this.createSettleOrder({
|
|
768
816
|
total_price: this.orderFee.total_amount,
|
|
769
817
|
selected_card_list_json: JSON.stringify(selected_card_list),
|
|
770
818
|
selected_wallet_list_json: JSON.stringify(selected_wallet_list),
|
|
771
819
|
need_pay_price: this.orderNeedPayPrice,
|
|
772
|
-
scene: this.scene
|
|
820
|
+
scene: this.scene,
|
|
821
|
+
address_nnid_items
|
|
773
822
|
}, (res) => {
|
|
774
823
|
console.warn("创建订单成功");
|
|
775
824
|
console.warn(res);
|
|
@@ -796,11 +845,31 @@
|
|
|
796
845
|
});
|
|
797
846
|
})
|
|
798
847
|
},
|
|
799
|
-
toSetSelectTime(index){
|
|
848
|
+
toSetSelectTime(index,item){
|
|
849
|
+
this.selectTimeIsSync = item.is_sync;
|
|
850
|
+
this.selectTimeProductInfoItems = item.product.map(item=>{
|
|
851
|
+
return {
|
|
852
|
+
product_id: item.product_id,
|
|
853
|
+
product_sku_id: item.product_sku_id,
|
|
854
|
+
product_num: item.product_num
|
|
855
|
+
}
|
|
856
|
+
})
|
|
857
|
+
let address_nnid_items = this.handleGetAddressItems()
|
|
858
|
+
this.selectTimeAddressNnidItems = address_nnid_items
|
|
800
859
|
this.showTimeShopIndex = index;
|
|
801
860
|
this.showSelectTime = true;
|
|
802
861
|
},
|
|
803
|
-
toSetTakeoutTime(index){
|
|
862
|
+
toSetTakeoutTime(index,item){
|
|
863
|
+
this.selectTimeIsSync = item.is_sync;
|
|
864
|
+
this.selectTimeProductInfoItems = item.product.map(item=>{
|
|
865
|
+
return {
|
|
866
|
+
product_id: item.product_id,
|
|
867
|
+
product_sku_id: item.product_sku_id,
|
|
868
|
+
product_num: item.product_num
|
|
869
|
+
}
|
|
870
|
+
})
|
|
871
|
+
let address_nnid_items = this.handleGetAddressItems()
|
|
872
|
+
this.selectTimeAddressNnidItems = address_nnid_items
|
|
804
873
|
this.showTakeoutShopIndex = index;
|
|
805
874
|
this.showTakeoutTime = true;
|
|
806
875
|
},
|
|
@@ -835,13 +904,15 @@
|
|
|
835
904
|
err_text = "请填写正确的订购人手机号";
|
|
836
905
|
}
|
|
837
906
|
let subscribeTimeInfo = this.shopList.map(item => {
|
|
907
|
+
console.log(item,'ajaajjaja');
|
|
908
|
+
|
|
838
909
|
let result = {};
|
|
839
910
|
if(item.support_delivery_method_options.length && !item.deliveryPickValue) err_text = "请选择配送方式";
|
|
840
911
|
else if(item.deliveryPickValue === 'takeout'){
|
|
841
912
|
if(!item.choseShop){
|
|
842
913
|
err_text = "请选择自提门店";
|
|
843
914
|
}else if(!item.takeoutTime){
|
|
844
|
-
err_text =
|
|
915
|
+
err_text = `请选择${item.time_label}`;
|
|
845
916
|
}else{
|
|
846
917
|
result['shop_id'] = item.choseShop.resource_shop_id;
|
|
847
918
|
result['date'] = item.takeoutTime.dateItem['name'];
|
|
@@ -850,7 +921,7 @@
|
|
|
850
921
|
}
|
|
851
922
|
}else if(item.deliveryPickValue === 'samecity'){
|
|
852
923
|
if(!item.selectTime){
|
|
853
|
-
err_text =
|
|
924
|
+
err_text = `请选择${item.time_label}`;
|
|
854
925
|
}else{
|
|
855
926
|
result['date'] = item.selectTime.dateItem.date;
|
|
856
927
|
result['hourSpan'] = item.selectTime.dateTimeItem.name;
|
|
@@ -932,6 +1003,30 @@
|
|
|
932
1003
|
})
|
|
933
1004
|
})
|
|
934
1005
|
},
|
|
1006
|
+
p_getCacheAddrList() {
|
|
1007
|
+
if(this.gift_id && this.preview === 'Y'){
|
|
1008
|
+
this.addressList = [{"address_nnid":"kEC8GbLa2IGQOrp9KqCb9","user_id":5000025,"province_code":"1","city_code":"jfb1","area_code":"2809","street_code":"51231","province_name":"北京","city_name":"北京","area_name":"城区","street_name":"南池子街道","address_detail":"测试地址","name":"测试账号","phone":"15000000001","is_default":"Y","tag":0,"is_select":"Y","latitude":"39.911427","longitude":"116.64813","partner_id":161,"site_id":"17928cc37788be02","created_time":1689319677,"updated_time":1689319677,"house_number":"某大厦南园12号楼3单元1203","is_valid":"Y","request_id":"ca1febcf5fb61320"}];
|
|
1009
|
+
return Promise.resolve();
|
|
1010
|
+
}
|
|
1011
|
+
this.$xdShowLoading({});
|
|
1012
|
+
return new Promise((resolve, reject) => {
|
|
1013
|
+
jfbRootExec("getAddressList", {
|
|
1014
|
+
vm: this,
|
|
1015
|
+
data: {
|
|
1016
|
+
cache_key: this.order_id
|
|
1017
|
+
}
|
|
1018
|
+
}).then(res => {
|
|
1019
|
+
this.$xdHideLoading();
|
|
1020
|
+
if(!res.address_nnid) this.addressCacheList = [];
|
|
1021
|
+
else this.addressCacheList = [res];
|
|
1022
|
+
resolve(res);
|
|
1023
|
+
}).catch(err => {
|
|
1024
|
+
this.$xdLog.catch(err);
|
|
1025
|
+
this.$xdHideLoading();
|
|
1026
|
+
reject(err);
|
|
1027
|
+
})
|
|
1028
|
+
})
|
|
1029
|
+
},
|
|
935
1030
|
p_getCartConfirm(){
|
|
936
1031
|
console.log('this.xnamespace', this.xnamespace);
|
|
937
1032
|
this.$xdShowLoading({});
|
|
@@ -957,12 +1052,14 @@
|
|
|
957
1052
|
if(this.timer) clearTimeout(this.timer);
|
|
958
1053
|
this.timer = setTimeout(() => {
|
|
959
1054
|
console.log('this.xnamespace',this.xnamespace, this)
|
|
1055
|
+
let address_nnid_items = this.handleGetAddressItems()
|
|
960
1056
|
jfbRootExec("getMallCartConfirm", {
|
|
961
1057
|
vm: this,
|
|
962
1058
|
data: {
|
|
963
1059
|
namespace: this.xnamespace,
|
|
964
1060
|
cart_order_id: this.order_id,
|
|
965
1061
|
address_nnid: this.curAddr? this.curAddr.address_nnid:'',
|
|
1062
|
+
address_nnid_items: address_nnid_items,
|
|
966
1063
|
gift_mode: this.gift_mode,
|
|
967
1064
|
gift_id: this.gift_id,
|
|
968
1065
|
subscribeTimeInfo: this.curSubscribeTimeInfo,
|
|
@@ -971,6 +1068,7 @@
|
|
|
971
1068
|
}
|
|
972
1069
|
}).then(res => {
|
|
973
1070
|
this.$xdHideLoading();
|
|
1071
|
+
this.isFirst = false;
|
|
974
1072
|
this.handlerConfirmRes(res);
|
|
975
1073
|
}).catch(err => {
|
|
976
1074
|
this.$xdHideLoading();
|
|
@@ -978,6 +1076,39 @@
|
|
|
978
1076
|
})
|
|
979
1077
|
},150)
|
|
980
1078
|
},
|
|
1079
|
+
handleGetAddressItems() {
|
|
1080
|
+
// 定义一个空数组,用于存储地址信息
|
|
1081
|
+
let address_nnid_items = []
|
|
1082
|
+
// 定义一个基础数组,包含两种类型的地址信息
|
|
1083
|
+
const baseItems = [
|
|
1084
|
+
{
|
|
1085
|
+
address_type: 1,
|
|
1086
|
+
address_nnid: this.curCacheAddr ? this.curCacheAddr.address_nnid : ''
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
address_type: 2,
|
|
1090
|
+
address_nnid: this.curAddr ? this.curAddr.address_nnid : ''
|
|
1091
|
+
}
|
|
1092
|
+
];
|
|
1093
|
+
// 判断是否是第一次加载
|
|
1094
|
+
if (this.isFirst) {
|
|
1095
|
+
// 如果是第一次加载,将基础数组赋值给address_nnid_items
|
|
1096
|
+
address_nnid_items = baseItems;
|
|
1097
|
+
} else {
|
|
1098
|
+
// 如果不是第一次加载,根据show_pick_up_address和show_receive_address的值,决定address_nnid_items的值
|
|
1099
|
+
if (this.show_pick_up_address === 'Y' && this.show_receive_address === 'Y') {
|
|
1100
|
+
// 如果show_pick_up_address和show_receive_address都为Y,将基础数组赋值给address_nnid_items
|
|
1101
|
+
address_nnid_items = baseItems;
|
|
1102
|
+
} else if (this.show_pick_up_address === 'Y') {
|
|
1103
|
+
// 如果show_pick_up_address为Y,将基础数组中的第二个元素赋值给address_nnid_items
|
|
1104
|
+
address_nnid_items = [baseItems[0]];
|
|
1105
|
+
} else if (this.show_receive_address === 'Y') {
|
|
1106
|
+
// 如果show_receive_address为Y,将基础数组中的第一个元素赋值给address_nnid_items
|
|
1107
|
+
address_nnid_items = [baseItems[1]];
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return address_nnid_items;
|
|
1111
|
+
},
|
|
981
1112
|
handlerConfirmRes(res){
|
|
982
1113
|
if (!res.shop_group) {
|
|
983
1114
|
this.$xdLog.setARMSCustomError('mallConfirm_shopGroup_init_undefined', res);
|
|
@@ -1039,6 +1170,9 @@
|
|
|
1039
1170
|
});
|
|
1040
1171
|
this.is_can_buy = res.is_can_buy;
|
|
1041
1172
|
this.gift_pay_method = res.gift_pay_method;
|
|
1173
|
+
this.show_receive_address = res.show_receive_address;
|
|
1174
|
+
this.show_pick_up_address = res.show_pick_up_address;
|
|
1175
|
+
this.main_show_delivery_price = res.main_show_delivery_price;
|
|
1042
1176
|
let priceChange = this.orderFee.total_amount && this.orderFee.total_amount != res.total_amount;
|
|
1043
1177
|
this.orderFee = {
|
|
1044
1178
|
logistics_amount: res.logistics_amount,
|
|
@@ -1076,13 +1210,19 @@
|
|
|
1076
1210
|
})
|
|
1077
1211
|
},
|
|
1078
1212
|
|
|
1079
|
-
toAddress(){
|
|
1213
|
+
toAddress(isCache='N'){
|
|
1080
1214
|
if (this.preview === 'Y') {
|
|
1081
1215
|
return this.$xdAlert({content: "体验模式不支持配送地址设置", width: '65vw'})
|
|
1082
1216
|
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1217
|
+
if(isCache === 'Y') {
|
|
1218
|
+
this.$xdUniHelper.navigateTo({
|
|
1219
|
+
url: this.shipAddressPath + "?back=true&cache_key="+ this.order_id
|
|
1220
|
+
})
|
|
1221
|
+
} else {
|
|
1222
|
+
this.$xdUniHelper.navigateTo({
|
|
1223
|
+
url: this.shipAddressPath + "?back=true"
|
|
1224
|
+
})
|
|
1225
|
+
}
|
|
1086
1226
|
},
|
|
1087
1227
|
|
|
1088
1228
|
bindPickerChange(e, index){
|
|
@@ -1102,6 +1242,7 @@
|
|
|
1102
1242
|
onJfbShow(options) {
|
|
1103
1243
|
console.log('event.onJfbShow', options)
|
|
1104
1244
|
this.p_getAddrList();
|
|
1245
|
+
this.p_getCacheAddrList()
|
|
1105
1246
|
},
|
|
1106
1247
|
onJfbUnload(){
|
|
1107
1248
|
clearTimeout(this.orderTimer);
|
|
@@ -1121,6 +1262,19 @@
|
|
|
1121
1262
|
margin-bottom: 16rpx;
|
|
1122
1263
|
background: #FFFFFF;
|
|
1123
1264
|
}
|
|
1265
|
+
.same-addr{
|
|
1266
|
+
display: flex;
|
|
1267
|
+
&>view {
|
|
1268
|
+
font-size: 28rpx;
|
|
1269
|
+
color: #333;
|
|
1270
|
+
}
|
|
1271
|
+
&>text {
|
|
1272
|
+
font-size: 20rpx;
|
|
1273
|
+
padding: 4rpx 10rpx;
|
|
1274
|
+
border-radius: 10rpx;
|
|
1275
|
+
margin-left: 20rpx;
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1124
1278
|
.shipping-address{
|
|
1125
1279
|
padding: 40rpx 60rpx;
|
|
1126
1280
|
display: flex;
|
|
@@ -20,15 +20,16 @@
|
|
|
20
20
|
{{DItem.name}}
|
|
21
21
|
</view>
|
|
22
22
|
</scroll-view>
|
|
23
|
-
<scroll-view class="app-body__right" :scroll-y="true">
|
|
23
|
+
<scroll-view v-if="rightList&&rightList.length>0" class="app-body__right" :scroll-y="true">
|
|
24
24
|
<view
|
|
25
25
|
class="app-body__right-item"
|
|
26
26
|
v-for="(TItem,TIndex) in rightList"
|
|
27
|
-
:style="{'background':timeBackground,'color':TIndex===timeSelectIndex?timeSelectColor:''}"
|
|
27
|
+
:style="{'background':timeBackground,'color':TItem.is_subscribe_full==='Y'?'#C0C4CC':TIndex===timeSelectIndex?timeSelectColor:''}"
|
|
28
28
|
:key="TIndex"
|
|
29
29
|
@click="handleSelectTime(TItem, TIndex)"
|
|
30
30
|
>
|
|
31
31
|
{{TItem.name}}
|
|
32
|
+
<text v-if="TItem.is_subscribe_full==='Y'" class="app-body__right-item-full">已约满</text>
|
|
32
33
|
</view>
|
|
33
34
|
</scroll-view>
|
|
34
35
|
</view>
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
|
|
39
40
|
<script>
|
|
40
41
|
import XdDownDrawer from "@/components/XdDownDrawer/XdDownDrawer";
|
|
42
|
+
import { jfbRootExec } from "@/utils/xd.event";
|
|
41
43
|
|
|
42
44
|
/**
|
|
43
45
|
* @property {String} dateBackground 日期选择区域背景色
|
|
@@ -74,7 +76,27 @@
|
|
|
74
76
|
timeSelectColor: {
|
|
75
77
|
type: String,
|
|
76
78
|
default: '#f2dd39'
|
|
77
|
-
}
|
|
79
|
+
},
|
|
80
|
+
is_sync: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: 'Y'
|
|
83
|
+
},
|
|
84
|
+
product_info_items: {
|
|
85
|
+
type: Array,
|
|
86
|
+
default: () => []
|
|
87
|
+
},
|
|
88
|
+
address_nnid_items: {
|
|
89
|
+
type: Array,
|
|
90
|
+
default: () => []
|
|
91
|
+
},
|
|
92
|
+
address_nnid: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: ''
|
|
95
|
+
},
|
|
96
|
+
business_code: {
|
|
97
|
+
type: String,
|
|
98
|
+
default: ''
|
|
99
|
+
},
|
|
78
100
|
},
|
|
79
101
|
components: {
|
|
80
102
|
XdDownDrawer
|
|
@@ -258,13 +280,36 @@
|
|
|
258
280
|
* @description 获取时间段列表
|
|
259
281
|
*/
|
|
260
282
|
getList() {
|
|
261
|
-
this.$emit('onTimeSlotList',
|
|
283
|
+
this.$emit('onTimeSlotList', (list) => {
|
|
262
284
|
if (list === null) {
|
|
263
285
|
this.leftList = this.$xdUniHelper.cloneDeep(this.testDataList);
|
|
264
286
|
} else {
|
|
265
287
|
this.leftList = list
|
|
266
288
|
}
|
|
267
289
|
if (this.leftList.length > 0) {
|
|
290
|
+
if(this.is_sync==='N'){
|
|
291
|
+
jfbRootExec('getTimeInfo', {
|
|
292
|
+
vm: this,
|
|
293
|
+
data: {
|
|
294
|
+
product_info_items: this.product_info_items,
|
|
295
|
+
address_nnid: this.address_nnid,
|
|
296
|
+
address_nnid_items: this.address_nnid_items,
|
|
297
|
+
date: this.leftList[0].year_date,
|
|
298
|
+
business_code: this.business_code
|
|
299
|
+
}
|
|
300
|
+
}).then(res=>{
|
|
301
|
+
this.rightList = res.subscribe_time_list.map(item=>{
|
|
302
|
+
return {
|
|
303
|
+
...item,
|
|
304
|
+
name: item.time
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
this.date = this.leftList[0].name
|
|
308
|
+
this.dateTime = `${this.date} ${res.subscribe_time_list[0].name}`;
|
|
309
|
+
this.dateItem = this.leftList[this.dateSelectIndex];
|
|
310
|
+
})
|
|
311
|
+
return
|
|
312
|
+
}
|
|
268
313
|
this.rightList = this.leftList[0].item_list
|
|
269
314
|
this.date = this.leftList[0].name
|
|
270
315
|
this.dateTime = `${this.date} ${this.rightList[0].name}`;
|
|
@@ -280,6 +325,34 @@
|
|
|
280
325
|
*/
|
|
281
326
|
handleSelectDate(DIndex, DItem) {
|
|
282
327
|
if (DIndex === this.dateSelectIndex) return;
|
|
328
|
+
if(this.is_sync==='N') {
|
|
329
|
+
jfbRootExec('getTimeInfo', {
|
|
330
|
+
vm: this,
|
|
331
|
+
data: {
|
|
332
|
+
product_info_items: this.product_info_items,
|
|
333
|
+
address_nnid: this.address_nnid,
|
|
334
|
+
address_nnid_items: this.address_nnid_items,
|
|
335
|
+
date: DItem.year_date,
|
|
336
|
+
business_code: this.business_code
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
}).then(res=>{
|
|
340
|
+
if(!(res.subscribe_time_list)||res.subscribe_time_list.length===0) {
|
|
341
|
+
this.rightList = [];
|
|
342
|
+
} else {
|
|
343
|
+
this.rightList = res.subscribe_time_list.map(item=>{
|
|
344
|
+
return {
|
|
345
|
+
...item,
|
|
346
|
+
name: item.time
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
}
|
|
350
|
+
this.dateSelectIndex = DIndex;
|
|
351
|
+
this.date = DItem.name;
|
|
352
|
+
this.dateItem = DItem;
|
|
353
|
+
})
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
283
356
|
this.rightList = DItem.item_list;
|
|
284
357
|
this.dateSelectIndex = DIndex;
|
|
285
358
|
// this.timeSelectIndex = 0;
|
|
@@ -291,6 +364,9 @@
|
|
|
291
364
|
* @description 选择时间
|
|
292
365
|
*/
|
|
293
366
|
handleSelectTime(TItem, TIndex) {
|
|
367
|
+
if(TItem.is_subscribe_full==='Y') {
|
|
368
|
+
return
|
|
369
|
+
}
|
|
294
370
|
if (TIndex === this.timeSelectIndex) return;
|
|
295
371
|
this.dateTime = `${this.date} ${TItem.name}`;
|
|
296
372
|
this.timeSelectIndex = TIndex;
|
|
@@ -337,7 +413,15 @@
|
|
|
337
413
|
|
|
338
414
|
&-item {
|
|
339
415
|
padding: unit(30, rpx);
|
|
340
|
-
border-bottom: unit(1, rpx) solid #f0f0f0
|
|
416
|
+
border-bottom: unit(1, rpx) solid #f0f0f0;
|
|
417
|
+
text-align: right;
|
|
418
|
+
&-full {
|
|
419
|
+
padding: 10rpx;
|
|
420
|
+
background: rgba(235, 11, 11, 0.149);
|
|
421
|
+
color: #F40808;
|
|
422
|
+
border-radius: 10rpx;
|
|
423
|
+
margin-left: 20rpx;
|
|
424
|
+
}
|
|
341
425
|
}
|
|
342
426
|
}
|
|
343
427
|
}
|
|
@@ -157,6 +157,7 @@ export default {
|
|
|
157
157
|
//创建其他订单 is_use_jfb_pay = "N"
|
|
158
158
|
createOtherOrder(){
|
|
159
159
|
let other = this.getCreateOrderParams();
|
|
160
|
+
let address_nnid_items = this.handleGetAddressItems();
|
|
160
161
|
if(!other) return false;
|
|
161
162
|
this.$xdShowLoading({})
|
|
162
163
|
jfbRootExec("createOrder", {
|
|
@@ -169,6 +170,7 @@ export default {
|
|
|
169
170
|
namespace: this.xnamespace,
|
|
170
171
|
cart_order_id: this.order_id,
|
|
171
172
|
address_nnid: this.curAddr ? this.curAddr.address_nnid : "",
|
|
173
|
+
address_nnid_items,
|
|
172
174
|
notify_provider_id: this.projectAttr['notify_provider_id']
|
|
173
175
|
}
|
|
174
176
|
}).then(async res => {
|