fix:修复bug
This commit is contained in:
Vendored
+2
-2
@@ -4,7 +4,7 @@ NODE_ENV=development
|
|||||||
VITE_DELETE_CONSOLE=false
|
VITE_DELETE_CONSOLE=false
|
||||||
|
|
||||||
#本地环境
|
#本地环境
|
||||||
#VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api
|
VITE_SERVER_BASEURL=https://howhowfresh.com/prod-api
|
||||||
VITE_SERVER_BASEURL=http://192.168.5.33:8889
|
#VITE_SERVER_BASEURL=http://192.168.5.64:8080
|
||||||
#VITE_SERVER_BASEURL=http://192.168.0.148:8888
|
#VITE_SERVER_BASEURL=http://192.168.0.148:8888
|
||||||
#VITE_SERVER_BASEURL=http://liuyao.nat100.top/meiguowaimai
|
#VITE_SERVER_BASEURL=http://liuyao.nat100.top/meiguowaimai
|
||||||
@@ -261,6 +261,9 @@
|
|||||||
"onTheWay": "OTW",
|
"onTheWay": "OTW",
|
||||||
"title": "History"
|
"title": "History"
|
||||||
},
|
},
|
||||||
|
"store": {
|
||||||
|
"all": "All"
|
||||||
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"hot-title": "Popular Categories",
|
"hot-title": "Popular Categories",
|
||||||
"recently": "Recently",
|
"recently": "Recently",
|
||||||
@@ -516,6 +519,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages-user": {
|
"pages-user": {
|
||||||
|
"add-card": {
|
||||||
|
"loading": "Loading...",
|
||||||
|
"loadFailed": "Loading failed, please try again"
|
||||||
|
},
|
||||||
"balance": {
|
"balance": {
|
||||||
"all": "All",
|
"all": "All",
|
||||||
"detail-list": "Detail list",
|
"detail-list": "Detail list",
|
||||||
|
|||||||
@@ -261,6 +261,9 @@
|
|||||||
"onTheWay": "在路上",
|
"onTheWay": "在路上",
|
||||||
"title": "订单"
|
"title": "订单"
|
||||||
},
|
},
|
||||||
|
"store": {
|
||||||
|
"all": "全部"
|
||||||
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"hot-title": "热搜",
|
"hot-title": "热搜",
|
||||||
"recently": "历史记录",
|
"recently": "历史记录",
|
||||||
@@ -516,6 +519,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pages-user": {
|
"pages-user": {
|
||||||
|
"add-card": {
|
||||||
|
"loading": "加载中...",
|
||||||
|
"loadFailed": "加载失败,请重试"
|
||||||
|
},
|
||||||
"balance": {
|
"balance": {
|
||||||
"all": "全部",
|
"all": "全部",
|
||||||
"detail-list": "明细列表",
|
"detail-list": "明细列表",
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "CHEFLINK delivery",
|
"name" : "CHEFLINK delivery",
|
||||||
"appid" : "__UNI__06509BE",
|
"appid" : "__UNI__06509BE",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.11",
|
"versionName" : "1.0.13",
|
||||||
"versionCode" : 111,
|
"versionCode" : 113,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function getList(pageNum: number, pageSize: number) {
|
|||||||
recipeCategoryId:props.id
|
recipeCategoryId:props.id
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
resolve(res)
|
resolve(res.data)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ import {
|
|||||||
type MerchantVo,
|
type MerchantVo,
|
||||||
appMerchantOrderCalculatePriceCartPost,
|
appMerchantOrderCalculatePriceCartPost,
|
||||||
appUserCardSelectDefaultPost, appMerchantOrderCreateOrderCartPost, appMerchantOrderPayOrderPost,
|
appUserCardSelectDefaultPost, appMerchantOrderCreateOrderCartPost, appMerchantOrderPayOrderPost,
|
||||||
|
appMerchantOrderCreateOrderCartBatchPost,
|
||||||
|
appMerchantOrderCalculatePriceCartBatchPost,
|
||||||
|
appMerchantCartListMerchantPost,
|
||||||
|
appMerchantOrderPayOrderBatchPost
|
||||||
} from "@/service";
|
} from "@/service";
|
||||||
import useEventEmit from "@/hooks/useEventEmit";
|
import useEventEmit from "@/hooks/useEventEmit";
|
||||||
import {EventEnum} from "@/constant/enums";
|
import {EventEnum} from "@/constant/enums";
|
||||||
@@ -27,8 +31,8 @@ const userStore = useUserStore();
|
|||||||
// 送达偏好
|
// 送达偏好
|
||||||
const visitMethodRef = ref();
|
const visitMethodRef = ref();
|
||||||
const visitMethod = ref({
|
const visitMethod = ref({
|
||||||
value: 0,
|
value: 2,
|
||||||
label: t("components.visit.leaveItToMePersonally"),
|
label: t("components.visit.putItAtTheDoor"),
|
||||||
});
|
});
|
||||||
function chooseVisitMethod() {
|
function chooseVisitMethod() {
|
||||||
visitMethodRef.value?.onOpen(visitMethod.value.value);
|
visitMethodRef.value?.onOpen(visitMethod.value.value);
|
||||||
@@ -236,6 +240,8 @@ useEventEmit(EventEnum.CHOOSE_PAYMENT_METHOD, (data) => {
|
|||||||
|
|
||||||
|
|
||||||
const storeId = ref('')
|
const storeId = ref('')
|
||||||
|
const orderType = ref('') // 订单类型:batch-批量下单,normal-普通下单
|
||||||
|
const batchCartIds = ref([]) // 批量下单的购物车ID列表
|
||||||
const formData = ref<CreateOrderCartBo>({
|
const formData = ref<CreateOrderCartBo>({
|
||||||
orderRemark: '',
|
orderRemark: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
@@ -249,7 +255,26 @@ const formData = ref<CreateOrderCartBo>({
|
|||||||
const needTableware = ref(false)
|
const needTableware = ref(false)
|
||||||
onLoad((options: any)=> {
|
onLoad((options: any)=> {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
if(options.storeId) {
|
|
||||||
|
// 判断是批量下单还是普通下单
|
||||||
|
if(options.type == 'batch' && options.cartIds) {
|
||||||
|
// 批量下单模式
|
||||||
|
orderType.value = 'batch'
|
||||||
|
batchCartIds.value = options.cartIds.split(',')
|
||||||
|
console.log("下单类型",options.type);
|
||||||
|
|
||||||
|
// 默认取用户信息中的手机号作为收货手机号
|
||||||
|
formData.value.phone = userStore.userInfo.phone || ''
|
||||||
|
contact.value.areaCode = userStore.userInfo.areaCode || ''
|
||||||
|
// 获取用户地址列表
|
||||||
|
getAddressList()
|
||||||
|
// 查询批量购物车详情
|
||||||
|
getBatchCartInfo()
|
||||||
|
// 查询用户默认信用卡
|
||||||
|
appUserCardSelectDefault()
|
||||||
|
} else if(options.storeId) {
|
||||||
|
// 普通下单模式
|
||||||
|
orderType.value = 'normal'
|
||||||
storeId.value = options.storeId as string
|
storeId.value = options.storeId as string
|
||||||
formData.value.orderRemark = options.orderRemark as string
|
formData.value.orderRemark = options.orderRemark as string
|
||||||
|
|
||||||
@@ -310,11 +335,77 @@ function getCartInfo() {
|
|||||||
loading.value = false
|
loading.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量下单:查询购物车详情
|
||||||
|
async function getBatchCartInfo() {
|
||||||
|
try {
|
||||||
|
// 根据购物车ID列表,按店铺分组查询
|
||||||
|
const cartIds = batchCartIds.value
|
||||||
|
console.log('批量购物车ID列表', cartIds)
|
||||||
|
|
||||||
|
// 1. 先获取所有店铺列表
|
||||||
|
const merchantRes = await appMerchantCartListMerchantPost({});
|
||||||
|
console.log('批量模式-购物车店铺列表', merchantRes);
|
||||||
|
|
||||||
|
if (!merchantRes.data || merchantRes.data.length === 0) {
|
||||||
|
cartDataList.value = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 对每个店铺查询完整的商品信息
|
||||||
|
const merchantPromises = merchantRes.data.map(async (merchant: any) => {
|
||||||
|
try {
|
||||||
|
const cartRes = await appMerchantCartListByMerchantIdPost({
|
||||||
|
params: {
|
||||||
|
merchantId: merchant.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(`批量模式-店铺 ${merchant.merchantName} 的商品列表`, cartRes);
|
||||||
|
|
||||||
|
// 只保留选中的商品(根据 cartIds 过滤)
|
||||||
|
const filteredItems = (cartRes.data || []).filter((item: any) =>
|
||||||
|
cartIds.includes(String(item.id))
|
||||||
|
);
|
||||||
|
|
||||||
|
// 如果该店铺有选中的商品,才返回
|
||||||
|
if (filteredItems.length > 0) {
|
||||||
|
return {
|
||||||
|
...merchant,
|
||||||
|
merchantCartVoList: filteredItems
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`获取店铺 ${merchant.id} 商品失败`, error);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3. 等待所有店铺的商品信息加载完成,并过滤掉 null
|
||||||
|
const results = await Promise.all(merchantPromises);
|
||||||
|
cartDataList.value = results.filter(item => item !== null);
|
||||||
|
console.log('批量模式-最终购物车数据', cartDataList.value);
|
||||||
|
|
||||||
|
// 查询菜品会员折扣价
|
||||||
|
if(cartIds.length > 0) {
|
||||||
|
appMerchantCartCalculateSavings()
|
||||||
|
// 注意:价格计算会在地址加载完成后自动调用
|
||||||
|
// 这里不需要立即调用 appMerchantOrderCalculatePriceCart()
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取批量购物车详情失败', error)
|
||||||
|
cartDataList.value = [];
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 查询菜品会员折扣价
|
// 查询菜品会员折扣价
|
||||||
const cartSavingsData = ref({})
|
const cartSavingsData = ref({})
|
||||||
function appMerchantCartCalculateSavings() {
|
function appMerchantCartCalculateSavings() {
|
||||||
|
const cartIds = orderType.value == 'batch' ? batchCartIds.value : cartDataList.value.map(item => item.id)
|
||||||
appMerchantCartCalculateSavingsPost({
|
appMerchantCartCalculateSavingsPost({
|
||||||
body: cartDataList.value.map(item => item.id)
|
body: cartIds
|
||||||
}).then(res=> {
|
}).then(res=> {
|
||||||
console.log('菜品会员折扣价', res)
|
console.log('菜品会员折扣价', res)
|
||||||
cartSavingsData.value = res.data
|
cartSavingsData.value = res.data
|
||||||
@@ -390,21 +481,43 @@ function appMerchantOrderCalculatePriceCart() {
|
|||||||
// 优先使用新选择的地址id
|
// 优先使用新选择的地址id
|
||||||
const targetAddressId = selectedAddressId.value || currentAddressId.value
|
const targetAddressId = selectedAddressId.value || currentAddressId.value
|
||||||
// if(!targetAddressId) return
|
// if(!targetAddressId) return
|
||||||
appMerchantOrderCalculatePriceCartPost({
|
|
||||||
body: {
|
const cartIds = orderType.value == 'batch' ? batchCartIds.value : cartDataList.value.map(item => item.id)
|
||||||
addressId: targetAddressId,
|
|
||||||
cartIds: cartDataList.value.map(item => item.id),
|
// 批量模式使用批量计算价格接口
|
||||||
receiveMethod: deliveryMethod.value === 0 ? 1 : 2,
|
if(orderType.value == 'batch') {
|
||||||
couponId: couponInfo.value ? couponInfo.value.id : '',
|
appMerchantOrderCalculatePriceCartBatchPost({
|
||||||
tipDiscount: deliveryMethod.value === 1 ? 0 : (diyTipValue.value ? Number(diyTipValue.value) / 100 : (selectedTipIndex.value || 0) / 100), // 小费比例,自取订单不需要小费
|
body: {
|
||||||
// weeklyDeliveryFee: isWeeklyDelivery.value ? 1 : 2, // 是否支付周配送费(1-是 2-否)
|
addressId: targetAddressId,
|
||||||
phone: formData.value.phone,
|
cartIds: cartIds,
|
||||||
areaCode: contact.value.areaCode,
|
receiveMethod: deliveryMethod.value === 0 ? 1 : 2,
|
||||||
}
|
couponId: couponInfo.value ? couponInfo.value.id : '',
|
||||||
}).then(res=> {
|
tipDiscount: deliveryMethod.value === 1 ? 0 : (diyTipValue.value ? Number(diyTipValue.value) / 100 : (selectedTipIndex.value || 0) / 100), // 小费比例,自取订单不需要小费
|
||||||
console.log('购物车下单价格', res)
|
phone: formData.value.phone,
|
||||||
priceData.value = res.data
|
areaCode: contact.value.areaCode,
|
||||||
})
|
}
|
||||||
|
}).then(res=> {
|
||||||
|
console.log('批量购物车下单价格', res)
|
||||||
|
priceData.value = res.data
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
// 普通模式使用单店铺计算价格接口
|
||||||
|
appMerchantOrderCalculatePriceCartPost({
|
||||||
|
body: {
|
||||||
|
addressId: targetAddressId,
|
||||||
|
cartIds: cartIds,
|
||||||
|
receiveMethod: deliveryMethod.value === 0 ? 1 : 2,
|
||||||
|
couponId: couponInfo.value ? couponInfo.value.id : '',
|
||||||
|
tipDiscount: deliveryMethod.value === 1 ? 0 : (diyTipValue.value ? Number(diyTipValue.value) / 100 : (selectedTipIndex.value || 0) / 100), // 小费比例,自取订单不需要小费
|
||||||
|
// weeklyDeliveryFee: isWeeklyDelivery.value ? 1 : 2, // 是否支付周配送费(1-是 2-否)
|
||||||
|
phone: formData.value.phone,
|
||||||
|
areaCode: contact.value.areaCode,
|
||||||
|
}
|
||||||
|
}).then(res=> {
|
||||||
|
console.log('购物车下单价格', res)
|
||||||
|
priceData.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户地址列表
|
// 获取用户地址列表
|
||||||
@@ -439,9 +552,16 @@ function getAddressList() {
|
|||||||
// 回显送达偏好
|
// 回显送达偏好
|
||||||
if(+data.deliveryRemark === 1) {
|
if(+data.deliveryRemark === 1) {
|
||||||
visitMethod.value.label = t('components.visit.leaveItToMePersonally')
|
visitMethod.value.label = t('components.visit.leaveItToMePersonally')
|
||||||
|
visitMethod.value.value = 1
|
||||||
}
|
}
|
||||||
if(+data.deliveryRemark === 2) {
|
if(+data.deliveryRemark === 2) {
|
||||||
visitMethod.value.label = t('components.visit.putItAtTheDoor')
|
visitMethod.value.label = t('components.visit.putItAtTheDoor')
|
||||||
|
visitMethod.value.value = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是批量模式,地址加载完成后重新计算价格
|
||||||
|
if(orderType.value === 'batch') {
|
||||||
|
appMerchantOrderCalculatePriceCart()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -495,6 +615,7 @@ const isShowWeeklyDelivery = computed(()=> {
|
|||||||
|
|
||||||
const passwordInputRef = ref(null)
|
const passwordInputRef = ref(null)
|
||||||
const resOrderId = ref('')
|
const resOrderId = ref('')
|
||||||
|
const resOrderIds = ref([]) // 批量下单返回的订单ID列表
|
||||||
function handleGoSettle() {
|
function handleGoSettle() {
|
||||||
// 优先使用新选择的地址id
|
// 优先使用新选择的地址id
|
||||||
const targetAddressId = selectedAddressId.value || currentAddressId.value
|
const targetAddressId = selectedAddressId.value || currentAddressId.value
|
||||||
@@ -512,59 +633,116 @@ function handleGoSettle() {
|
|||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if(!resOrderId.value) {
|
|
||||||
let data = {
|
|
||||||
addressId: targetAddressId,
|
|
||||||
phone: formData.value.phone,
|
|
||||||
areaCode: contact.value.areaCode,
|
|
||||||
cartIds: cartDataList.value.map(item => item.id),
|
|
||||||
couponId: couponInfo.value ? couponInfo.value.id : '',
|
|
||||||
deliveryMethod: visitMethod.value.label, // 派送方式(如放门口或者交到顾客手中)
|
|
||||||
deliveryType: deliveryTimeType.value, // 1-立即交付 2-预约交付
|
|
||||||
orderRemark: formData.value.orderRemark,
|
|
||||||
receiveMethod: deliveryMethod.value === 0 ? 1 : 2, // 收货方式(1-派送 2-自取)
|
|
||||||
startScheduledTime: '', //
|
|
||||||
endScheduledTime: '', //
|
|
||||||
tipDiscount: deliveryMethod.value === 1 ? 0 : (diyTipValue.value ? Number(diyTipValue.value) / 100 : (selectedTipIndex.value || 0) / 100), // 小费比例,自取订单不需要小费
|
|
||||||
// weeklyDeliveryFee: isWeeklyDelivery.value ? 1 : 2, // 是否支付周配送费(1-是 2-否)
|
|
||||||
needTableware: needTableware.value ? 1 : 2, // 餐具 1是 2否
|
|
||||||
}
|
|
||||||
|
|
||||||
// 如果是预约派送
|
// 批量下单
|
||||||
if(deliveryTimeType.value === 1) {
|
if(orderType.value == 'batch') {
|
||||||
const result = getTimeStamps(showDeliveryTime.value);
|
if(resOrderIds.value.length === 0) {
|
||||||
data.startScheduledTime = result.startTimestamp
|
let data = {
|
||||||
data.endScheduledTime = result.endTimestamp
|
addressId: targetAddressId,
|
||||||
|
phone: formData.value.phone,
|
||||||
|
areaCode: contact.value.areaCode,
|
||||||
|
cartIds: batchCartIds.value,
|
||||||
|
couponId: couponInfo.value ? couponInfo.value.id : '',
|
||||||
|
deliveryMethod: visitMethod.value.label, // 派送方式(如放门口或者交到顾客手中)
|
||||||
|
deliveryType: deliveryTimeType.value, // 1-立即交付 2-预约交付
|
||||||
|
orderRemark: formData.value.orderRemark,
|
||||||
|
receiveMethod: deliveryMethod.value === 0 ? 1 : 2, // 收货方式(1-派送 2-自取)
|
||||||
|
startScheduledTime: '', //
|
||||||
|
endScheduledTime: '', //
|
||||||
|
tipDiscount: deliveryMethod.value === 1 ? 0 : (diyTipValue.value ? Number(diyTipValue.value) / 100 : (selectedTipIndex.value || 0) / 100), // 小费比例,自取订单不需要小费
|
||||||
|
needTableware: needTableware.value ? 1 : 2, // 餐具 1是 2否
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是预约派送
|
||||||
|
if(deliveryTimeType.value === 1) {
|
||||||
|
const result = getTimeStamps(showDeliveryTime.value);
|
||||||
|
data.startScheduledTime = result.startTimestamp
|
||||||
|
data.endScheduledTime = result.endTimestamp
|
||||||
|
} else {
|
||||||
|
data.startScheduledTime = diyTime.value.startTime
|
||||||
|
data.endScheduledTime = diyTime.value.endTime
|
||||||
|
}
|
||||||
|
console.log('批量下单参数', data)
|
||||||
|
appMerchantOrderCreateOrderCartBatchPost({
|
||||||
|
body: data
|
||||||
|
}).then(res=> {
|
||||||
|
console.log('批量下单成功', res)
|
||||||
|
resOrderIds.value = res.data.orderIds || []
|
||||||
|
// 如果是余额支付,弹出支付密码弹窗
|
||||||
|
if(payMethodOptions.value.payMethod === 2) {
|
||||||
|
passwordInputRef.value?.showPasswordInput()
|
||||||
|
} else {
|
||||||
|
appMerchantOrderPayOrderBatch()
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
data.startScheduledTime = diyTime.value.startTime
|
// 如果是余额支付,弹出支付密码弹窗
|
||||||
data.endScheduledTime = diyTime.value.endTime
|
if(payMethodOptions.value.payMethod === 2) {
|
||||||
|
passwordInputRef.value?.showPasswordInput()
|
||||||
|
} else {
|
||||||
|
appMerchantOrderPayOrderBatch()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
console.log('下单参数', data)
|
} else {
|
||||||
appMerchantOrderCreateOrderCartPost({
|
// 普通下单
|
||||||
body: data
|
if(!resOrderId.value) {
|
||||||
}).then(res=> {
|
let data = {
|
||||||
console.log('下单成功', res)
|
addressId: targetAddressId,
|
||||||
resOrderId.value = res.data || ''
|
phone: formData.value.phone,
|
||||||
|
areaCode: contact.value.areaCode,
|
||||||
|
cartIds: cartDataList.value.map(item => item.id),
|
||||||
|
couponId: couponInfo.value ? couponInfo.value.id : '',
|
||||||
|
deliveryMethod: visitMethod.value.label, // 派送方式(如放门口或者交到顾客手中)
|
||||||
|
deliveryType: deliveryTimeType.value, // 1-立即交付 2-预约交付
|
||||||
|
orderRemark: formData.value.orderRemark,
|
||||||
|
receiveMethod: deliveryMethod.value === 0 ? 1 : 2, // 收货方式(1-派送 2-自取)
|
||||||
|
startScheduledTime: '', //
|
||||||
|
endScheduledTime: '', //
|
||||||
|
tipDiscount: deliveryMethod.value === 1 ? 0 : (diyTipValue.value ? Number(diyTipValue.value) / 100 : (selectedTipIndex.value || 0) / 100), // 小费比例,自取订单不需要小费
|
||||||
|
// weeklyDeliveryFee: isWeeklyDelivery.value ? 1 : 2, // 是否支付周配送费(1-是 2-否)
|
||||||
|
needTableware: needTableware.value ? 1 : 2, // 餐具 1是 2否
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果是预约派送
|
||||||
|
if(deliveryTimeType.value === 1) {
|
||||||
|
const result = getTimeStamps(showDeliveryTime.value);
|
||||||
|
data.startScheduledTime = result.startTimestamp
|
||||||
|
data.endScheduledTime = result.endTimestamp
|
||||||
|
} else {
|
||||||
|
data.startScheduledTime = diyTime.value.startTime
|
||||||
|
data.endScheduledTime = diyTime.value.endTime
|
||||||
|
}
|
||||||
|
console.log('下单参数', data)
|
||||||
|
appMerchantOrderCreateOrderCartPost({
|
||||||
|
body: data
|
||||||
|
}).then(res=> {
|
||||||
|
console.log('下单成功', res)
|
||||||
|
resOrderId.value = res.data || ''
|
||||||
|
// 如果是余额支付,弹出支付密码弹窗
|
||||||
|
if(payMethodOptions.value.payMethod === 2) {
|
||||||
|
passwordInputRef.value?.showPasswordInput()
|
||||||
|
} else {
|
||||||
|
appMerchantOrderPayOrder()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
// 如果是余额支付,弹出支付密码弹窗
|
// 如果是余额支付,弹出支付密码弹窗
|
||||||
if(payMethodOptions.value.payMethod === 2) {
|
if(payMethodOptions.value.payMethod === 2) {
|
||||||
passwordInputRef.value?.showPasswordInput()
|
passwordInputRef.value?.showPasswordInput()
|
||||||
} else {
|
} else {
|
||||||
appMerchantOrderPayOrder()
|
appMerchantOrderPayOrder()
|
||||||
}
|
}
|
||||||
})
|
|
||||||
} else {
|
|
||||||
// 如果是余额支付,弹出支付密码弹窗
|
|
||||||
if(payMethodOptions.value.payMethod === 2) {
|
|
||||||
passwordInputRef.value?.showPasswordInput()
|
|
||||||
} else {
|
|
||||||
appMerchantOrderPayOrder()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function payPawSuccess(password: string) {
|
function payPawSuccess(password: string) {
|
||||||
payMethodOptions.value.payPassword = password
|
payMethodOptions.value.payPassword = password
|
||||||
appMerchantOrderPayOrder()
|
if(orderType.value === 'batch') {
|
||||||
|
appMerchantOrderPayOrderBatch()
|
||||||
|
} else {
|
||||||
|
appMerchantOrderPayOrder()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function appMerchantOrderPayOrder() {
|
function appMerchantOrderPayOrder() {
|
||||||
@@ -588,6 +766,37 @@ function appMerchantOrderPayOrder() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量订单支付
|
||||||
|
function appMerchantOrderPayOrderBatch() {
|
||||||
|
// 使用批量支付接口
|
||||||
|
appMerchantOrderPayOrderBatchPost({
|
||||||
|
body: {
|
||||||
|
orderIds: resOrderIds.value,
|
||||||
|
cardId: payMethodOptions.value.cardId,
|
||||||
|
payMethod: payMethodOptions.value.payMethod,
|
||||||
|
payPassword: payMethodOptions.value.payPassword
|
||||||
|
}
|
||||||
|
}).then(res=> {
|
||||||
|
console.log('批量支付结果', res)
|
||||||
|
uni.showToast({
|
||||||
|
title: t('pages-store.checkout.paymentSuccess'),
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
|
||||||
|
setTimeout(()=> {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 2,
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('批量支付失败', err)
|
||||||
|
uni.showToast({
|
||||||
|
title: '支付失败',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
function getTimeStamps(timeStr: string) {
|
function getTimeStamps(timeStr: string) {
|
||||||
// 验证输入是否为空
|
// 验证输入是否为空
|
||||||
if (!timeStr || typeof timeStr !== 'string') {
|
if (!timeStr || typeof timeStr !== 'string') {
|
||||||
@@ -980,7 +1189,7 @@ function handleClose() {
|
|||||||
<view class="w-full h-10rpx bg-#F6F6F6"></view>
|
<view class="w-full h-10rpx bg-#F6F6F6"></view>
|
||||||
|
|
||||||
<!-- 订单信息摘要 -->
|
<!-- 订单信息摘要 -->
|
||||||
<view class="pt-36rpx pb-36rpx">
|
<view class="pt-36rpx pb-36rpx" v-if="orderType === 'normal' && cartDataList.length > 0">
|
||||||
<text
|
<text
|
||||||
class="px-30rpx text-32rpx lh-32rpx font-500 text-#333 block mb-10rpx"
|
class="px-30rpx text-32rpx lh-32rpx font-500 text-#333 block mb-10rpx"
|
||||||
>{{ t("pages-store.checkout.orderInfoSummary") }}</text
|
>{{ t("pages-store.checkout.orderInfoSummary") }}</text
|
||||||
@@ -1042,7 +1251,102 @@ function handleClose() {
|
|||||||
</template>
|
</template>
|
||||||
</wd-collapse-item>
|
</wd-collapse-item>
|
||||||
</wd-collapse>
|
</wd-collapse>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 批量模式:多店铺列表 -->
|
||||||
|
<view class="pt-36rpx pb-36rpx" v-if="orderType === 'batch' && cartDataList.length > 0">
|
||||||
|
<text
|
||||||
|
class="px-30rpx text-32rpx lh-32rpx font-500 text-#333 block mb-20rpx"
|
||||||
|
>{{ t("pages-store.checkout.orderInfoSummary") }}</text
|
||||||
|
>
|
||||||
|
<view class="px-30rpx">
|
||||||
|
<view
|
||||||
|
v-for="(merchant, merchantIndex) in cartDataList"
|
||||||
|
:key="merchant.id"
|
||||||
|
class="mb-20rpx rounded-16rpx border-1rpx border-solid border-[#E8E8E8] overflow-hidden"
|
||||||
|
>
|
||||||
|
<!-- 店铺头部 -->
|
||||||
|
<view class="p-20rpx flex items-center bg-#F6F6F6">
|
||||||
|
<image
|
||||||
|
class="w-60rpx h-60rpx rounded-50% mr-20rpx"
|
||||||
|
:src="merchant.logo"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
<view>
|
||||||
|
<view class="text-28rpx lh-28rpx text-#333 font-500"
|
||||||
|
>{{ merchant.merchantName }}</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
class="text-24rpx lh-24rpx text-#7D7D7D font-400 mt-8rpx"
|
||||||
|
>{{ merchant.merchantCartVoList.length }} {{ t('pages-user.cart.items') }}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品列表 -->
|
||||||
|
<view class="px-20rpx">
|
||||||
|
<view
|
||||||
|
v-for="(item, itemIndex) in merchant.merchantCartVoList"
|
||||||
|
:key="item.id"
|
||||||
|
class="py-20rpx flex items-start"
|
||||||
|
:class="itemIndex < merchant.merchantCartVoList.length - 1 ? 'border-bottom border-[#F2F2F2]' : ''"
|
||||||
|
>
|
||||||
|
<!-- 商品图片 -->
|
||||||
|
<image
|
||||||
|
:src="item.merchantDishVo?.dishImage?.split(',')[0]"
|
||||||
|
mode="aspectFill"
|
||||||
|
class="w-100rpx h-100rpx shrink-0 rounded-12rpx"
|
||||||
|
></image>
|
||||||
|
|
||||||
|
<!-- 商品信息 -->
|
||||||
|
<view class="ml-16rpx flex-1">
|
||||||
|
<view class="text-[#333333] text-26rpx lh-36rpx font-500 line-clamp-2">{{
|
||||||
|
item.merchantDishVo?.dishName
|
||||||
|
}}</view>
|
||||||
|
|
||||||
|
<!-- 配菜信息 -->
|
||||||
|
<view class="text-[#7D7D7D] text-22rpx lh-26rpx mt-8rpx" v-if="item.sideDishList?.length > 0">
|
||||||
|
<template v-for="dish in item.sideDishList">
|
||||||
|
<text class="mr-6rpx">
|
||||||
|
{{ dish?.merchantSideDishItemVo?.name || '' }}
|
||||||
|
</text>
|
||||||
|
<text v-if="dish?.merchantSideDishItemVo?.price" class="text-#00A76D mr-10rpx">+${{ dish?.merchantSideDishItemVo?.price }}</text>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 价格和数量 -->
|
||||||
|
<view class="flex items-center justify-between mt-12rpx">
|
||||||
|
<view class="flex items-center">
|
||||||
|
<text class="text-[#333333] text-28rpx font-500"
|
||||||
|
>${{ item.merchantDishVo?.discountPrice }}</text>
|
||||||
|
<text
|
||||||
|
v-if="item.merchantDishVo?.originalPrice && item.merchantDishVo?.originalPrice !== item.merchantDishVo?.discountPrice"
|
||||||
|
class="text-[#7D7D7D] text-22rpx line-through ml-8rpx"
|
||||||
|
>${{ item.merchantDishVo?.originalPrice }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="text-[#7D7D7D] text-22rpx">
|
||||||
|
x{{ item.count }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 批量模式且没有数据时的提示 -->
|
||||||
|
<view class="pt-36rpx pb-36rpx" v-if="orderType === 'batch' && cartDataList.length === 0">
|
||||||
|
<text
|
||||||
|
class="px-30rpx text-32rpx lh-32rpx font-500 text-#333 block mb-10rpx"
|
||||||
|
>{{ t("pages-store.checkout.orderInfoSummary") }}</text
|
||||||
|
>
|
||||||
|
<view class="px-30rpx py-40rpx text-center">
|
||||||
|
<text class="text-28rpx text-#7D7D7D">已选择 {{ batchCartIds.length }} 件商品</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="pt-36rpx pb-36rpx" >
|
||||||
<!-- 优惠券 -->
|
<!-- 优惠券 -->
|
||||||
<view @click="navigateToCoupon" class="flex-center-sb border-bottom py-36rpx px-30rpx gap-20rpx">
|
<view @click="navigateToCoupon" class="flex-center-sb border-bottom py-36rpx px-30rpx gap-20rpx">
|
||||||
<view class="flex-center-sb flex-1">
|
<view class="flex-center-sb flex-1">
|
||||||
@@ -1173,7 +1477,8 @@ function handleClose() {
|
|||||||
<view class="border-bottom px-30rpx py-32rpx">
|
<view class="border-bottom px-30rpx py-32rpx">
|
||||||
<view class="flex-center-sb mb-40rpx text-32rpx lh-32rpx text-#333">
|
<view class="flex-center-sb mb-40rpx text-32rpx lh-32rpx text-#333">
|
||||||
<text>{{ t('pages-store.order.subtotal') }}</text>
|
<text>{{ t('pages-store.order.subtotal') }}</text>
|
||||||
<text>${{ priceData?.actualAmount }}</text>
|
<text v-if="orderType === 'batch'">${{ priceData?.totalActualAmount || '0.00' }}</text>
|
||||||
|
<text v-else>${{ priceData?.actualAmount || '0.00' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-center-sb mb-40rpx text-32rpx lh-32rpx text-#333">
|
<view class="flex-center-sb mb-40rpx text-32rpx lh-32rpx text-#333">
|
||||||
<view @click="openPriceDetail" class="flex items-center">
|
<view @click="openPriceDetail" class="flex items-center">
|
||||||
@@ -1184,13 +1489,17 @@ function handleClose() {
|
|||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view v-if="orderType === 'batch'">
|
||||||
<text>${{ (Number(priceData?.tax) + Number(priceData?.tip) + Number(priceData?.deliveryFee)).toFixed(2) }}</text>
|
<text>${{ (Number(priceData?.totalTax || 0) + Number(priceData?.totalTip || 0) + Number(priceData?.totalDeliveryFee || 0)).toFixed(2) }}</text>
|
||||||
|
</view>
|
||||||
|
<view v-else>
|
||||||
|
<text>${{ (Number(priceData?.tax || 0) + Number(priceData?.tip || 0) + Number(priceData?.deliveryFee || 0)).toFixed(2) }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-center-sb text-32rpx lh-32rpx text-#333 font-500">
|
<view class="flex-center-sb text-32rpx lh-32rpx text-#333 font-500">
|
||||||
<text>{{ t('pages-store.order.total') }}</text>
|
<text>{{ t('pages-store.order.total') }}</text>
|
||||||
<text>${{ priceData?.paidAmount }}</text>
|
<text v-if="orderType === 'batch'">${{ priceData?.totalPaidAmount || '0.00' }}</text>
|
||||||
|
<text v-else>${{ priceData?.paidAmount || '0.00' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -1245,19 +1554,24 @@ function handleClose() {
|
|||||||
</view>
|
</view>
|
||||||
<view class="px-30rpx py-18rpx">
|
<view class="px-30rpx py-18rpx">
|
||||||
<wd-button
|
<wd-button
|
||||||
v-if="showDeliverySwitch"
|
|
||||||
@click="handleGoSettle"
|
@click="handleGoSettle"
|
||||||
custom-class="!h-92rpx !text-30rpx !text-#fff !lh-92rpx !rounded-16rpx"
|
custom-class="!h-92rpx !text-30rpx !text-#fff !lh-92rpx !rounded-16rpx"
|
||||||
block
|
block
|
||||||
>{{ t('common.goSettle') }}
|
>{{ t('common.goSettle') }}
|
||||||
</wd-button>
|
</wd-button>
|
||||||
|
<!-- <wd-button
|
||||||
<wd-button
|
v-if="showDeliverySwitch"
|
||||||
|
@click="handleGoSettle"
|
||||||
|
custom-class="!h-92rpx !text-30rpx !text-#fff !lh-92rpx !rounded-16rpx"
|
||||||
|
block
|
||||||
|
>{{ t('common.goSettle') }}
|
||||||
|
</wd-button> -->
|
||||||
|
<!-- <wd-button
|
||||||
v-else
|
v-else
|
||||||
custom-class="!h-92rpx !text-30rpx !text-#fff !lh-92rpx !rounded-16rpx"
|
custom-class="!h-92rpx !text-30rpx !text-#fff !lh-92rpx !rounded-16rpx"
|
||||||
block
|
block
|
||||||
>{{ t('pages-store.checkout.notActivated') }}
|
>{{ t('pages-store.checkout.notActivated') }}
|
||||||
</wd-button>
|
</wd-button> -->
|
||||||
</view>
|
</view>
|
||||||
<view :style="[configStore.iosSafeBottomPlaceholder]"></view>
|
<view :style="[configStore.iosSafeBottomPlaceholder]"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { useScrollThreshold } from '@/hooks/useScrollThreshold'
|
|||||||
import {
|
import {
|
||||||
appCollectCollectPost, appMerchantCartCalculateSavingsPost, appMerchantCartListByMerchantIdPost,
|
appCollectCollectPost, appMerchantCartCalculateSavingsPost, appMerchantCartListByMerchantIdPost,
|
||||||
appMerchantDetailMerchantIdGet,
|
appMerchantDetailMerchantIdGet,
|
||||||
|
appMerchantDishDishIdGet,
|
||||||
appMerchantMenuMenuListByUserPost, type MerchantCartVo,
|
appMerchantMenuMenuListByUserPost, type MerchantCartVo,
|
||||||
type MerchantVo
|
type MerchantVo
|
||||||
} from "@/service";
|
} from "@/service";
|
||||||
@@ -138,7 +139,7 @@ function getStoreDetail() {
|
|||||||
console.log('商家详情', res)
|
console.log('商家详情', res)
|
||||||
storeDetail.value = res.data as MerchantVo
|
storeDetail.value = res.data as MerchantVo
|
||||||
|
|
||||||
getMerchantCouponReceiveList()
|
// getMerchantCouponReceiveList()
|
||||||
|
|
||||||
// 解析营业时间并判断闭店提示
|
// 解析营业时间并判断闭店提示
|
||||||
if (res.data.businessHours) {
|
if (res.data.businessHours) {
|
||||||
@@ -149,13 +150,19 @@ function getStoreDetail() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(res.data.merchantMenuVoList && res.data.merchantMenuVoList.length > 0) {
|
if(res.data.merchantCategoryIds && res.data.merchantCategoryIds.length > 0) {
|
||||||
tabs.value = res.data.merchantMenuVoList.map((item) => {
|
tabs.value = [
|
||||||
return {
|
{
|
||||||
title: item.menuName,
|
title: t('pages.store.all'),
|
||||||
key: item.id
|
key: ''
|
||||||
}
|
},
|
||||||
})
|
...res.data.merchantCategoryIds.map((item) => {
|
||||||
|
return {
|
||||||
|
title: item.menuName,
|
||||||
|
key: item.id
|
||||||
|
}
|
||||||
|
})
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
// 商户的经纬度存在,并且用户的经纬度也存在
|
// 商户的经纬度存在,并且用户的经纬度也存在
|
||||||
@@ -283,7 +290,90 @@ function handleClickSegmented(index: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const activeTab = ref(0);
|
const activeTab = ref(0);
|
||||||
const tabs = ref([]);
|
const tabs = ref<any[]>([]);
|
||||||
|
|
||||||
|
// 分页相关状态
|
||||||
|
const pageNum = ref(1);
|
||||||
|
const pageSize = ref(10);
|
||||||
|
const hasMore = ref(true);
|
||||||
|
const isLoadingMore = ref(false);
|
||||||
|
const dishListByQuery = ref<any[]>([]);
|
||||||
|
|
||||||
|
// 计算当前显示的商品列表
|
||||||
|
const currentDishList = computed(() => {
|
||||||
|
if(tabs.value[activeTab.value].key==''&&pageNum.value===1){
|
||||||
|
return storeDetail.value?.dishPage?.records
|
||||||
|
}
|
||||||
|
console.log(tabs.value[activeTab.value].key=='');
|
||||||
|
// 使用 dishListByQuery 作为数据源
|
||||||
|
return dishListByQuery.value || []
|
||||||
|
})
|
||||||
|
|
||||||
|
// 加载菜品列表
|
||||||
|
async function loadDishList(isLoadMore = false) {
|
||||||
|
if (isLoadingMore.value) return;
|
||||||
|
|
||||||
|
const currentTab = tabs.value[activeTab.value];
|
||||||
|
if (!currentTab) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
isLoadingMore.value = true;
|
||||||
|
|
||||||
|
// 构建请求参数
|
||||||
|
const body: any = {
|
||||||
|
merchantId: storeID.value,
|
||||||
|
pageNum: isLoadMore ? pageNum.value : 1,
|
||||||
|
pageSize: pageSize.value
|
||||||
|
};
|
||||||
|
|
||||||
|
// 如果选中的tab的key不为空,则传递menuId
|
||||||
|
if (currentTab.key !== '') {
|
||||||
|
body.menuId = currentTab.key;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('加载菜品列表参数', body);
|
||||||
|
|
||||||
|
const res = await appMerchantDishDishIdGet({ body });
|
||||||
|
|
||||||
|
if (res.data && res.data.rows) {
|
||||||
|
if (isLoadMore) {
|
||||||
|
// 加载更多,追加数据
|
||||||
|
dishListByQuery.value = [
|
||||||
|
...dishListByQuery.value,
|
||||||
|
...res.data.rows
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
// 首次加载或刷新
|
||||||
|
dishListByQuery.value = res.data.rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新分页信息
|
||||||
|
hasMore.value = res.data.rows.length >= pageSize.value;
|
||||||
|
|
||||||
|
if (isLoadMore) {
|
||||||
|
pageNum.value++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载菜品列表失败:', error);
|
||||||
|
} finally {
|
||||||
|
isLoadingMore.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听tab切换,重置分页并加载数据
|
||||||
|
watch(activeTab, () => {
|
||||||
|
pageNum.value = 1;
|
||||||
|
hasMore.value = true;
|
||||||
|
loadDishList(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 触底加载更多
|
||||||
|
onReachBottom(() => {
|
||||||
|
if (hasMore.value && !isLoadingMore.value) {
|
||||||
|
loadDishList(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
const showStatusBar = useScrollThreshold()
|
const showStatusBar = useScrollThreshold()
|
||||||
onPageScroll((e) => {
|
onPageScroll((e) => {
|
||||||
@@ -540,9 +630,9 @@ function handleShare() {
|
|||||||
<view class="box mt--6px"></view>
|
<view class="box mt--6px"></view>
|
||||||
|
|
||||||
<view v-if="tabs.length > 0" class="px-30rpx pb-120rpx">
|
<view v-if="tabs.length > 0" class="px-30rpx pb-120rpx">
|
||||||
<view v-if="storeDetail?.merchantMenuVoList[activeTab]?.dishList.length > 0" class="text-40rpx lh-40rpx font-500 my-36rpx">{{ t('pages-store.store.recommend') }}</view>
|
<view v-if="currentDishList.length > 0" class="text-40rpx lh-40rpx font-500 my-36rpx">{{ t('pages-store.store.recommend') }}</view>
|
||||||
<view v-if="storeDetail?.merchantMenuVoList[activeTab]?.dishList.length > 0" class="grid grid-cols-2 gap-30rpx">
|
<view v-if="currentDishList.length > 0" class="grid grid-cols-2 gap-30rpx">
|
||||||
<template v-for="item in storeDetail?.merchantMenuVoList[activeTab]?.dishList">
|
<template v-for="item in currentDishList">
|
||||||
<view @click="navigateToDishes(item)" class="w-100% mb-10rpx">
|
<view @click="navigateToDishes(item)" class="w-100% mb-10rpx">
|
||||||
<view class="relative h-248rpx rounded-24rpx mb-28rpx">
|
<view class="relative h-248rpx rounded-24rpx mb-28rpx">
|
||||||
<view @click.stop="handleDishCollectionClick(item)" class="w-68rpx h-68rpx absolute z-2 top-0 right-0">
|
<view @click.stop="handleDishCollectionClick(item)" class="w-68rpx h-68rpx absolute z-2 top-0 right-0">
|
||||||
@@ -563,6 +653,13 @@ function handleShare() {
|
|||||||
:src="item?.dishImage?.split(',')[0]"
|
:src="item?.dishImage?.split(',')[0]"
|
||||||
mode="aspectFill"
|
mode="aspectFill"
|
||||||
class="w-full h-full rounded-24rpx bg-common"
|
class="w-full h-full rounded-24rpx bg-common"
|
||||||
|
v-if="item.dishImage.split(',').length > 0"
|
||||||
|
/>
|
||||||
|
<image
|
||||||
|
:src="item?.dishImage"
|
||||||
|
mode="aspectFill"
|
||||||
|
class="w-full h-full rounded-24rpx bg-common"
|
||||||
|
v-else
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="line-clamp-1 text-30rpx text-#333 font-500">
|
<view class="line-clamp-1 text-30rpx text-#333 font-500">
|
||||||
|
|||||||
@@ -97,29 +97,47 @@ export default {
|
|||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log('mounted')
|
console.log('mounted')
|
||||||
|
const locale = uni.getStorageSync('UNI_LOCALE') || 'en'
|
||||||
|
const loadingText = locale === 'zh-Hans' ? '加载中...' : 'Loading...'
|
||||||
|
uni.showLoading({
|
||||||
|
title: loadingText,
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
this.init()
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async init(){
|
async init(){
|
||||||
console.log('本次初始化使用的key', Config.stripeKey)
|
try {
|
||||||
loadStripe.setLoadParameters({advancedFraudSignals: false});
|
console.log('本次初始化使用的key', Config.stripeKey)
|
||||||
const stripe = await loadStripe(Config.stripeKey);
|
loadStripe.setLoadParameters({advancedFraudSignals: false});
|
||||||
this.stripe=stripe
|
const stripe = await loadStripe(Config.stripeKey);
|
||||||
console.log(stripe)
|
this.stripe=stripe
|
||||||
const options = {
|
console.log(stripe)
|
||||||
appearance: {/*...*/},
|
const options = {
|
||||||
};
|
appearance: {/*...*/},
|
||||||
this.elements = stripe.elements(options);
|
};
|
||||||
const paymentElement = this.elements.create('card',{disableLink:true});
|
this.elements = stripe.elements(options);
|
||||||
paymentElement.mount('#payment-form');
|
const paymentElement = this.elements.create('card',{disableLink:true});
|
||||||
this.elements.get
|
paymentElement.mount('#payment-form');
|
||||||
paymentElement.on('change', (event)=> {
|
this.elements.get
|
||||||
console.log(event)
|
paymentElement.on('change', (event)=> {
|
||||||
if (event.complete) {
|
console.log(event)
|
||||||
this.isCompleted = true
|
if (event.complete) {
|
||||||
// enable payment button
|
this.isCompleted = true
|
||||||
}
|
// enable payment button
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
uni.hideLoading()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('初始化失败', error)
|
||||||
|
uni.hideLoading()
|
||||||
|
const locale = uni.getStorageSync('UNI_LOCALE') || 'en'
|
||||||
|
const errorText = locale === 'zh-Hans' ? '加载失败,请重试' : 'Loading failed, please try again'
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: errorText
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async handleSubmit(isSubmit){
|
async handleSubmit(isSubmit){
|
||||||
console.log('handleSubmit',isSubmit,this.isCompleted)
|
console.log('handleSubmit',isSubmit,this.isCompleted)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {appMerchantCartDeleteByMerchantIdPost, appMerchantCartListMerchantPost} from "@/service";
|
import {appMerchantCartDeleteByMerchantIdPost, appMerchantCartListMerchantPost, appMerchantCartDeleteCartPost, appMerchantCartCalculateSavingsPost, appMerchantCartListByMerchantIdPost} from "@/service";
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
import { useMessage } from "wot-design-uni";
|
import { useMessage } from "wot-design-uni";
|
||||||
@@ -9,36 +9,125 @@ const message = useMessage();
|
|||||||
|
|
||||||
const removeCartRef = ref<InstanceType<typeof RemoveCart>>();
|
const removeCartRef = ref<InstanceType<typeof RemoveCart>>();
|
||||||
|
|
||||||
// 模拟数据
|
// 购物车商品接口
|
||||||
interface CartStore {
|
interface CartItem {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
dishId: string;
|
||||||
image: string;
|
merchantId: string;
|
||||||
itemCount: number;
|
count: number;
|
||||||
totalPrice: number;
|
merchantDishVo: any;
|
||||||
deliveryAddress: string;
|
sideDishList: any[];
|
||||||
|
checked: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cartStores = ref<CartStore[]>([
|
// 购物车店铺接口
|
||||||
{
|
interface CartMerchant {
|
||||||
id: "1",
|
id: string;
|
||||||
name: "Chuanwei Prefecture",
|
merchantName: string;
|
||||||
image:
|
logo: string;
|
||||||
"https://cdn.pixabay.com/photo/2020/05/29/04/16/chinese-5233488_640.jpg",
|
merchantAddress: string;
|
||||||
itemCount: 3,
|
cartTotalPrice: number;
|
||||||
totalPrice: 96.0,
|
merchantCartVoList: CartItem[];
|
||||||
deliveryAddress: "New York",
|
allChecked: boolean; // 店铺内商品是否全选
|
||||||
},
|
}
|
||||||
{
|
|
||||||
id: "2",
|
const dataList = ref<CartMerchant[]>([]);
|
||||||
name: "Valley Congee",
|
|
||||||
image:
|
// 全选状态
|
||||||
"https://cdn.pixabay.com/photo/2020/05/29/04/16/chinese-5233488_640.jpg",
|
const allChecked = ref(false);
|
||||||
itemCount: 2,
|
|
||||||
totalPrice: 79.9,
|
// 计算所有选中的商品
|
||||||
deliveryAddress: "New York",
|
const selectedCartItems = computed(() => {
|
||||||
},
|
const items: CartItem[] = [];
|
||||||
]);
|
dataList.value.forEach(merchant => {
|
||||||
|
merchant.merchantCartVoList.forEach(item => {
|
||||||
|
if (item.checked) {
|
||||||
|
items.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return items;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 计算选中商品总数
|
||||||
|
const selectedCount = computed(() => selectedCartItems.value.length);
|
||||||
|
|
||||||
|
// 价格统计数据
|
||||||
|
const priceData = ref<{
|
||||||
|
totalPayPrice: string | number;
|
||||||
|
savings: string | number;
|
||||||
|
totalQuantity?: number;
|
||||||
|
}>({
|
||||||
|
totalPayPrice: 0,
|
||||||
|
savings: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
// 价格计算中的状态
|
||||||
|
const calculatingPrice = ref(false);
|
||||||
|
|
||||||
|
// 监听选中商品变化,调用价格统计接口
|
||||||
|
watch(() => selectedCartItems.value.map(item => item.id), (newIds, oldIds) => {
|
||||||
|
// 只有当选中的商品ID列表发生变化时才调用接口
|
||||||
|
if (newIds.length > 0) {
|
||||||
|
calculatePrice();
|
||||||
|
} else {
|
||||||
|
priceData.value = {
|
||||||
|
totalPayPrice: 0,
|
||||||
|
savings: 0
|
||||||
|
};
|
||||||
|
calculatingPrice.value = false;
|
||||||
|
}
|
||||||
|
}, { deep: true });
|
||||||
|
|
||||||
|
// 调用价格统计接口
|
||||||
|
const calculatePrice = () => {
|
||||||
|
calculatingPrice.value = true;
|
||||||
|
const cartIds = selectedCartItems.value.map(item => item.id);
|
||||||
|
appMerchantCartCalculateSavingsPost({
|
||||||
|
body: cartIds
|
||||||
|
}).then(res => {
|
||||||
|
console.log('价格统计', res);
|
||||||
|
priceData.value = res.data;
|
||||||
|
}).catch(err => {
|
||||||
|
console.error('价格统计失败', err);
|
||||||
|
}).finally(() => {
|
||||||
|
calculatingPrice.value = false;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 全选/取消全选
|
||||||
|
const toggleAllCheck = () => {
|
||||||
|
// wd-checkbox 已经自动切换了 allChecked.value 的值
|
||||||
|
dataList.value.forEach(merchant => {
|
||||||
|
merchant.allChecked = allChecked.value;
|
||||||
|
merchant.merchantCartVoList.forEach(item => {
|
||||||
|
item.checked = allChecked.value;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
// 切换店铺内所有商品选中状态
|
||||||
|
const toggleMerchantCheck = (merchant: CartMerchant) => {
|
||||||
|
// wd-checkbox 已经自动切换了 merchant.allChecked 的值
|
||||||
|
merchant.merchantCartVoList.forEach(item => {
|
||||||
|
item.checked = merchant.allChecked;
|
||||||
|
});
|
||||||
|
updateAllCheckedState();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 切换单个商品选中状态
|
||||||
|
const toggleItemCheck = (merchant: CartMerchant, item: CartItem) => {
|
||||||
|
// wd-checkbox 已经自动切换了 item.checked 的值,不需要手动切换
|
||||||
|
// 更新店铺全选状态
|
||||||
|
merchant.allChecked = merchant.merchantCartVoList.every(i => i.checked);
|
||||||
|
updateAllCheckedState();
|
||||||
|
};
|
||||||
|
|
||||||
|
// 更新全选状态
|
||||||
|
const updateAllCheckedState = () => {
|
||||||
|
const allItems = dataList.value.flatMap(m => m.merchantCartVoList);
|
||||||
|
allChecked.value = allItems.length > 0 && allItems.every(item => item.checked);
|
||||||
|
};
|
||||||
|
|
||||||
// 返回上一页
|
// 返回上一页
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
@@ -47,9 +136,6 @@ const goBack = () => {
|
|||||||
|
|
||||||
// 查看购物车
|
// 查看购物车
|
||||||
const viewCart = (item: any) => {
|
const viewCart = (item: any) => {
|
||||||
// uni.navigateTo({
|
|
||||||
// url: '/pages-user/pages/cart/store-cart?storeId=' + item.id + '&storeName=' + item.merchantName + '&type=index',
|
|
||||||
// });
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:
|
url:
|
||||||
'/pages-user/pages/cart/store-cart'
|
'/pages-user/pages/cart/store-cart'
|
||||||
@@ -86,6 +172,34 @@ function confirmRemove() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 批量结算
|
||||||
|
const batchCheckout = () => {
|
||||||
|
if (selectedCount.value === 0) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请选择要结算的商品'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果价格正在计算中,提示用户等待
|
||||||
|
if (calculatingPrice.value) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '价格计算中,请稍候...'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收集所有选中商品的购物车ID
|
||||||
|
const cartIds = selectedCartItems.value.map(item => item.id);
|
||||||
|
|
||||||
|
// 跳转到批量结算页面
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages-store/pages/order/checkout?cartIds=${cartIds.join(',')}&type=batch`
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 前往首页
|
// 前往首页
|
||||||
const goToHome = () => {
|
const goToHome = () => {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
@@ -93,21 +207,62 @@ const goToHome = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const dataList = ref([]);
|
|
||||||
|
|
||||||
// 骨架屏加载状态
|
// 骨架屏加载状态
|
||||||
const loading = ref(true);
|
const loading = ref(true);
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
getCartList()
|
getCartList()
|
||||||
});
|
});
|
||||||
function getCartList() {
|
|
||||||
appMerchantCartListMerchantPost({}).then(res=> {
|
async function getCartList() {
|
||||||
console.log('购物车列表', res)
|
try {
|
||||||
dataList.value = res.data
|
// 1. 先获取店铺列表
|
||||||
}).finally(()=> {
|
const res = await appMerchantCartListMerchantPost({});
|
||||||
loading.value = false
|
console.log('购物车店铺列表', res);
|
||||||
})
|
|
||||||
|
if (!res.data || res.data.length === 0) {
|
||||||
|
dataList.value = [];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. 对每个店铺查询完整的商品信息
|
||||||
|
const merchantPromises = res.data.map(async (merchant: any) => {
|
||||||
|
try {
|
||||||
|
const cartRes = await appMerchantCartListByMerchantIdPost({
|
||||||
|
params: {
|
||||||
|
merchantId: merchant.id
|
||||||
|
}
|
||||||
|
});
|
||||||
|
console.log(`店铺 ${merchant.merchantName} 的商品列表`, cartRes);
|
||||||
|
|
||||||
|
return {
|
||||||
|
...merchant,
|
||||||
|
allChecked: false,
|
||||||
|
merchantCartVoList: (cartRes.data || []).map((item: any) => ({
|
||||||
|
...item,
|
||||||
|
checked: false
|
||||||
|
}))
|
||||||
|
};
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`获取店铺 ${merchant.id} 商品失败`, error);
|
||||||
|
return {
|
||||||
|
...merchant,
|
||||||
|
allChecked: false,
|
||||||
|
merchantCartVoList: []
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3. 等待所有店铺的商品信息加载完成
|
||||||
|
dataList.value = await Promise.all(merchantPromises);
|
||||||
|
console.log('最终购物车数据', dataList.value);
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
console.error('获取购物车列表失败', error);
|
||||||
|
dataList.value = [];
|
||||||
|
} finally {
|
||||||
|
loading.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
@@ -133,69 +288,123 @@ function getCartList() {
|
|||||||
v-show="!loading"
|
v-show="!loading"
|
||||||
>
|
>
|
||||||
<!-- 购物车列表 -->
|
<!-- 购物车列表 -->
|
||||||
<view class="px-30rpx mt-54rpx">
|
<view class="px-20rpx mt-54rpx pb-200rpx">
|
||||||
<template v-if="dataList.length > 0">
|
<template v-if="dataList.length > 0">
|
||||||
<view
|
<view
|
||||||
v-for="(item, index) in dataList"
|
v-for="(merchant, index) in dataList"
|
||||||
:key="item.id"
|
:key="merchant.id"
|
||||||
class="mb-30rpx rounded-24rpx border-2rpx border-solid border-[#E8E8E8] overflow-hidden"
|
class="mb-30rpx"
|
||||||
>
|
>
|
||||||
<!-- 店铺信息 -->
|
<!-- 店铺信息卡片 -->
|
||||||
<view class="p-30rpx flex">
|
<view class="rounded-24rpx border-2rpx border-solid border-[#E8E8E8] overflow-hidden">
|
||||||
<!-- 店铺图片 -->
|
<!-- 店铺头部 -->
|
||||||
<view
|
<view class="p-30rpx flex items-center border-bottom border-[#E8E8E8]">
|
||||||
class="w-118rpx h-118rpx rounded-full overflow-hidden bg-[#D8D8D8]"
|
<!-- 店铺全选框 -->
|
||||||
>
|
<view class="mr-20rpx flex-shrink-0">
|
||||||
<image
|
<wd-checkbox
|
||||||
:src="item.logo"
|
v-model="merchant.allChecked"
|
||||||
class="w-full h-full"
|
shape="circle"
|
||||||
mode="aspectFill"
|
@change="toggleMerchantCheck(merchant)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 店铺详情 -->
|
<!-- 店铺图片 -->
|
||||||
<view class="ml-30rpx flex-1">
|
<view
|
||||||
<view class="text-30rpx text-[#333333] font-500">{{
|
class="w-55rpx h-55rpx rounded-full overflow-hidden bg-[#D8D8D8] flex-shrink-0"
|
||||||
item.merchantName
|
@click="viewStore(merchant.id)"
|
||||||
}}</view>
|
|
||||||
<view class="text-28rpx text-[#7D7D7D]"
|
|
||||||
>{{ item.merchantCartVoList.length }} {{ t('pages-user.cart.items') }} · ${{ item.cartTotalPrice || 0 }}</view>
|
|
||||||
<view class="text-28rpx text-[#7D7D7D] line-clamp-1"
|
|
||||||
>{{ t('pages-store.order.deliveryAddress') }}: {{ item.merchantAddress }}</view
|
|
||||||
>
|
>
|
||||||
</view>
|
<image
|
||||||
|
:src="merchant.logo"
|
||||||
|
class="w-full h-full"
|
||||||
|
mode="aspectFill"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- 删除按钮 -->
|
<!-- 店铺名称 -->
|
||||||
<view
|
<view class="ml-20rpx flex-1" @click="viewStore(merchant.id)">
|
||||||
class="w-80rpx h-80rpx rounded-full bg-[#F2F2F2] flex items-center justify-center"
|
<view class="text-30rpx text-[#333333] font-500">{{
|
||||||
@click="deleteStore(item)"
|
merchant.merchantName
|
||||||
>
|
}}</view>
|
||||||
<image src="@img/chef/1278.png" class="w-80rpx h-80rpx"></image>
|
</view>
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 查看购物车按钮 -->
|
<!-- 删除按钮 -->
|
||||||
<view class="px-30rpx">
|
<view
|
||||||
<view
|
class="w-60rpx h-60rpx rounded-full bg-[#F2F2F2] flex items-center justify-center flex-shrink-0"
|
||||||
class="h-88rpx rounded-16rpx bg-[#14181B] flex items-center justify-center mb-20rpx"
|
@click="deleteStore(merchant)"
|
||||||
@click="viewCart(item)"
|
|
||||||
>
|
|
||||||
<text class="text-30rpx text-white font-500"
|
|
||||||
>{{ t('pages-user.cart.viewCart') }}</text
|
|
||||||
>
|
>
|
||||||
|
<image src="@img/chef/1278.png" class="w-60rpx h-60rpx"></image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 查看店铺按钮 -->
|
<!-- 商品列表 -->
|
||||||
<view class="px-30rpx pb-30rpx">
|
<view class="px-30rpx">
|
||||||
<view
|
<view
|
||||||
class="h-88rpx rounded-16rpx bg-[#F2F2F2] flex items-center justify-center"
|
v-for="(item, itemIndex) in merchant.merchantCartVoList"
|
||||||
@click="viewStore(item.id)"
|
:key="item.id"
|
||||||
>
|
class="py-30rpx flex items-start items-center"
|
||||||
<text class="text-30rpx text-[#333333] font-500"
|
:class="itemIndex < merchant.merchantCartVoList.length - 1 ? 'border-bottom border-[#F2F2F2]' : ''"
|
||||||
>{{ t('pages-user.cart.viewStore') }}</text
|
|
||||||
>
|
>
|
||||||
|
<!-- 商品多选框 -->
|
||||||
|
<view class="mr-20rpx mt-20rpx flex-shrink-0">
|
||||||
|
<wd-checkbox
|
||||||
|
v-model="item.checked"
|
||||||
|
shape="circle"
|
||||||
|
@change="toggleItemCheck(merchant, item)"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 商品图片 -->
|
||||||
|
<image
|
||||||
|
:src="item.merchantDishVo?.dishImage?.split(',')[0]"
|
||||||
|
mode="aspectFill"
|
||||||
|
class="w-136rpx h-136rpx shrink-0 rounded-16rpx"
|
||||||
|
></image>
|
||||||
|
|
||||||
|
<!-- 商品信息 -->
|
||||||
|
<view class="ml-20rpx flex-1">
|
||||||
|
<view class="text-[#333333] text-28rpx lh-40rpx font-500 line-clamp-2">{{
|
||||||
|
item.merchantDishVo?.dishName
|
||||||
|
}}</view>
|
||||||
|
|
||||||
|
<!-- 配菜信息 -->
|
||||||
|
<view class="text-[#7D7D7D] text-22rpx lh-28rpx mt-10rpx" v-if="item.sideDishList?.length > 0">
|
||||||
|
<template v-for="dish in item.sideDishList">
|
||||||
|
<text class="mr-6rpx">
|
||||||
|
{{ dish?.merchantSideDishItemVo?.name || '' }}
|
||||||
|
</text>
|
||||||
|
<text v-if="dish?.merchantSideDishItemVo?.price" class="text-#00A76D mr-10rpx">+${{ dish?.merchantSideDishItemVo?.price }}</text>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 价格和数量 -->
|
||||||
|
<view class="flex items-center justify-between mt-16rpx">
|
||||||
|
<view class="flex items-center">
|
||||||
|
<text class="text-[#333333] text-30rpx font-500"
|
||||||
|
>${{ item.merchantDishVo?.discountPrice }}</text>
|
||||||
|
<text
|
||||||
|
v-if="item.merchantDishVo?.originalPrice && item.merchantDishVo?.originalPrice !== item.merchantDishVo?.discountPrice"
|
||||||
|
class="text-[#7D7D7D] text-24rpx line-through ml-10rpx"
|
||||||
|
>${{ item.merchantDishVo?.originalPrice }}</text>
|
||||||
|
</view>
|
||||||
|
<view class="text-[#7D7D7D] text-24rpx">
|
||||||
|
x{{ item.count }}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 查看购物车按钮 -->
|
||||||
|
<!-- <view class="px-30rpx pb-30rpx">
|
||||||
|
<view
|
||||||
|
class="h-88rpx rounded-16rpx bg-[#14181B] flex items-center justify-center"
|
||||||
|
@click="viewCart(merchant)"
|
||||||
|
>
|
||||||
|
<text class="text-30rpx text-white font-500"
|
||||||
|
>{{ t('pages-user.cart.viewCart') }}</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -216,10 +425,73 @@ function getCartList() {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</z-paging>
|
</z-paging>
|
||||||
|
|
||||||
|
<!-- 底部结算栏 - 使用 page-meta 配合 fixed 定位 -->
|
||||||
|
<view
|
||||||
|
v-if="dataList.length > 0"
|
||||||
|
class="cart-footer"
|
||||||
|
>
|
||||||
|
<view class="cart-footer-content">
|
||||||
|
<!-- 全选 -->
|
||||||
|
<view class="flex items-center">
|
||||||
|
<wd-checkbox
|
||||||
|
v-model="allChecked"
|
||||||
|
shape="circle"
|
||||||
|
@change="toggleAllCheck"
|
||||||
|
>
|
||||||
|
全选
|
||||||
|
</wd-checkbox>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 合计和结算 -->
|
||||||
|
<view class="flex items-center">
|
||||||
|
<view class="mr-30rpx text-right">
|
||||||
|
<text class="text-24rpx text-[#999]">合计: </text>
|
||||||
|
<text class="text-36rpx text-[#FF4D4F] font-bold">
|
||||||
|
${{ priceData.totalPayPrice || '0.00' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="h-80rpx px-50rpx rounded-40rpx flex items-center justify-center"
|
||||||
|
:class="selectedCount > 0 && !calculatingPrice ? 'bg-#14181B' : 'bg-#E8E8E8'"
|
||||||
|
@click="batchCheckout"
|
||||||
|
>
|
||||||
|
<text
|
||||||
|
class="text-30rpx font-500"
|
||||||
|
:class="selectedCount > 0 && !calculatingPrice ? 'text-white' : 'text-#999'"
|
||||||
|
>
|
||||||
|
<text v-if="calculatingPrice">计算中...</text>
|
||||||
|
<text v-else>结算<text v-if="selectedCount > 0">({{ selectedCount }})</text></text>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
<remove-cart @confirm="confirmRemove" ref="removeCartRef" />
|
<remove-cart @confirm="confirmRemove" ref="removeCartRef" />
|
||||||
</template>
|
</template>
|
||||||
<style>
|
<style scoped>
|
||||||
page {
|
page {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cart-footer {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 999;
|
||||||
|
background-color: #fff;
|
||||||
|
border-top: 1rpx solid #E8E8E8;
|
||||||
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-footer-content {
|
||||||
|
height: 120rpx;
|
||||||
|
padding: 0 30rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ function appMembershipRechargeItem() {
|
|||||||
<!-- <text class="ml-20rpx text-#CE7138">{{ membershipRechargeItem.trialWeeksDisplay || 0 }} {{ t('pages-user.member.weeks') }}</text>
|
<!-- <text class="ml-20rpx text-#CE7138">{{ membershipRechargeItem.trialWeeksDisplay || 0 }} {{ t('pages-user.member.weeks') }}</text>
|
||||||
<text class="ml-20rpx text-#CE7138">{{ t('pages-user.member.free') }}</text> -->
|
<text class="ml-20rpx text-#CE7138">{{ t('pages-user.member.free') }}</text> -->
|
||||||
<text class="ml-20rpx text-#CE7138">Free for 7 days</text>
|
<text class="ml-20rpx text-#CE7138">Free for 7 days</text>
|
||||||
|
<!-- <image :src="membershipRechargeItem.image"></image> -->
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -97,7 +98,7 @@ function appMembershipRechargeItem() {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="w-full min-h-340rpx rounded-20rpx border-#D8D8D8 border-solid border-2rpx pb-26rpx px-28rpx pt-20rpx">
|
<!-- <view class="w-full min-h-340rpx rounded-20rpx border-#D8D8D8 border-solid border-2rpx pb-26rpx px-28rpx pt-20rpx">
|
||||||
<image
|
<image
|
||||||
src="@img/chef/137.png"
|
src="@img/chef/137.png"
|
||||||
class="w-98rpx h-98rpx mb-18rpx"
|
class="w-98rpx h-98rpx mb-18rpx"
|
||||||
@@ -108,7 +109,7 @@ function appMembershipRechargeItem() {
|
|||||||
<view class="text-22rpx lh-22rpx text-#7d7d7d tracking-[.06em]">
|
<view class="text-22rpx lh-22rpx text-#7d7d7d tracking-[.06em]">
|
||||||
{{ memberText.desc_pickup }}
|
{{ memberText.desc_pickup }}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <image-->
|
<!-- <image-->
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
class="category-item"
|
class="category-item"
|
||||||
@click="handleItemClick(item)"
|
@click="handleItemClick(item)"
|
||||||
>
|
>
|
||||||
<image :src="item.logoUrl" class="category-icon" mode="aspectFit" />
|
<image v-if="item.categoryImage || item.logoUrl" :src="item.categoryImage || item.logoUrl" class="category-icon" mode="aspectFit" />
|
||||||
<text class="category-text">{{ item.categoryName }}</text>
|
<text class="category-text">{{ item.categoryName || item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 第二份重复内容(用于无缝循环) -->
|
<!-- 第二份重复内容(用于无缝循环) -->
|
||||||
<view
|
<view
|
||||||
@@ -32,8 +32,8 @@
|
|||||||
class="category-item"
|
class="category-item"
|
||||||
@click="handleItemClick(item)"
|
@click="handleItemClick(item)"
|
||||||
>
|
>
|
||||||
<image :src="item.categoryImage" class="category-icon" mode="aspectFit" />
|
<image v-if="item.categoryImage || item.logoUrl" :src="item.categoryImage || item.logoUrl" class="category-icon" mode="aspectFit" />
|
||||||
<text class="category-text">{{ item.categoryName }}</text>
|
<text class="category-text">{{ item.categoryName || item.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
@@ -85,9 +85,10 @@ import { computed, ref, onMounted, nextTick, getCurrentInstance } from 'vue'
|
|||||||
// 定义分类项接口(与模板字段一致)
|
// 定义分类项接口(与模板字段一致)
|
||||||
interface CategoryItem {
|
interface CategoryItem {
|
||||||
id: number
|
id: number
|
||||||
categoryImage: string
|
categoryImage?: string
|
||||||
name: string,
|
logoUrl?: string
|
||||||
categoryName:any
|
name?: string
|
||||||
|
categoryName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 定义组件属性
|
// 定义组件属性
|
||||||
@@ -289,7 +290,7 @@ onMounted(() => {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-width: 120rpx;
|
min-width: 120rpx;
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
padding: 0 16rpx;
|
padding: 0 20rpx;
|
||||||
border: 1px solid #C8C8C8;
|
border: 1px solid #C8C8C8;
|
||||||
border-radius: 30rpx;
|
border-radius: 30rpx;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -304,6 +305,7 @@ onMounted(() => {
|
|||||||
width: 32rpx;
|
width: 32rpx;
|
||||||
height: 32rpx;
|
height: 32rpx;
|
||||||
margin-right: 8rpx;
|
margin-right: 8rpx;
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.category-text {
|
.category-text {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
imgKey: {
|
imgKey: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'categoryImage',
|
default: 'logoUrl',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
const emit = defineEmits(['changeType']);
|
const emit = defineEmits(['changeType']);
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ function appMarketActivityList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)
|
// 滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)
|
||||||
const appMerchantLabelList = ref([])
|
const appMerchantLabelList = ref<any>([])
|
||||||
function getAppMerchantLabelList() {
|
function getAppMerchantLabelList() {
|
||||||
appRecipeCategoryListGet({}).then(res => {
|
appRecipeCategoryListGet({}).then(res => {
|
||||||
console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
|
console.log('滚动信息获取 APP-商家标签分类控制器(用户端首页上面左右滚动的)', res)
|
||||||
@@ -167,6 +167,20 @@ function getList(pageNum: number, pageSize: number) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 回到顶部
|
||||||
|
const showBackToTop = ref(false)
|
||||||
|
function scrollToTop() {
|
||||||
|
if (paging.value) {
|
||||||
|
paging.value.scrollToTop()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听页面滚动
|
||||||
|
function onPageScroll(e: any) {
|
||||||
|
// 滚动距离大于60时显示,小于等于60时隐藏
|
||||||
|
showBackToTop.value = e.detail.scrollTop > 120
|
||||||
|
}
|
||||||
|
|
||||||
// 点击头部分类
|
// 点击头部分类
|
||||||
const merchantLabelId = ref('')
|
const merchantLabelId = ref('')
|
||||||
function handleItemClick(e) {
|
function handleItemClick(e) {
|
||||||
@@ -186,7 +200,7 @@ const isShowMerchant = computed(()=> {
|
|||||||
if(!selfPickup.value && !discount.value && !props.scoreRange && !props.price && !currentCategory.value) {
|
if(!selfPickup.value && !discount.value && !props.scoreRange && !props.price && !currentCategory.value) {
|
||||||
return true // 没有筛选条件时显示
|
return true // 没有筛选条件时显示
|
||||||
} else {
|
} else {
|
||||||
return false // 有筛选条件时隐藏
|
return true // 有筛选条件时隐藏
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -249,7 +263,7 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
|
|||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
>
|
>
|
||||||
<z-paging @onRefresh="onRefresh" ref="paging" v-model="dataList" :auto="false" @query="queryList" :refresher-enabled="true" :auto-show-back-to-top="false">
|
<z-paging @onRefresh="onRefresh" ref="paging" v-model="dataList" :auto="false" @query="queryList" @scroll="onPageScroll" :refresher-enabled="true" :auto-show-back-to-top="false">
|
||||||
<template #top>
|
<template #top>
|
||||||
<status-bar />
|
<status-bar />
|
||||||
<view class="flex items-center pt-18rpx px-30rpx pb-20rpx">
|
<view class="flex items-center pt-18rpx px-30rpx pb-20rpx">
|
||||||
@@ -402,6 +416,11 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
|
|||||||
<view class="w-8rpx h-8rpx rounded-50% bg-white mx-8rpx"></view>
|
<view class="w-8rpx h-8rpx rounded-50% bg-white mx-8rpx"></view>
|
||||||
<text>{{ userStore.userCartAllData[0]?.merchantCartVoList?.length || 0 }}</text>
|
<text>{{ userStore.userCartAllData[0]?.merchantCartVoList?.length || 0 }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 回到顶部按钮 -->
|
||||||
|
<view v-if="showBackToTop" @click="scrollToTop" class="back-to-top-btn">
|
||||||
|
<image src="@img/chef/119.png" class="w-40rpx h-40rpx shrink-0 rotate-180"></image>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -426,4 +445,19 @@ const debouncedEmit = debounce(1300, (isCollected: boolean, id: string, type: Co
|
|||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.back-to-top-btn {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 148rpx;
|
||||||
|
left: 30rpx;
|
||||||
|
width: 88rpx;
|
||||||
|
height: 88rpx;
|
||||||
|
background-color: #14181B;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.15);
|
||||||
|
z-index: 998;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
+26
-1
@@ -16,13 +16,38 @@ export async function appMerchantDetailMerchantIdGet({
|
|||||||
}) {
|
}) {
|
||||||
const { merchantId: param0, ...queryParams } = params;
|
const { merchantId: param0, ...queryParams } = params;
|
||||||
|
|
||||||
return request<API.RMerchantVo>(`/app/merchant/detail/${param0}`, {
|
// return request<API.RMerchantVo>(`/app/merchant/detail/${param0}`, {
|
||||||
|
// method: 'GET',
|
||||||
|
// params: { ...queryParams },
|
||||||
|
// ...(options || {}),
|
||||||
|
// });
|
||||||
|
return request<API.RMerchantVo>(`/app/merchant/shopInfo/${param0}`, {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
params: { ...queryParams },
|
params: { ...queryParams },
|
||||||
...(options || {}),
|
...(options || {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 根据菜品ID和店铺ID查询对应菜品 */
|
||||||
|
export async function appMerchantDishDishIdGet({
|
||||||
|
body,
|
||||||
|
options,
|
||||||
|
}: {
|
||||||
|
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
|
||||||
|
body: API.AppMerchantDishdishIdGetParams;
|
||||||
|
options?: CustomRequestOptions;
|
||||||
|
}) {
|
||||||
|
return request<API.RDishVo>(`/app/merchant/dishPageByMenuId`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** 商户编辑个人信息 POST /app/merchant/edit */
|
/** 商户编辑个人信息 POST /app/merchant/edit */
|
||||||
export async function appMerchantEditPost({
|
export async function appMerchantEditPost({
|
||||||
body,
|
body,
|
||||||
|
|||||||
@@ -130,3 +130,50 @@ export async function appMerchantCartListMerchantPost({
|
|||||||
...(options || {}),
|
...(options || {}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AppMerchantCartOrderBatchPostBody {
|
||||||
|
/** 购物车ID列表 */
|
||||||
|
cartIds: any[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 批量购物车下单 */
|
||||||
|
export async function appMerchantCartOrderBatchPost({
|
||||||
|
body,
|
||||||
|
options,
|
||||||
|
}: {
|
||||||
|
body: AppMerchantCartOrderBatchPostBody;
|
||||||
|
options?: CustomRequestOptions;
|
||||||
|
}) {
|
||||||
|
return request<API.R>('/app/merchantOrder/createOrderCartBatch', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface AppMerchantOrderPayBatchPostBody {
|
||||||
|
/** 订单ID列表 */
|
||||||
|
orderIds: any[];
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 订单批量支付 */
|
||||||
|
export async function appMerchantOrderPayBatchPost({
|
||||||
|
body,
|
||||||
|
options,
|
||||||
|
}: {
|
||||||
|
body: AppMerchantOrderPayBatchPostBody;
|
||||||
|
options?: CustomRequestOptions;
|
||||||
|
}) {
|
||||||
|
return request<API.R>('/app/merchantOrder/payOrderBatch', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -62,6 +62,62 @@ export async function appMerchantOrderCalculatePriceCartPost({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量购物车下单 - 计算价格 POST /app/merchantOrder/calculatePriceCartBatch */
|
||||||
|
export async function appMerchantOrderCalculatePriceCartBatchPost({
|
||||||
|
body,
|
||||||
|
options,
|
||||||
|
}: {
|
||||||
|
body: API.CalculatePriceCartBatchBo;
|
||||||
|
options?: CustomRequestOptions;
|
||||||
|
}) {
|
||||||
|
return request<API.RCalculatePriceCartVo>(
|
||||||
|
'/app/merchantOrder/calculatePriceCartBatch',
|
||||||
|
{
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CalculatePriceCartBatchBo - 批量计算价格参数
|
||||||
|
*/
|
||||||
|
export interface CalculatePriceCartBatchBo {
|
||||||
|
/**
|
||||||
|
* 配送地址id
|
||||||
|
*/
|
||||||
|
addressId?: number;
|
||||||
|
/**
|
||||||
|
* 区号
|
||||||
|
*/
|
||||||
|
areaCode?: string;
|
||||||
|
/**
|
||||||
|
* 购物车id列表
|
||||||
|
*/
|
||||||
|
cartIds?: string[] | number[];
|
||||||
|
/**
|
||||||
|
* 优惠券id
|
||||||
|
*/
|
||||||
|
couponId?: number;
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
phone?: string;
|
||||||
|
/**
|
||||||
|
* 收货方式(1-派送 2-自取)
|
||||||
|
*/
|
||||||
|
receiveMethod?: number;
|
||||||
|
/**
|
||||||
|
* 小费比例
|
||||||
|
*/
|
||||||
|
tipDiscount?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
/** 商品下单 - 计算价格 POST /app/merchantOrder/calculatePriceDish */
|
/** 商品下单 - 计算价格 POST /app/merchantOrder/calculatePriceDish */
|
||||||
export async function appMerchantOrderCalculatePriceDishPost({
|
export async function appMerchantOrderCalculatePriceDishPost({
|
||||||
body,
|
body,
|
||||||
@@ -140,6 +196,93 @@ export async function appMerchantOrderCreateOrderCartPost({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 购物车批量下单 POST /app/merchantOrder/createOrderCartBatch */
|
||||||
|
export async function appMerchantOrderCreateOrderCartBatchPost({
|
||||||
|
body,
|
||||||
|
options,
|
||||||
|
}: {
|
||||||
|
body: API.CreateOrderCartBatchBo;
|
||||||
|
options?: CustomRequestOptions;
|
||||||
|
}) {
|
||||||
|
return request<API.RListLong>('/app/merchantOrder/createOrderCartBatch', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CreateOrderCartBatchBo - 批量下单参数
|
||||||
|
*/
|
||||||
|
export interface CreateOrderCartBatchBo {
|
||||||
|
/**
|
||||||
|
* 配送地址id
|
||||||
|
*/
|
||||||
|
addressId?: number;
|
||||||
|
/**
|
||||||
|
* 区号
|
||||||
|
*/
|
||||||
|
areaCode?: string;
|
||||||
|
/**
|
||||||
|
* 购物车id列表
|
||||||
|
*/
|
||||||
|
cartIds?: string[] | number[];
|
||||||
|
/**
|
||||||
|
* 优惠券id
|
||||||
|
*/
|
||||||
|
couponId?: number;
|
||||||
|
/**
|
||||||
|
* 派送方式(如放门口或者交到顾客手中)
|
||||||
|
*/
|
||||||
|
deliveryMethod?: string;
|
||||||
|
/**
|
||||||
|
* 交付时间类型(1-立即交付 2-预约交付)
|
||||||
|
*/
|
||||||
|
deliveryType?: number;
|
||||||
|
/**
|
||||||
|
* 订单备注
|
||||||
|
*/
|
||||||
|
orderRemark?: string;
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
phone: string;
|
||||||
|
/**
|
||||||
|
* 收货方式(1-派送 2-自取)
|
||||||
|
*/
|
||||||
|
receiveMethod: number;
|
||||||
|
/**
|
||||||
|
* 预约时间- 开始
|
||||||
|
*/
|
||||||
|
startScheduledTime?: number | string;
|
||||||
|
/**
|
||||||
|
* 预约时间- 结束
|
||||||
|
*/
|
||||||
|
endScheduledTime?: number | string;
|
||||||
|
/**
|
||||||
|
* 小费比例
|
||||||
|
*/
|
||||||
|
tipDiscount?: number;
|
||||||
|
/**
|
||||||
|
* 是否需要餐具(1-是 2-否)
|
||||||
|
*/
|
||||||
|
needTableware?: number;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RListLong - 返回订单ID列表
|
||||||
|
*/
|
||||||
|
export interface RListLong {
|
||||||
|
code?: number;
|
||||||
|
data?: number[];
|
||||||
|
msg?: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
/** 菜品下单 POST /app/merchantOrder/createOrderDish */
|
/** 菜品下单 POST /app/merchantOrder/createOrderDish */
|
||||||
export async function appMerchantOrderCreateOrderDishPost({
|
export async function appMerchantOrderCreateOrderDishPost({
|
||||||
body,
|
body,
|
||||||
@@ -290,6 +433,47 @@ export async function appMerchantOrderPayOrderPost({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 批量订单付款 POST /app/merchantOrder/payOrderBatch */
|
||||||
|
export async function appMerchantOrderPayOrderBatchPost({
|
||||||
|
body,
|
||||||
|
options,
|
||||||
|
}: {
|
||||||
|
body: API.PayOrderBatchBo;
|
||||||
|
options?: CustomRequestOptions;
|
||||||
|
}) {
|
||||||
|
return request<API.R>('/app/merchantOrder/payOrderBatch', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PayOrderBatchBo - 批量订单支付参数
|
||||||
|
*/
|
||||||
|
export interface PayOrderBatchBo {
|
||||||
|
/**
|
||||||
|
* 订单ID列表
|
||||||
|
*/
|
||||||
|
orderIds: number[] | string[];
|
||||||
|
/**
|
||||||
|
* 信用卡ID
|
||||||
|
*/
|
||||||
|
cardId?: string;
|
||||||
|
/**
|
||||||
|
* 支付方式 1信用卡 2余额
|
||||||
|
*/
|
||||||
|
payMethod: number;
|
||||||
|
/**
|
||||||
|
* 支付密码(余额支付时需要)
|
||||||
|
*/
|
||||||
|
payPassword?: string;
|
||||||
|
[property: string]: any;
|
||||||
|
}
|
||||||
|
|
||||||
/** 商家接单 POST /app/merchantOrder/receiveOrder */
|
/** 商家接单 POST /app/merchantOrder/receiveOrder */
|
||||||
export async function appMerchantOrderReceiveOrderPost({
|
export async function appMerchantOrderReceiveOrderPost({
|
||||||
params,
|
params,
|
||||||
|
|||||||
@@ -198,6 +198,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export type AppMerchantDishdishIdGetParams = {
|
||||||
|
'merchantId':any;
|
||||||
|
'menuId':any;
|
||||||
|
'pageNum':number;
|
||||||
|
'pageSize':number;
|
||||||
|
}
|
||||||
|
|
||||||
export type AppMerchantDishAddViewCountPostParams =
|
export type AppMerchantDishAddViewCountPostParams =
|
||||||
{
|
{
|
||||||
'dishId': number;
|
'dishId': number;
|
||||||
@@ -4533,6 +4540,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export type RDishVo = {
|
||||||
|
'code'?: number;
|
||||||
|
'msg'?: string;
|
||||||
|
'data'?: any;
|
||||||
|
'systemTime'?: number;
|
||||||
|
}
|
||||||
|
|
||||||
export type RNumberStatisticsVo =
|
export type RNumberStatisticsVo =
|
||||||
{
|
{
|
||||||
'code'?: number;
|
'code'?: number;
|
||||||
|
|||||||
Reference in New Issue
Block a user