代客下单修改,问题修复
This commit is contained in:
@@ -3,7 +3,7 @@ const request = http.request
|
|||||||
import {marketUrl} from '../prveUrl.js'
|
import {marketUrl} from '../prveUrl.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 限时折扣
|
* 新客立减
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function getDiscountByUserId(params) {
|
export function getDiscountByUserId(params) {
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ function returnGoodsIsUseVipPrice(
|
|||||||
user: ShopUserInfo,
|
user: ShopUserInfo,
|
||||||
goods: BaseCartItem
|
goods: BaseCartItem
|
||||||
) {
|
) {
|
||||||
if (goods.is_time_discount) {
|
if (goods.is_time_discount || goods.isTimeDiscount) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (shopInfo.isMemberPrice != 1 || user.isVip != 1) {
|
if (shopInfo.isMemberPrice != 1 || user.isVip != 1) {
|
||||||
@@ -213,15 +213,16 @@ function returnCanCalcGoodsList(
|
|||||||
shopInfo: ShopInfo,
|
shopInfo: ShopInfo,
|
||||||
user: ShopUserInfo
|
user: ShopUserInfo
|
||||||
) {
|
) {
|
||||||
|
|
||||||
return canCalcGoodsArr.filter((goods) => {
|
return canCalcGoodsArr.filter((goods) => {
|
||||||
console.log("goods");
|
|
||||||
console.log(goods);
|
|
||||||
if (
|
if (
|
||||||
!coupon.discountShare &&
|
!coupon.discountShare &&
|
||||||
(goods.is_time_discount || goods.isTimeDiscount)
|
(goods.is_time_discount || goods.isTimeDiscount)
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!coupon.vipPriceShare &&
|
!coupon.vipPriceShare &&
|
||||||
returnGoodsIsUseVipPrice(shopInfo, user, goods)
|
returnGoodsIsUseVipPrice(shopInfo, user, goods)
|
||||||
@@ -290,14 +291,15 @@ export function returnCouponCanUse(args: couponCalcParams) {
|
|||||||
return coupon.thresholdFoods.find((food) => food.id == v.productId);
|
return coupon.thresholdFoods.find((food) => food.id == v.productId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
canCalcGoodsArr = returnCanCalcGoodsList(
|
canCalcGoodsArr = returnCanCalcGoodsList(
|
||||||
canCalcGoodsArr,
|
canCalcGoodsArr,
|
||||||
coupon,
|
coupon,
|
||||||
shopInfo,
|
shopInfo,
|
||||||
user
|
user
|
||||||
);
|
);
|
||||||
console.log("canCalcGoodsArr");
|
|
||||||
console.log(canCalcGoodsArr);
|
|
||||||
fullAmount = canCalcGoodsArr.reduce((pre, cur) => {
|
fullAmount = canCalcGoodsArr.reduce((pre, cur) => {
|
||||||
return (
|
return (
|
||||||
pre +
|
pre +
|
||||||
@@ -332,8 +334,10 @@ export function returnCouponCanUse(args: couponCalcParams) {
|
|||||||
reason: "当前选中的券不可与其他券同享",
|
reason: "当前选中的券不可与其他券同享",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// 满减券和折扣券计算门槛金额是否满足
|
// 满减券和折扣券计算门槛金额是否满足
|
||||||
if ([1, 3].includes(coupon.type)) {
|
if ([1, 3].includes(coupon.type)) {
|
||||||
|
|
||||||
if (canCalcGoodsArr.length <= 0) {
|
if (canCalcGoodsArr.length <= 0) {
|
||||||
return {
|
return {
|
||||||
canUse: false,
|
canUse: false,
|
||||||
@@ -644,8 +648,8 @@ export function returnCouponProductDiscount(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 返回买一送一券抵扣详情
|
|
||||||
/**
|
/**
|
||||||
|
* 返回买一送一券抵扣详情
|
||||||
* @param canDikouGoodsArr 可抵扣商品列表
|
* @param canDikouGoodsArr 可抵扣商品列表
|
||||||
* @param coupon 优惠券
|
* @param coupon 优惠券
|
||||||
* @param user 用户信息
|
* @param user 用户信息
|
||||||
@@ -784,6 +788,7 @@ export function returnCanDikouGoods(
|
|||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const utils = {
|
export const utils = {
|
||||||
returnGoodsPrice,
|
returnGoodsPrice,
|
||||||
returnGoodsGroupMap,
|
returnGoodsGroupMap,
|
||||||
|
|||||||
26
lib/goods.ts
26
lib/goods.ts
@@ -117,6 +117,7 @@ export function returnCanUseLimitTimeDiscount(
|
|||||||
useVipPrice: boolean,
|
useVipPrice: boolean,
|
||||||
idKey = "product_id"
|
idKey = "product_id"
|
||||||
) {
|
) {
|
||||||
|
goods={...goods,product_id:goods.product_id||goods.productId|| goods.id|| ''}
|
||||||
if (!limitTimeDiscount || !limitTimeDiscount.id) {
|
if (!limitTimeDiscount || !limitTimeDiscount.id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -135,8 +136,12 @@ export function returnCanUseLimitTimeDiscount(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (useVipPrice && goods.hasOwnProperty("memberPrice")) {
|
if (useVipPrice && goods.hasOwnProperty("memberPrice")) {
|
||||||
if (goods.memberPrice && goods.memberPrice * 1 <= 0) {
|
|
||||||
|
if ( goods.memberPrice * 1 <= 0) {
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,12 +171,18 @@ function returnLimitPrice(
|
|||||||
const discountRate = new BigNumber(limitTimeDiscount.discountRate).dividedBy(
|
const discountRate = new BigNumber(limitTimeDiscount.discountRate).dividedBy(
|
||||||
100
|
100
|
||||||
);
|
);
|
||||||
|
let canuseLimit=false;
|
||||||
const canuseLimit = returnCanUseLimitTimeDiscount(
|
if(goods.hasOwnProperty('isTimeDiscount')||goods.hasOwnProperty('is_time_discount')){
|
||||||
|
canuseLimit=goods.isTimeDiscount?true:goods.is_time_discount?true:false;
|
||||||
|
}else{
|
||||||
|
canuseLimit = returnCanUseLimitTimeDiscount(
|
||||||
goods,
|
goods,
|
||||||
limitTimeDiscount,
|
limitTimeDiscount,
|
||||||
useVipPrice
|
useVipPrice
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (canuseLimit) {
|
if (canuseLimit) {
|
||||||
//可以使用限时折扣
|
//可以使用限时折扣
|
||||||
if (limitTimeDiscount.discountPriority == "limit-time") {
|
if (limitTimeDiscount.discountPriority == "limit-time") {
|
||||||
@@ -183,6 +194,7 @@ function returnLimitPrice(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (limitTimeDiscount.discountPriority == "vip-price") {
|
if (limitTimeDiscount.discountPriority == "vip-price") {
|
||||||
|
|
||||||
//会员价优先
|
//会员价优先
|
||||||
if (useVipPrice && goods.memberPrice && goods.memberPrice * 1 > 0) {
|
if (useVipPrice && goods.memberPrice && goods.memberPrice * 1 > 0) {
|
||||||
//使用会员价
|
//使用会员价
|
||||||
@@ -228,7 +240,8 @@ export function returnCalcPrice(
|
|||||||
fullReductionActivitie.discountShare == 1 &&
|
fullReductionActivitie.discountShare == 1 &&
|
||||||
fullReductionActivitie.vipPriceShare == 1
|
fullReductionActivitie.vipPriceShare == 1
|
||||||
) {
|
) {
|
||||||
//与限时折扣同享,与会员价不同享
|
console.log("与限时折扣同享,与会员价同享", goods);
|
||||||
|
//与限时折扣同享,与会员价同享
|
||||||
return returnLimitPrice(goods, limitTimeDiscount, useVipPrice);
|
return returnLimitPrice(goods, limitTimeDiscount, useVipPrice);
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
@@ -316,7 +329,7 @@ export function filterOptimalFullReductionActivity(
|
|||||||
// 第一步:基础筛选(未删除+当前店铺+活动进行中+就餐类型匹配)
|
// 第一步:基础筛选(未删除+当前店铺+活动进行中+就餐类型匹配)
|
||||||
const baseEligible = activities.filter((activity) => {
|
const baseEligible = activities.filter((activity) => {
|
||||||
return (
|
return (
|
||||||
activity.isDel !== true && // 未删除
|
// activity.isDel !== true && // 未删除
|
||||||
// activity.shopId === currentShopId && // 当前店铺
|
// activity.shopId === currentShopId && // 当前店铺
|
||||||
// activity.status === 2 && // 状态=2(进行中)
|
// activity.status === 2 && // 状态=2(进行中)
|
||||||
isDinnerTypeMatch(activity, currentDinnerType) && // 就餐类型匹配
|
isDinnerTypeMatch(activity, currentDinnerType) && // 就餐类型匹配
|
||||||
@@ -1090,7 +1103,7 @@ export function calculateOrderCostSummary(
|
|||||||
seatFee,
|
seatFee,
|
||||||
packFee
|
packFee
|
||||||
);
|
);
|
||||||
|
console.log("计算当前满减活动的门槛金额", usedFullReductionActivityFullAmount);
|
||||||
usedFullReductionThreshold = selectOptimalThreshold(
|
usedFullReductionThreshold = selectOptimalThreshold(
|
||||||
usedFullReductionActivity.thresholds,
|
usedFullReductionActivity.thresholds,
|
||||||
usedFullReductionActivityFullAmount,
|
usedFullReductionActivityFullAmount,
|
||||||
@@ -1098,7 +1111,6 @@ export function calculateOrderCostSummary(
|
|||||||
goodsRealAmount,
|
goodsRealAmount,
|
||||||
usedFullReductionActivity.discountShare || 0 // 与限时折扣同享规则
|
usedFullReductionActivity.discountShare || 0 // 与限时折扣同享规则
|
||||||
);
|
);
|
||||||
|
|
||||||
// 2.4 计算满减实际减免金额
|
// 2.4 计算满减实际减免金额
|
||||||
fullReductionAmount = calcFullReductionAmount(
|
fullReductionAmount = calcFullReductionAmount(
|
||||||
baseAfterNewUserDiscount,
|
baseAfterNewUserDiscount,
|
||||||
|
|||||||
14
lib/limit.ts
14
lib/limit.ts
@@ -29,6 +29,9 @@ export function canUseLimitTimeDiscount(
|
|||||||
) {
|
) {
|
||||||
shopInfo = shopInfo || {};
|
shopInfo = shopInfo || {};
|
||||||
shopUserInfo = shopUserInfo || {};
|
shopUserInfo = shopUserInfo || {};
|
||||||
|
if(shopInfo.isMemberPrice){
|
||||||
|
shopUserInfo.isMemberPrice=1
|
||||||
|
}
|
||||||
if (!limitTimeDiscountRes || !limitTimeDiscountRes.id) {
|
if (!limitTimeDiscountRes || !limitTimeDiscountRes.id) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -45,17 +48,15 @@ export function canUseLimitTimeDiscount(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (limitTimeDiscountRes.discountPriority == "vip-price") {
|
if (limitTimeDiscountRes.discountPriority == "vip-price") {
|
||||||
if (shopUserInfo.isVip != 1 || shopUserInfo.isMemberPrice != 1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
shopUserInfo.isVip == 1 &&
|
shopUserInfo.isVip == 1 &&
|
||||||
shopUserInfo.isMemberPrice == 1 &&
|
shopUserInfo.isMemberPrice == 1 &&
|
||||||
goods.memberPrice * 1 <= 0
|
goods.memberPrice * 1 > 0
|
||||||
) {
|
) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -138,7 +139,6 @@ export function returnPrice(args: returnPriceArgs) {
|
|||||||
return memberPrice;
|
return memberPrice;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// console.log('不是会员或者没有启用会员价',goods,limitTimeDiscountRes);
|
|
||||||
//不是会员或者没有启用会员价
|
//不是会员或者没有启用会员价
|
||||||
if (limitTimeDiscountRes && limitTimeDiscountRes.id && includesGoods) {
|
if (limitTimeDiscountRes && limitTimeDiscountRes.id && includesGoods) {
|
||||||
const price = returnLimitPrice({
|
const price = returnLimitPrice({
|
||||||
|
|||||||
@@ -286,6 +286,7 @@ export interface ShopUserInfo {
|
|||||||
isVip: number | null; //是否会员
|
isVip: number | null; //是否会员
|
||||||
discount: number | null; //用户折扣
|
discount: number | null; //用户折扣
|
||||||
isMemberPrice: number | null; //会员折扣与会员价是否同时使用
|
isMemberPrice: number | null; //会员折扣与会员价是否同时使用
|
||||||
|
id?: number; //用户ID
|
||||||
}
|
}
|
||||||
/** 订单额外费用配置 */
|
/** 订单额外费用配置 */
|
||||||
export interface OrderExtraConfig {
|
export interface OrderExtraConfig {
|
||||||
|
|||||||
7
main.js
7
main.js
@@ -7,6 +7,9 @@ import uviewPlus,{setConfig} from 'uview-plus'
|
|||||||
import dict from '@/commons/utils/dict.js'
|
import dict from '@/commons/utils/dict.js'
|
||||||
// 下面的在特殊场景下才需要配置,通常不用配置即可直接使用uvire-plus框架。
|
// 下面的在特殊场景下才需要配置,通常不用配置即可直接使用uvire-plus框架。
|
||||||
import {utils} from '@/commons/utils/index.js'
|
import {utils} from '@/commons/utils/index.js'
|
||||||
|
|
||||||
|
import * as Pinia from 'pinia';
|
||||||
|
|
||||||
// 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置
|
// 调用setConfig方法,方法内部会进行对象属性深度合并,可以放心嵌套配置
|
||||||
// 需要在app.use(uview-plus)之后执行
|
// 需要在app.use(uview-plus)之后执行
|
||||||
setConfig({
|
setConfig({
|
||||||
@@ -55,6 +58,7 @@ import { createSSRApp } from 'vue'
|
|||||||
import App from './App.vue'
|
import App from './App.vue'
|
||||||
export function createApp() {
|
export function createApp() {
|
||||||
const app = createSSRApp(App)
|
const app = createSSRApp(App)
|
||||||
|
app.use(Pinia.createPinia());
|
||||||
app.use(uviewPlus)
|
app.use(uviewPlus)
|
||||||
app.config.globalProperties.$appName = appConfig.appName
|
app.config.globalProperties.$appName = appConfig.appName
|
||||||
uni.$appName = appConfig.appName
|
uni.$appName = appConfig.appName
|
||||||
@@ -63,7 +67,8 @@ export function createApp() {
|
|||||||
app.config.globalProperties.$dict = dict
|
app.config.globalProperties.$dict = dict
|
||||||
uni.$dict = dict
|
uni.$dict = dict
|
||||||
return {
|
return {
|
||||||
app
|
app,
|
||||||
|
Pinia, // 此处必须将 Pinia 返回
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
"jsencrypt": "^3.3.2",
|
"jsencrypt": "^3.3.2",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"uview-plus": "^3.3.32",
|
"uview-plus": "^3.3.32",
|
||||||
"ysk-utils": "^1.0.70"
|
"ysk-utils": "^1.0.72"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"copy-webpack-plugin": "^12.0.2",
|
"copy-webpack-plugin": "^12.0.2",
|
||||||
|
|||||||
@@ -507,6 +507,8 @@ import { createOrder, getHistoryOrder } from "@/http/api/order.js";
|
|||||||
import { shopUserDetail } from "@/http/yskApi/shop-user.js";
|
import { shopUserDetail } from "@/http/yskApi/shop-user.js";
|
||||||
import { discountActivity } from "@/http/yskApi/market/discountActivity.js";
|
import { discountActivity } from "@/http/yskApi/market/discountActivity.js";
|
||||||
import BigNumber from "bignumber.js";
|
import BigNumber from "bignumber.js";
|
||||||
|
import * as limitTimeDiscountApi from "@/http/yskApi/limitTimeDiscount.js";
|
||||||
|
|
||||||
|
|
||||||
const models = new Map();
|
const models = new Map();
|
||||||
const modelData = reactive({
|
const modelData = reactive({
|
||||||
@@ -589,6 +591,28 @@ async function getDiscountActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实例
|
const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实例
|
||||||
|
|
||||||
|
const limitTimeDiscountRes = ref(null);
|
||||||
|
async function getLimit() {
|
||||||
|
const res = await limitTimeDiscountApi.limitTimeDiscount();
|
||||||
|
limitTimeDiscountRes.value = res.data;
|
||||||
|
if (pageData.table.tableCode) {
|
||||||
|
pageData.limitTimeDiscount = limitTimeDiscountRes.value;
|
||||||
|
|
||||||
|
websocketUtil.send(
|
||||||
|
JSON.stringify({
|
||||||
|
type: "shopping",
|
||||||
|
operate_type: "time_discount_save",
|
||||||
|
table_code: pageData.table.tableCode,
|
||||||
|
shop_id: uni.getStorageSync("shopInfo").id,
|
||||||
|
operate_type: "time_discount_save",
|
||||||
|
data: limitTimeDiscountRes.value,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
console.log("limitTimeDiscount",pageData.limitTimeDiscount );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onLoad(async (opt) => {
|
onLoad(async (opt) => {
|
||||||
Object.assign(option, opt);
|
Object.assign(option, opt);
|
||||||
console.log("opt====", opt);
|
console.log("opt====", opt);
|
||||||
@@ -596,6 +620,8 @@ onLoad(async (opt) => {
|
|||||||
pageData.table.id = opt.tableId;
|
pageData.table.id = opt.tableId;
|
||||||
pageData.table.tableCode = opt.tableCode;
|
pageData.table.tableCode = opt.tableCode;
|
||||||
}
|
}
|
||||||
|
//获取限时折扣
|
||||||
|
await getLimit();
|
||||||
//获取满减活动
|
//获取满减活动
|
||||||
await getDiscountActivity();
|
await getDiscountActivity();
|
||||||
pageData.shopInfo = uni.getStorageSync("shopInfo");
|
pageData.shopInfo = uni.getStorageSync("shopInfo");
|
||||||
@@ -640,6 +666,7 @@ onUnmounted(() => {
|
|||||||
* @param {Object} tableCode
|
* @param {Object} tableCode
|
||||||
*/
|
*/
|
||||||
async function getHistoryOrderDetail(tableCode) {
|
async function getHistoryOrderDetail(tableCode) {
|
||||||
|
|
||||||
let res = await getHistoryOrder({
|
let res = await getHistoryOrder({
|
||||||
tableCode: tableCode,
|
tableCode: tableCode,
|
||||||
});
|
});
|
||||||
@@ -868,6 +895,9 @@ async function getTableInfo(opt) {
|
|||||||
// 获取购物车数据
|
// 获取购物车数据
|
||||||
getCart();
|
getCart();
|
||||||
// 获取购物车数据
|
// 获取购物车数据
|
||||||
|
if(shopInfo.registerType==='before'){
|
||||||
|
return
|
||||||
|
}
|
||||||
getHistoryOrderDetail(opt.tableCode);
|
getHistoryOrderDetail(opt.tableCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ const is_time_discount = computed(() => {
|
|||||||
null,
|
null,
|
||||||
"id"
|
"id"
|
||||||
);
|
);
|
||||||
|
console.log("isCanuse", isCanuse,props.data);
|
||||||
return isCanuse;
|
return isCanuse;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ function confirm() {
|
|||||||
if (isDisabled.value) {
|
if (isDisabled.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
emits("confirm", goods.value, number.value,is_time_discount.value);
|
emits("confirm", goods.value, number.value,is_time_discount.value?1:0);
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<up-popup :show="popShow" @close="close" @open="open" mode="top" :round="0">
|
<up-popup :show="popShow" @close="close" @open="open" mode="top" :round="0">
|
||||||
<view class="u-p-32 box u-font-28">
|
<view class="u-p-32 box u-font-28">
|
||||||
<view style="display: flex;align-items: center;">
|
<view style="display: flex;align-items: center;">
|
||||||
<up-search v-model="searchVal" actionText="" @search="search" @clear="search"></up-search>
|
<up-search v-model="searchVal" actionText="" @search="search" @clear="search" clearabled :onlyClearableOnFocused ="false"></up-search>
|
||||||
<text @tap="search">搜索</text>
|
<text @tap="search">搜索</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -54,7 +54,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
console.log(searchVal.value, '值啊啊啊啊 ')
|
|
||||||
emits('search', searchVal.value)
|
emits('search', searchVal.value)
|
||||||
close()
|
close()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -344,7 +344,8 @@ import myCar from "./components/car";
|
|||||||
import go from "@/commons/utils/go.js";
|
import go from "@/commons/utils/go.js";
|
||||||
import infoBox from "@/commons/utils/infoBox.js";
|
import infoBox from "@/commons/utils/infoBox.js";
|
||||||
import { getNowCart } from "@/pagesCreateOrder/util.js";
|
import { getNowCart } from "@/pagesCreateOrder/util.js";
|
||||||
import yskUtils from "ysk-utils";
|
// import yskUtils from "ysk-utils";
|
||||||
|
import yskUtils from "@/lib/index";
|
||||||
provide("yskUtils", yskUtils);
|
provide("yskUtils", yskUtils);
|
||||||
import {
|
import {
|
||||||
$productCategory,
|
$productCategory,
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
<view class="u-m-t-32">
|
<view class="u-m-t-32">
|
||||||
<view class="u-flex u-row-right">
|
<view class="u-flex u-row-right">
|
||||||
<text>总计¥</text>
|
<text>总计¥</text>
|
||||||
<text class="font-bold u-font-32">{{originAmount.toFixed(2)}}</text>
|
<text class="font-bold u-font-32">{{data.payAmount||data.orderAmount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-row-right u-m-t-24" v-if="data.status == 'unpaid'||data.status == 'done'">
|
<view class="u-flex u-row-right u-m-t-24" v-if="data.status == 'unpaid'||data.status == 'done'">
|
||||||
<view class="print" @click.stop="print(item)">重新打印</view>
|
<view class="print" @click.stop="print(item)">重新打印</view>
|
||||||
|
|||||||
@@ -58,7 +58,10 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="border-bottom-dashed u-p-b-30 u-p-t-30"
|
class="border-bottom-dashed u-p-b-30 u-p-t-30"
|
||||||
v-if="orderCostSummary.fullReduction.actualAmount&&orderCostSummary.fullReduction.usedThreshold"
|
v-if="
|
||||||
|
orderCostSummary.fullReduction.actualAmount &&
|
||||||
|
orderCostSummary.fullReduction.usedThreshold
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between">
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between">
|
||||||
<view>满减活动</view>
|
<view>满减活动</view>
|
||||||
@@ -68,19 +71,26 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="border-bottom-dashed u-p-b-30 u-p-t-30">
|
<view class="border-bottom-dashed u-p-b-30 u-p-t-30">
|
||||||
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between" @click="toQuan">
|
<view class="u-flex u-p-l-24 u-p-r-24 u-row-between" @click="toQuan">
|
||||||
<view>优惠券</view>
|
<view>优惠券</view>
|
||||||
<view class="color-999 u-flex u-col-center">
|
<view class="color-999 u-flex u-col-center">
|
||||||
<text v-if="orderCostSummary.couponDeductionAmount <= 0"
|
<text
|
||||||
|
class="color-red"
|
||||||
|
v-if="orderCostSummary.fullReduction.usedThreshold"
|
||||||
|
>满减活动不可与优惠券同享</text
|
||||||
|
>
|
||||||
|
<text v-else-if="orderCostSummary.couponDeductionAmount <= 0"
|
||||||
>选择优惠券</text
|
>选择优惠券</text
|
||||||
>
|
>
|
||||||
<text class="color-red" v-else>
|
<text class="color-red" v-else>
|
||||||
-¥{{ orderCostSummary.couponDeductionAmount }}
|
-¥{{ orderCostSummary.couponDeductionAmount }}
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<view class="u-flex u-col-center">
|
<view
|
||||||
|
class="u-flex u-col-center"
|
||||||
|
v-if="!orderCostSummary.fullReduction.usedThreshold"
|
||||||
|
>
|
||||||
<uni-icons type="right" color="#999"></uni-icons>
|
<uni-icons type="right" color="#999"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -229,9 +239,9 @@
|
|||||||
<view class="" v-if="accountPoints.calcRes.usable">
|
<view class="" v-if="accountPoints.calcRes.usable">
|
||||||
<text class="color-red">*</text>
|
<text class="color-red">*</text>
|
||||||
<text class="" v-if="accountPoints.calcRes.equivalentPoints"
|
<text class="" v-if="accountPoints.calcRes.equivalentPoints"
|
||||||
>100积分等于{{
|
>{{
|
||||||
to2(accountPoints.calcRes.equivalentPoints * 100)
|
accountPoints.calcRes.equivalentPoints
|
||||||
}}元,</text
|
}}积分等于1元,</text
|
||||||
>
|
>
|
||||||
<text>
|
<text>
|
||||||
最大抵扣积分{{ accountPoints.calcRes.maxUsablePoints }}
|
最大抵扣积分{{ accountPoints.calcRes.maxUsablePoints }}
|
||||||
@@ -360,7 +370,8 @@ import {
|
|||||||
consumeAwardPoints,
|
consumeAwardPoints,
|
||||||
} from "@/http/api/points.js";
|
} from "@/http/api/points.js";
|
||||||
|
|
||||||
import yskUtils from "ysk-utils";
|
// import yskUtils from "ysk-utils";
|
||||||
|
import yskUtils from "@/lib/index";
|
||||||
|
|
||||||
const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实例
|
const websocketUtil = inject("websocketUtil"); // 注入 WebSocket 工具类实例
|
||||||
const modal = reactive({
|
const modal = reactive({
|
||||||
@@ -438,7 +449,7 @@ onLoad(async (opt) => {
|
|||||||
Object.assign(order, opt);
|
Object.assign(order, opt);
|
||||||
Object.assign(options, opt);
|
Object.assign(options, opt);
|
||||||
await getPayType();
|
await getPayType();
|
||||||
await getDiscountActivity()
|
await getDiscountActivity();
|
||||||
console.log("pays.payTypes.list");
|
console.log("pays.payTypes.list");
|
||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
@@ -503,6 +514,7 @@ async function init() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
pageData.seatNum = order.seatNum;
|
pageData.seatNum = order.seatNum;
|
||||||
|
seatFeeConfig.personCount = order.seatNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -524,22 +536,6 @@ const coupAllPrice = computed(() => {
|
|||||||
return n;
|
return n;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜品打包费
|
|
||||||
*/
|
|
||||||
const packAmount = computed(() => {
|
|
||||||
if (pageData.goodsList) {
|
|
||||||
let price = pageData.goodsList
|
|
||||||
.filter((v) => v.packNumber > 0 && v.status !== "return")
|
|
||||||
.reduce((a, b) => {
|
|
||||||
console.log(b);
|
|
||||||
return a + ((b.packAmount || 0) * b.packNumber).toFixed(2) * 1;
|
|
||||||
}, 0);
|
|
||||||
// console.log("菜品打包费===",price)
|
|
||||||
return price;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 桌位费
|
* 桌位费
|
||||||
*/
|
*/
|
||||||
@@ -548,29 +544,6 @@ const tableFee = computed(() => {
|
|||||||
return order.seatNum > 0 ? order.seatNum * pageData.shopInfo.tableFee : 0;
|
return order.seatNum > 0 ? order.seatNum * pageData.shopInfo.tableFee : 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜品金额
|
|
||||||
*/
|
|
||||||
const originPrice = computed(() => {
|
|
||||||
if (pageData.goodsList) {
|
|
||||||
let goodsPrice = pageData.goodsList
|
|
||||||
.filter((v) => v.price != 0 && v.status !== "return")
|
|
||||||
.reduce((a, b) => {
|
|
||||||
return a + parseFloat(mathFloorPrice(b.num * b.price, b));
|
|
||||||
}, 0);
|
|
||||||
// console.log("菜品原金额===",goodsPrice)
|
|
||||||
return (
|
|
||||||
parseFloat(goodsPrice) +
|
|
||||||
parseFloat(tableFee.value) +
|
|
||||||
parseFloat(packAmount.value)
|
|
||||||
).toFixed(2);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 计算商家减免前金额(使用bignumber.js确保精度)
|
// 计算商家减免前金额(使用bignumber.js确保精度)
|
||||||
const returnMerchantReductionBeforeMoney = computed(() => {
|
const returnMerchantReductionBeforeMoney = computed(() => {
|
||||||
const total = BigNumber(orderCostSummary.value.finalPayAmount).plus(
|
const total = BigNumber(orderCostSummary.value.finalPayAmount).plus(
|
||||||
@@ -715,6 +688,14 @@ watch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
watch(
|
||||||
|
() => pageData.user.id,
|
||||||
|
(newval) => {
|
||||||
|
if (newval) {
|
||||||
|
getCalcUsablePoints();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
watch(
|
watch(
|
||||||
() => orderCostSummary.value.finalPayAmount,
|
() => orderCostSummary.value.finalPayAmount,
|
||||||
(newval) => {
|
(newval) => {
|
||||||
@@ -787,7 +768,9 @@ function getPayParam() {
|
|||||||
: "",
|
: "",
|
||||||
|
|
||||||
discountActAmount: orderCostSummary.value.fullReduction.actualAmount, //满减抵扣金额
|
discountActAmount: orderCostSummary.value.fullReduction.actualAmount, //满减抵扣金额
|
||||||
discountActId: (orderCostSummary.value.fullReduction.usedActivity&&orderCostSummary.value.fullReduction.usedThreshold)
|
discountActId:
|
||||||
|
orderCostSummary.value.fullReduction.usedActivity &&
|
||||||
|
orderCostSummary.value.fullReduction.usedThreshold
|
||||||
? orderCostSummary.value.fullReduction.usedActivity.id
|
? orderCostSummary.value.fullReduction.usedActivity.id
|
||||||
: null,
|
: null,
|
||||||
vipPrice: isVip.value ? 1 : 0, // 是否使用会员价
|
vipPrice: isVip.value ? 1 : 0, // 是否使用会员价
|
||||||
@@ -852,7 +835,7 @@ async function getPayType() {
|
|||||||
}
|
}
|
||||||
pays.payTypes.list.push({
|
pays.payTypes.list.push({
|
||||||
...v,
|
...v,
|
||||||
disabled
|
disabled,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -919,20 +902,20 @@ function changeAccountPoints() {
|
|||||||
* 选择优惠券
|
* 选择优惠券
|
||||||
*/
|
*/
|
||||||
function toQuan() {
|
function toQuan() {
|
||||||
console.log("toQuan", order);
|
if (orderCostSummary.value.fullReduction.usedThreshold) {
|
||||||
console.log("pageData.user", pageData.user);
|
return infoBox.showToast("满减活动不可与优惠券同享");
|
||||||
if(orderCostSummary.value.usedActivity){
|
|
||||||
return infoBox.showToast("满减活动不可与优惠券同享")
|
|
||||||
}
|
}
|
||||||
if (!order.userId && !pageData.user.id) {
|
if (!order.userId && !pageData.user.id) {
|
||||||
return infoBox.showToast("请先选择会员", 0.5).then(() => {
|
return infoBox.showToast("请先选择会员", 0.5).then(() => {
|
||||||
chooseUser();
|
chooseUser();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
uni.setStorageSync("selCoupon", selCoupon.value);
|
||||||
|
|
||||||
go.to("PAGES_ORDER_QUAN", {
|
go.to("PAGES_ORDER_QUAN", {
|
||||||
orderId: order.id,
|
orderId: order.id,
|
||||||
shopUserId: pageData.user.id,
|
shopUserId: pageData.user.id,
|
||||||
orderPrice: (payPrice.value * 1 + coupAllPrice.value * 1).toFixed(2),
|
orderPrice: BigNumber(payPrice.value).plus(BigNumber(orderCostSummary.value.couponDeductionAmount)).decimalPlaces(2, BigNumber.ROUND_DOWN)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1016,7 +999,6 @@ function uodateCartAndHistory() {
|
|||||||
history: [],
|
history: [],
|
||||||
cart: [],
|
cart: [],
|
||||||
};
|
};
|
||||||
console.log("uodateCartAndHistory", pageData.user);
|
|
||||||
for (let cart of pageData.goodsList) {
|
for (let cart of pageData.goodsList) {
|
||||||
const canUseLimitTimeDiscount = yskUtils.limitUtils.canUseLimitTimeDiscount(
|
const canUseLimitTimeDiscount = yskUtils.limitUtils.canUseLimitTimeDiscount(
|
||||||
cart,
|
cart,
|
||||||
@@ -1027,14 +1009,14 @@ function uodateCartAndHistory() {
|
|||||||
)
|
)
|
||||||
? 1
|
? 1
|
||||||
: 0;
|
: 0;
|
||||||
console.log("uodateCartAndHistory", pageData.user);
|
if (canUseLimitTimeDiscount != cart.isTimeDiscount) {
|
||||||
if (canUseLimitTimeDiscount != cart.is_time_discount) {
|
newData.history.push({
|
||||||
newData.cart.push({
|
|
||||||
id: cart.id,
|
id: cart.id,
|
||||||
is_time_discount: canUseLimitTimeDiscount,
|
is_time_discount: canUseLimitTimeDiscount,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newData.history.length <= 0 && newData.cart.length <= 0) {
|
if (newData.history.length <= 0 && newData.cart.length <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1062,8 +1044,7 @@ function getShopUserDetail() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const newUserDiscountRes = ref(null);
|
||||||
const newUserDiscountRes=ref(null)
|
|
||||||
//获取用户新客立减
|
//获取用户新客立减
|
||||||
function getNewUserDiscount() {
|
function getNewUserDiscount() {
|
||||||
getDiscountByUserId({
|
getDiscountByUserId({
|
||||||
@@ -1391,7 +1372,7 @@ function onMessage() {
|
|||||||
websocketUtil.offMessage();
|
websocketUtil.offMessage();
|
||||||
websocketUtil.onMessage((res) => {
|
websocketUtil.onMessage((res) => {
|
||||||
let msg = JSON.parse(res);
|
let msg = JSON.parse(res);
|
||||||
|
console.log("onMessage", msg);
|
||||||
switch (msg.operate_type) {
|
switch (msg.operate_type) {
|
||||||
case "pad_init":
|
case "pad_init":
|
||||||
getHistoryAndUpdateGoodsList();
|
getHistoryAndUpdateGoodsList();
|
||||||
@@ -1402,6 +1383,9 @@ function onMessage() {
|
|||||||
case "pad_edit":
|
case "pad_edit":
|
||||||
case "edit":
|
case "edit":
|
||||||
break;
|
break;
|
||||||
|
case "bulk_edit":
|
||||||
|
getHistoryAndUpdateGoodsList();
|
||||||
|
break;
|
||||||
case "pad_del":
|
case "pad_del":
|
||||||
case "del":
|
case "del":
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -336,12 +336,7 @@ const limitTimeDiscount = reactive({ id: "" });
|
|||||||
const quansSelArr = computed(() => {
|
const quansSelArr = computed(() => {
|
||||||
return [couponSel.value, goodsCouponSel.value].filter((v) => v.id);
|
return [couponSel.value, goodsCouponSel.value].filter((v) => v.id);
|
||||||
});
|
});
|
||||||
const querForm = ref({
|
|
||||||
searchValue: "",
|
|
||||||
shopId: "",
|
|
||||||
shopName: "",
|
|
||||||
statusActiveIndex: 0,
|
|
||||||
});
|
|
||||||
const list = reactive({
|
const list = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
size: 10,
|
size: 10,
|
||||||
@@ -372,8 +367,9 @@ function formatCoupon() {
|
|||||||
|
|
||||||
for (let i = 0; i < couponList.value.length; i++) {
|
for (let i = 0; i < couponList.value.length; i++) {
|
||||||
const coupon = couponList.value[i];
|
const coupon = couponList.value[i];
|
||||||
|
console.log('quansSelArr',quansSelArr.value)
|
||||||
const selCoupon =
|
const selCoupon =
|
||||||
myQuan.types.sel != 1
|
myQuan.types.sel ==1
|
||||||
? quansSelArr.value.filter((v) => v.type != 2)
|
? quansSelArr.value.filter((v) => v.type != 2)
|
||||||
: quansSelArr.value.filter((v) => v.type == 2);
|
: quansSelArr.value.filter((v) => v.type == 2);
|
||||||
const canuseResult = yskUtils.couponUtils.returnCouponCanUse({
|
const canuseResult = yskUtils.couponUtils.returnCouponCanUse({
|
||||||
@@ -585,6 +581,14 @@ async function getShopUser() {
|
|||||||
}
|
}
|
||||||
onLoad(async (opt) => {
|
onLoad(async (opt) => {
|
||||||
Object.assign(option, opt);
|
Object.assign(option, opt);
|
||||||
|
const selCoupon=uni.getStorageSync("selCoupon")||[];
|
||||||
|
for(let i=0;i<selCoupon.length;i++){
|
||||||
|
if(selCoupon[i].type==2){
|
||||||
|
goodsCouponSel.value=selCoupon[i];
|
||||||
|
}else{
|
||||||
|
couponSel.value=selCoupon[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
await getShopUser();
|
await getShopUser();
|
||||||
getQuan();
|
getQuan();
|
||||||
});
|
});
|
||||||
|
|||||||
26
pnpm-lock.yaml
generated
26
pnpm-lock.yaml
generated
@@ -36,8 +36,8 @@ importers:
|
|||||||
specifier: ^3.3.32
|
specifier: ^3.3.32
|
||||||
version: 3.6.10
|
version: 3.6.10
|
||||||
ysk-utils:
|
ysk-utils:
|
||||||
specifier: ^1.0.70
|
specifier: ^1.0.72
|
||||||
version: 1.0.70
|
version: 1.0.72
|
||||||
devDependencies:
|
devDependencies:
|
||||||
copy-webpack-plugin:
|
copy-webpack-plugin:
|
||||||
specifier: ^12.0.2
|
specifier: ^12.0.2
|
||||||
@@ -294,8 +294,8 @@ packages:
|
|||||||
buffer@5.7.1:
|
buffer@5.7.1:
|
||||||
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
|
resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==}
|
||||||
|
|
||||||
caniuse-lite@1.0.30001754:
|
caniuse-lite@1.0.30001755:
|
||||||
resolution: {integrity: sha512-x6OeBXueoAceOmotzx3PO4Zpt4rzpeIFsSr6AAePTZxSkXiYDUmpypEl7e2+8NCd9bD7bXjqyef8CJYPC1jfxg==}
|
resolution: {integrity: sha512-44V+Jm6ctPj7R52Na4TLi3Zri4dWUljJd+RDm+j8LtNCc/ihLCT+X1TzoOAkRETEWqjuLnh9581Tl80FvK7jVA==}
|
||||||
|
|
||||||
chokidar@4.0.3:
|
chokidar@4.0.3:
|
||||||
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
|
resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==}
|
||||||
@@ -328,8 +328,8 @@ packages:
|
|||||||
engines: {node: '>=0.10'}
|
engines: {node: '>=0.10'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
electron-to-chromium@1.5.252:
|
electron-to-chromium@1.5.254:
|
||||||
resolution: {integrity: sha512-53uTpjtRgS7gjIxZ4qCgFdNO2q+wJt/Z8+xAvxbCqXPJrY6h7ighUkadQmNMXH96crtpa6gPFNP7BF4UBGDuaA==}
|
resolution: {integrity: sha512-DcUsWpVhv9svsKRxnSCZ86SjD+sp32SGidNB37KpqXJncp1mfUgKbHvBomE89WJDbfVKw1mdv5+ikrvd43r+Bg==}
|
||||||
|
|
||||||
emojis-list@3.0.0:
|
emojis-list@3.0.0:
|
||||||
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
|
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
|
||||||
@@ -688,8 +688,8 @@ packages:
|
|||||||
webpack-cli:
|
webpack-cli:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
ysk-utils@1.0.70:
|
ysk-utils@1.0.72:
|
||||||
resolution: {integrity: sha512-fCro0XPI3m94vUWufCxaBR4hEdc6ucqGSmH45jSvIUuhrME8Aa0YwtsUrGtr4WjP2n3mdzz+ip861ghmtP+ScQ==}
|
resolution: {integrity: sha512-Lum961KknoP/D6gOQ2vpM4qRaH7CZ8LbmHQlsZG0SKUguu09zr79UHpKBVWTem3HMxXqXSOFWSK+PVAyv9TcyQ==}
|
||||||
|
|
||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
@@ -933,8 +933,8 @@ snapshots:
|
|||||||
browserslist@4.28.0:
|
browserslist@4.28.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
baseline-browser-mapping: 2.8.28
|
baseline-browser-mapping: 2.8.28
|
||||||
caniuse-lite: 1.0.30001754
|
caniuse-lite: 1.0.30001755
|
||||||
electron-to-chromium: 1.5.252
|
electron-to-chromium: 1.5.254
|
||||||
node-releases: 2.0.27
|
node-releases: 2.0.27
|
||||||
update-browserslist-db: 1.1.4(browserslist@4.28.0)
|
update-browserslist-db: 1.1.4(browserslist@4.28.0)
|
||||||
|
|
||||||
@@ -945,7 +945,7 @@ snapshots:
|
|||||||
base64-js: 1.5.1
|
base64-js: 1.5.1
|
||||||
ieee754: 1.2.1
|
ieee754: 1.2.1
|
||||||
|
|
||||||
caniuse-lite@1.0.30001754: {}
|
caniuse-lite@1.0.30001755: {}
|
||||||
|
|
||||||
chokidar@4.0.3:
|
chokidar@4.0.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -978,7 +978,7 @@ snapshots:
|
|||||||
detect-libc@1.0.3:
|
detect-libc@1.0.3:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
electron-to-chromium@1.5.252: {}
|
electron-to-chromium@1.5.254: {}
|
||||||
|
|
||||||
emojis-list@3.0.0: {}
|
emojis-list@3.0.0: {}
|
||||||
|
|
||||||
@@ -1300,7 +1300,7 @@ snapshots:
|
|||||||
- esbuild
|
- esbuild
|
||||||
- uglify-js
|
- uglify-js
|
||||||
|
|
||||||
ysk-utils@1.0.70:
|
ysk-utils@1.0.72:
|
||||||
dependencies:
|
dependencies:
|
||||||
bignumber.js: 9.3.1
|
bignumber.js: 9.3.1
|
||||||
loadsh: 0.0.4
|
loadsh: 0.0.4
|
||||||
|
|||||||
15
stores/cart.js
Normal file
15
stores/cart.js
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// stores/counter.js
|
||||||
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
|
export const useCounterStore = defineStore('cart', {
|
||||||
|
state: () => {
|
||||||
|
return {
|
||||||
|
selCoupon: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
setSelCoupon(coupon) {
|
||||||
|
this.selCoupon = coupon
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user