Merge branch 'ymf' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into gyq
This commit is contained in:
@@ -72,7 +72,6 @@
|
|||||||
isShow.value = res.isOrder
|
isShow.value = res.isOrder
|
||||||
list.value = res.rechargeDetailList.filter(v=>v.amount>cartStore.orderCostSummary.finalPayAmount)
|
list.value = res.rechargeDetailList.filter(v=>v.amount>cartStore.orderCostSummary.finalPayAmount)
|
||||||
if(list.value.length){
|
if(list.value.length){
|
||||||
sel.value=0
|
|
||||||
updateSel()
|
updateSel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,7 +79,6 @@
|
|||||||
watch(()=>cartStore.orderCostSummary.finalPayAmount,(newval)=>{
|
watch(()=>cartStore.orderCostSummary.finalPayAmount,(newval)=>{
|
||||||
list.value=$riginList.filter(v=>v.amount>newval)
|
list.value=$riginList.filter(v=>v.amount>newval)
|
||||||
if(list.value.length){
|
if(list.value.length){
|
||||||
sel.value=0
|
|
||||||
updateSel()
|
updateSel()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -365,6 +365,7 @@
|
|||||||
cartStore.setDinnerType(item.val)
|
cartStore.setDinnerType(item.val)
|
||||||
// this.getchoseEatModel('tabClick', index, item);
|
// this.getchoseEatModel('tabClick', index, item);
|
||||||
}
|
}
|
||||||
|
cartStore.setDinnerType(tebtypeList[is_type.value].val)
|
||||||
|
|
||||||
// 操作优惠卷
|
// 操作优惠卷
|
||||||
const dataprocessing = (data) => {
|
const dataprocessing = (data) => {
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
|
|
||||||
|
|
||||||
//充值相关
|
//充值相关
|
||||||
const rechargeItem=ref(null)
|
const rechargeItem=ref({id:''})
|
||||||
const rechargeId=ref(null)
|
const rechargeId=ref(null)
|
||||||
|
|
||||||
function updateRechargeId(e){
|
function updateRechargeId(e){
|
||||||
@@ -192,6 +192,11 @@
|
|||||||
let res = await APIgetOrderById({
|
let res = await APIgetOrderById({
|
||||||
orderId: listinfo.id
|
orderId: listinfo.id
|
||||||
})
|
})
|
||||||
|
console.log('onMessage:APIgetOrderById',res);
|
||||||
|
if(res){
|
||||||
|
// cartStore.carts=[];
|
||||||
|
// cartStore.setOldOrder(res)
|
||||||
|
}
|
||||||
if (noPayStatus[res.status]) {
|
if (noPayStatus[res.status]) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: noPayStatus[res.status],
|
title: noPayStatus[res.status],
|
||||||
@@ -582,7 +587,10 @@
|
|||||||
// 清空购物车
|
// 清空购物车
|
||||||
if (res) {
|
if (res) {
|
||||||
Object.assign(listinfo, res)
|
Object.assign(listinfo, res)
|
||||||
|
// cartStore.carts=[];
|
||||||
|
// cartStore.setOldOrder(res)
|
||||||
getOrderInfoAfterCalcInit(res)
|
getOrderInfoAfterCalcInit(res)
|
||||||
|
|
||||||
cartsSocket.sendMessage({
|
cartsSocket.sendMessage({
|
||||||
type: 'shopping',
|
type: 'shopping',
|
||||||
table_code: uni.cache.get('tableCode'),
|
table_code: uni.cache.get('tableCode'),
|
||||||
@@ -638,7 +646,13 @@
|
|||||||
// 购物车有数据
|
// 购物车有数据
|
||||||
if (!cartStore.isEmpty) {
|
if (!cartStore.isEmpty) {
|
||||||
const res = await createOrder()
|
const res = await createOrder()
|
||||||
|
//历史订单数据
|
||||||
|
const res1= await APIgetOrderById({
|
||||||
|
orderId: res.id
|
||||||
|
})
|
||||||
|
cartStore.setOldOrder(res1)
|
||||||
}
|
}
|
||||||
|
|
||||||
goToPay()
|
goToPay()
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -794,6 +808,7 @@
|
|||||||
})
|
})
|
||||||
pay(payRes)
|
pay(payRes)
|
||||||
}else{
|
}else{
|
||||||
|
console.log('微信支付');
|
||||||
await storeMemberpay.actionsltPayOrder({
|
await storeMemberpay.actionsltPayOrder({
|
||||||
checkOrderPay,
|
checkOrderPay,
|
||||||
payType: paymentmethod.payType,
|
payType: paymentmethod.payType,
|
||||||
@@ -803,6 +818,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.log('error',error);
|
||||||
pay_unlock()
|
pay_unlock()
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
}
|
}
|
||||||
@@ -918,10 +934,13 @@
|
|||||||
url: '/pages/product/index'
|
url: '/pages/product/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
const packfee=computed(()=>{
|
||||||
|
return cartStore.orderCostSummary.packFee
|
||||||
|
})
|
||||||
//不计算各种折扣前的实付金额
|
//不计算各种折扣前的实付金额
|
||||||
const shifu = computed(() => {
|
const shifu = computed(() => {
|
||||||
const payAmount = listinfo.payAmount ? listinfo.payAmount * 1 : 0
|
const payAmount = listinfo.payAmount ? listinfo.payAmount * 1 : 0
|
||||||
return payAmount + cartStore.totalPrice * 1 + 0;
|
return payAmount + cartStore.totalPrice * 1 + packfee.value * 1
|
||||||
})
|
})
|
||||||
//减去各种折扣后的金额
|
//减去各种折扣后的金额
|
||||||
const lastPayMoney = computed(() => {
|
const lastPayMoney = computed(() => {
|
||||||
@@ -963,6 +982,7 @@
|
|||||||
if (shopInfoRes) {
|
if (shopInfoRes) {
|
||||||
cartStore.shopInfo = shopInfoRes.shopInfo;
|
cartStore.shopInfo = shopInfoRes.shopInfo;
|
||||||
}
|
}
|
||||||
|
await cartStore.goodsInit()
|
||||||
// * 获取会员信息
|
// * 获取会员信息
|
||||||
await storeuser.actionsproductqueryProduct()
|
await storeuser.actionsproductqueryProduct()
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|||||||
155
pnpm-lock.yaml
generated
155
pnpm-lock.yaml
generated
@@ -4,10 +4,13 @@ settings:
|
|||||||
autoInstallPeers: true
|
autoInstallPeers: true
|
||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
dependencies:
|
importers:
|
||||||
|
|
||||||
|
.:
|
||||||
|
dependencies:
|
||||||
'@dcloudio/uni-app':
|
'@dcloudio/uni-app':
|
||||||
specifier: ^2.0.2-4040520250103001
|
specifier: ^2.0.2-4040520250103001
|
||||||
version: 2.0.2-4070620250821001(@dcloudio/types@3.4.21)(@vue/composition-api@1.7.2)
|
version: 2.0.2-4070620250821001(@dcloudio/types@3.4.21)(@vue/composition-api@1.7.2(vue@3.5.22))
|
||||||
bignumber.js:
|
bignumber.js:
|
||||||
specifier: ^9.3.1
|
specifier: ^9.3.1
|
||||||
version: 9.3.1
|
version: 9.3.1
|
||||||
@@ -22,7 +25,7 @@ dependencies:
|
|||||||
version: 4.17.21
|
version: 4.17.21
|
||||||
pinia:
|
pinia:
|
||||||
specifier: ^2.3.1
|
specifier: ^2.3.1
|
||||||
version: 2.3.1(@vue/composition-api@1.7.2)(vue@3.5.21)
|
version: 2.3.1(@vue/composition-api@1.7.2(vue@3.5.22))(vue@3.5.22)
|
||||||
pinia-plugin-unistorage:
|
pinia-plugin-unistorage:
|
||||||
specifier: ^0.1.2
|
specifier: ^0.1.2
|
||||||
version: 0.1.2
|
version: 0.1.2
|
||||||
@@ -264,6 +267,20 @@ packages:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
|
||||||
|
ysk-utils@1.0.35:
|
||||||
|
resolution: {integrity: sha512-kxPtEk5zs0HjdazbH2l2x1Tm5BUpmj1MBiOnb9Xquuj2hW2NtICtq+JB6RWFO7tzAAnOC5MRw366VOKceyeK5Q==}
|
||||||
|
|
||||||
|
snapshots:
|
||||||
|
|
||||||
|
'@babel/helper-string-parser@7.27.1': {}
|
||||||
|
|
||||||
|
'@babel/helper-validator-identifier@7.27.1': {}
|
||||||
|
|
||||||
|
'@babel/parser@7.28.4':
|
||||||
|
>>>>>>> a8c20960968cbcde30318c14633993aaff66a437
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vue/compiler-dom': 3.5.21
|
'@vue/compiler-dom': 3.5.21
|
||||||
'@vue/compiler-sfc': 3.5.21
|
'@vue/compiler-sfc': 3.5.21
|
||||||
@@ -272,8 +289,140 @@ packages:
|
|||||||
'@vue/shared': 3.5.21
|
'@vue/shared': 3.5.21
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
/ysk-utils@1.0.35:
|
/ysk-utils@1.0.35:
|
||||||
resolution: {integrity: sha512-kxPtEk5zs0HjdazbH2l2x1Tm5BUpmj1MBiOnb9Xquuj2hW2NtICtq+JB6RWFO7tzAAnOC5MRw366VOKceyeK5Q==}
|
resolution: {integrity: sha512-kxPtEk5zs0HjdazbH2l2x1Tm5BUpmj1MBiOnb9Xquuj2hW2NtICtq+JB6RWFO7tzAAnOC5MRw366VOKceyeK5Q==}
|
||||||
|
=======
|
||||||
|
'@babel/types@7.28.4':
|
||||||
|
dependencies:
|
||||||
|
'@babel/helper-string-parser': 7.27.1
|
||||||
|
'@babel/helper-validator-identifier': 7.27.1
|
||||||
|
|
||||||
|
'@dcloudio/types@3.4.21': {}
|
||||||
|
|
||||||
|
'@dcloudio/uni-app@2.0.2-4070620250821001(@dcloudio/types@3.4.21)(@vue/composition-api@1.7.2(vue@3.5.22))':
|
||||||
|
dependencies:
|
||||||
|
'@dcloudio/types': 3.4.21
|
||||||
|
'@vue/composition-api': 1.7.2(vue@3.5.22)
|
||||||
|
|
||||||
|
'@jridgewell/sourcemap-codec@1.5.5': {}
|
||||||
|
|
||||||
|
'@vue/compiler-core@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@babel/parser': 7.28.4
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
entities: 4.5.0
|
||||||
|
estree-walker: 2.0.2
|
||||||
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
|
'@vue/compiler-dom@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@vue/compiler-core': 3.5.22
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
|
||||||
|
'@vue/compiler-sfc@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@babel/parser': 7.28.4
|
||||||
|
'@vue/compiler-core': 3.5.22
|
||||||
|
'@vue/compiler-dom': 3.5.22
|
||||||
|
'@vue/compiler-ssr': 3.5.22
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
estree-walker: 2.0.2
|
||||||
|
magic-string: 0.30.19
|
||||||
|
postcss: 8.5.6
|
||||||
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
|
'@vue/compiler-ssr@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@vue/compiler-dom': 3.5.22
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
|
||||||
|
'@vue/composition-api@1.7.2(vue@3.5.22)':
|
||||||
|
dependencies:
|
||||||
|
vue: 3.5.22
|
||||||
|
|
||||||
|
'@vue/devtools-api@6.6.4': {}
|
||||||
|
|
||||||
|
'@vue/reactivity@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
|
||||||
|
'@vue/runtime-core@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@vue/reactivity': 3.5.22
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
|
||||||
|
'@vue/runtime-dom@3.5.22':
|
||||||
|
dependencies:
|
||||||
|
'@vue/reactivity': 3.5.22
|
||||||
|
'@vue/runtime-core': 3.5.22
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
csstype: 3.1.3
|
||||||
|
|
||||||
|
'@vue/server-renderer@3.5.22(vue@3.5.22)':
|
||||||
|
dependencies:
|
||||||
|
'@vue/compiler-ssr': 3.5.22
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
vue: 3.5.22
|
||||||
|
|
||||||
|
'@vue/shared@3.5.22': {}
|
||||||
|
|
||||||
|
bignumber.js@9.3.1: {}
|
||||||
|
|
||||||
|
csstype@3.1.3: {}
|
||||||
|
|
||||||
|
dayjs@1.11.18: {}
|
||||||
|
|
||||||
|
entities@4.5.0: {}
|
||||||
|
|
||||||
|
estree-walker@2.0.2: {}
|
||||||
|
|
||||||
|
jsbarcode@3.12.1: {}
|
||||||
|
|
||||||
|
lodash@4.17.21: {}
|
||||||
|
|
||||||
|
magic-string@0.30.19:
|
||||||
|
dependencies:
|
||||||
|
'@jridgewell/sourcemap-codec': 1.5.5
|
||||||
|
|
||||||
|
nanoid@3.3.11: {}
|
||||||
|
|
||||||
|
picocolors@1.1.1: {}
|
||||||
|
|
||||||
|
pinia-plugin-unistorage@0.1.2: {}
|
||||||
|
|
||||||
|
pinia@2.3.1(@vue/composition-api@1.7.2(vue@3.5.22))(vue@3.5.22):
|
||||||
|
dependencies:
|
||||||
|
'@vue/devtools-api': 6.6.4
|
||||||
|
vue: 3.5.22
|
||||||
|
vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.5.22))(vue@3.5.22)
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- '@vue/composition-api'
|
||||||
|
|
||||||
|
postcss@8.5.6:
|
||||||
|
dependencies:
|
||||||
|
nanoid: 3.3.11
|
||||||
|
picocolors: 1.1.1
|
||||||
|
source-map-js: 1.2.1
|
||||||
|
|
||||||
|
source-map-js@1.2.1: {}
|
||||||
|
|
||||||
|
vue-demi@0.14.10(@vue/composition-api@1.7.2(vue@3.5.22))(vue@3.5.22):
|
||||||
|
dependencies:
|
||||||
|
vue: 3.5.22
|
||||||
|
optionalDependencies:
|
||||||
|
'@vue/composition-api': 1.7.2(vue@3.5.22)
|
||||||
|
|
||||||
|
vue@3.5.22:
|
||||||
|
dependencies:
|
||||||
|
'@vue/compiler-dom': 3.5.22
|
||||||
|
'@vue/compiler-sfc': 3.5.22
|
||||||
|
'@vue/runtime-dom': 3.5.22
|
||||||
|
'@vue/server-renderer': 3.5.22(vue@3.5.22)
|
||||||
|
'@vue/shared': 3.5.22
|
||||||
|
|
||||||
|
ysk-utils@1.0.35:
|
||||||
|
>>>>>>> a8c20960968cbcde30318c14633993aaff66a437
|
||||||
dependencies:
|
dependencies:
|
||||||
bignumber.js: 9.3.1
|
bignumber.js: 9.3.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
productminiApphotsquery,
|
productminiApphotsquery,
|
||||||
APIgroupquery,
|
APIgroupquery,
|
||||||
} from "@/common/api/product/product.js";
|
} from "@/common/api/product/product.js";
|
||||||
|
|
||||||
export const useCartsStore = defineStore('cart',
|
export const useCartsStore = defineStore('cart',
|
||||||
() => {
|
() => {
|
||||||
|
|
||||||
@@ -42,11 +43,15 @@ export const useCartsStore = defineStore('cart',
|
|||||||
} :
|
} :
|
||||||
undefined;
|
undefined;
|
||||||
|
|
||||||
|
const goods = getProductDetails({
|
||||||
|
...item,
|
||||||
|
product_id: item.product_id || item.productId,
|
||||||
|
sku_id:item.skuId||item.sku_id
|
||||||
|
})
|
||||||
return {
|
return {
|
||||||
...item,
|
...item,
|
||||||
id: item.id,
|
id: item.id,
|
||||||
|
sku_id:item.skuId||item.sku_id,
|
||||||
product_id: item.product_id || item.productId,
|
product_id: item.product_id || item.productId,
|
||||||
salePrice: item.salePrice || item.price,
|
salePrice: item.salePrice || item.price,
|
||||||
number: item.number || item.num || 0,
|
number: item.number || item.num || 0,
|
||||||
@@ -56,7 +61,7 @@ export const useCartsStore = defineStore('cart',
|
|||||||
returnNum: item.returnNum || 0,
|
returnNum: item.returnNum || 0,
|
||||||
memberPrice: item.memberPrice || 0,
|
memberPrice: item.memberPrice || 0,
|
||||||
discountSaleAmount: item.discount_sale_amount || item.discountSaleAmount || 0,
|
discountSaleAmount: item.discount_sale_amount || item.discountSaleAmount || 0,
|
||||||
packFee: item.packFee || 0,
|
packFee: item.packFee || (goods?goods.packFee:0) || 0,
|
||||||
packNumber: item.pack_number || item.packNumber || 0,
|
packNumber: item.pack_number || item.packNumber || 0,
|
||||||
activityInfo: item.activityInfo ? {
|
activityInfo: item.activityInfo ? {
|
||||||
type: item.activityInfo.type,
|
type: item.activityInfo.type,
|
||||||
@@ -68,7 +73,9 @@ export const useCartsStore = defineStore('cart',
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 合并所有商品列表
|
// 合并所有商品列表
|
||||||
const allGoods = computed(() => {
|
const allGoods = ref([])
|
||||||
|
|
||||||
|
function getAllGoodsList() {
|
||||||
const currentGoods = (carts.value).map(convertToBaseCartItem);
|
const currentGoods = (carts.value).map(convertToBaseCartItem);
|
||||||
const giftGoods = [].map(convertToBaseCartItem);
|
const giftGoods = [].map(convertToBaseCartItem);
|
||||||
// 扁平化历史订单商品
|
// 扁平化历史订单商品
|
||||||
@@ -76,7 +83,7 @@ export const useCartsStore = defineStore('cart',
|
|||||||
.flat()
|
.flat()
|
||||||
.map(convertToBaseCartItem);
|
.map(convertToBaseCartItem);
|
||||||
return [...currentGoods, ...giftGoods, ...oldOrderGoods];
|
return [...currentGoods, ...giftGoods, ...oldOrderGoods];
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
// 就餐类型 'dine-in' | 'take-out'
|
// 就餐类型 'dine-in' | 'take-out'
|
||||||
@@ -162,6 +169,8 @@ export const useCartsStore = defineStore('cart',
|
|||||||
const cartOrder = ref({});
|
const cartOrder = ref({});
|
||||||
// 订单费用汇总
|
// 订单费用汇总
|
||||||
const orderCostSummary = computed(() => {
|
const orderCostSummary = computed(() => {
|
||||||
|
allGoods.value = getAllGoodsList()
|
||||||
|
console.log('orderCostSummary:allGoods.value',allGoods.value );
|
||||||
const costSummary = OrderPriceCalculator.calculateOrderCostSummary(
|
const costSummary = OrderPriceCalculator.calculateOrderCostSummary(
|
||||||
allGoods.value,
|
allGoods.value,
|
||||||
dinnerType.value,
|
dinnerType.value,
|
||||||
@@ -193,6 +202,8 @@ export const useCartsStore = defineStore('cart',
|
|||||||
setGoodsMap(product.id, product)
|
setGoodsMap(product.id, product)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
allGoods.value = getAllGoodsList()
|
||||||
|
console.log('allGoods.value ',allGoods.value );
|
||||||
goodsIsloading.value = false
|
goodsIsloading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,8 +226,6 @@ export const useCartsStore = defineStore('cart',
|
|||||||
let skuData = undefined;
|
let skuData = undefined;
|
||||||
skuData = goods?.skuList.find((sku) => sku.id == v.sku_id);
|
skuData = goods?.skuList.find((sku) => sku.id == v.sku_id);
|
||||||
|
|
||||||
skuData = goods?.skuList.find((sku) => sku.id == v.sku_id);
|
|
||||||
|
|
||||||
if (skuData) {
|
if (skuData) {
|
||||||
return {
|
return {
|
||||||
...v,
|
...v,
|
||||||
@@ -576,7 +585,8 @@ export const useCartsStore = defineStore('cart',
|
|||||||
seatFeeConfig,
|
seatFeeConfig,
|
||||||
shopInfo,
|
shopInfo,
|
||||||
//新客立减金额
|
//新客立减金额
|
||||||
newUserDiscount
|
newUserDiscount,
|
||||||
|
getAllGoodsList
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -4,7 +4,7 @@
|
|||||||
<view class="top" style=" background-image: url(/static/czzx_header_bg.png);">
|
<view class="top" style=" background-image: url(/static/czzx_header_bg.png);">
|
||||||
<view>
|
<view>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
<up-avatar size="136rpx" shape="square" round="20rpx" :src="shopInfo.coverImg"></up-avatar>
|
<up-avatar size="136rpx" shape="square" round="20rpx" :src="shopInfo.logo"></up-avatar>
|
||||||
<view class="u-p-l-20">
|
<view class="u-p-l-20">
|
||||||
<view class="shop-name u-line-1">{{shopInfo.shopName||'店铺名称' }}</view>
|
<view class="shop-name u-line-1">{{shopInfo.shopName||'店铺名称' }}</view>
|
||||||
<view class="u-flex">
|
<view class="u-flex">
|
||||||
|
|||||||
Reference in New Issue
Block a user