订单结算更新
This commit is contained in:
parent
378cddb582
commit
d0cee95145
|
|
@ -9,7 +9,7 @@
|
|||
"jsencrypt": "^3.3.2",
|
||||
"lodash": "^4.17.21",
|
||||
"uview-plus": "^3.3.32",
|
||||
"ysk-utils": "^1.0.56"
|
||||
"ysk-utils": "^1.0.58"
|
||||
},
|
||||
"devDependencies": {
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
|
|
|
|||
|
|
@ -3,8 +3,13 @@
|
|||
<view class="bg-fff">
|
||||
<view class="search bg-fff u-flex u-col-center">
|
||||
<view class="u-flex-1">
|
||||
<uni-search-bar bgColor="#F9F9F9" cancelButton="none" placeholder="输入桌号" @confirm="search"
|
||||
v-model="searchValue">
|
||||
<uni-search-bar
|
||||
bgColor="#F9F9F9"
|
||||
cancelButton="none"
|
||||
placeholder="输入桌号"
|
||||
@confirm="search"
|
||||
v-model="searchValue"
|
||||
>
|
||||
</uni-search-bar>
|
||||
</view>
|
||||
<!-- <view class="u-flex">
|
||||
|
|
@ -12,10 +17,17 @@
|
|||
</view> -->
|
||||
</view>
|
||||
<view>
|
||||
<picker @change="areaChange" range-key="name" :value="area.defaultCateIndex" :range="area.list">
|
||||
<picker
|
||||
@change="areaChange"
|
||||
range-key="name"
|
||||
:value="area.defaultCateIndex"
|
||||
:range="area.list"
|
||||
>
|
||||
<view class="u-flex u-row-between area">
|
||||
<view class="color-333">桌台类型:<text v-if="area.sel">{{area.sel.name}}</text> <text
|
||||
v-else>全部</text> </view>
|
||||
<view class="color-333"
|
||||
>桌台类型:<text v-if="area.sel">{{ area.sel.name }}</text>
|
||||
<text v-else>全部</text>
|
||||
</view>
|
||||
<uni-icons type="right"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
|
|
@ -26,26 +38,42 @@
|
|||
<view class="">
|
||||
<template v-if="tables.list.length">
|
||||
<view class="bg-fff box bg-fff">
|
||||
<view class="" v-for="(item,index) in tables.list" :key="index" @tap="chooseTable(index,item)">
|
||||
<view
|
||||
class=""
|
||||
v-for="(item, index) in tables.list"
|
||||
:key="index"
|
||||
@tap="chooseTable(index, item)"
|
||||
>
|
||||
<template v-if="item.status == 'idle'">
|
||||
<view class="u-flex item u-row-between" style="border-bottom: 1px solid #E5E5E5;">
|
||||
<view
|
||||
class="u-flex item u-row-between"
|
||||
style="border-bottom: 1px solid #e5e5e5"
|
||||
>
|
||||
<view class="u-flex">
|
||||
<view class="">
|
||||
<view class="u-flex">
|
||||
<view>{{ item.name }}</view>
|
||||
<view class="line"></view>
|
||||
<view>{{''}}</view>
|
||||
<view>{{ "" }}</view>
|
||||
</view>
|
||||
<view class="color-999 u-font-24 u-m-t-12">
|
||||
<text
|
||||
:style="{color:returnStutasColor(item.status)}">{{returnStutasText(item.status)}}</text>
|
||||
:style="{ color: returnStutasColor(item.status) }"
|
||||
>{{ returnStutasText(item.status) }}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="my-radio u-font-28 u-flex color-333">
|
||||
<view class="circle u-flex u-row-center"
|
||||
:class="{active:index==tables.selIndex}">
|
||||
<uni-icons type="checkmarkempty" :size="16" color="#fff"></uni-icons>
|
||||
<view
|
||||
class="circle u-flex u-row-center"
|
||||
:class="{ active: index == tables.selIndex }"
|
||||
>
|
||||
<uni-icons
|
||||
type="checkmarkempty"
|
||||
:size="16"
|
||||
color="#fff"
|
||||
></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -53,44 +81,33 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="u-m-t-32">
|
||||
<my-pagination :page="query.page" :totalElements="query.totalElements" :size="query.size"
|
||||
@change="pageChange"></my-pagination>
|
||||
<my-pagination
|
||||
:page="query.page"
|
||||
:totalElements="query.totalElements"
|
||||
:size="query.size"
|
||||
@change="pageChange"
|
||||
></my-pagination>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="tables.list.length <= 0">
|
||||
<my-img-empty tips="未找到相关的桌台"></my-img-empty>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
$table,
|
||||
$tableArea
|
||||
} from '@/http/yskApi/table.js'
|
||||
import {
|
||||
reactive,
|
||||
ref,
|
||||
watch
|
||||
} from 'vue';
|
||||
import {
|
||||
$status
|
||||
} from '@/commons/table-status.js'
|
||||
import {
|
||||
onLoad
|
||||
} from '@dcloudio/uni-app'
|
||||
let nouser = ref(false)
|
||||
import { $table, $tableArea } from "@/http/yskApi/table.js";
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { $status } from "@/commons/table-status.js";
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
let nouser = ref(false);
|
||||
|
||||
function returnStutasText(key) {
|
||||
const item = $status[key]
|
||||
return item ? item.label : ''
|
||||
const item = $status[key];
|
||||
return item ? item.label : "";
|
||||
}
|
||||
|
||||
function returnStutasColor(key) {
|
||||
|
|
@ -99,134 +116,134 @@
|
|||
// }else{
|
||||
// return ''
|
||||
// }
|
||||
const item = $status[key]
|
||||
return item ? item.type : ''
|
||||
const item = $status[key];
|
||||
return item ? item.type : "";
|
||||
}
|
||||
|
||||
function emitChooeTable(data) {
|
||||
uni.$emit('choose-table', data)
|
||||
uni.$emit("choose-table", data);
|
||||
setTimeout(() => {
|
||||
uni.navigateBack()
|
||||
}, 100)
|
||||
uni.navigateBack();
|
||||
}, 100);
|
||||
}
|
||||
let searchValue = ref('')
|
||||
let searchValue = ref("");
|
||||
|
||||
function search() {
|
||||
query.page = 1
|
||||
getTable()
|
||||
query.page = 1;
|
||||
getTable();
|
||||
}
|
||||
|
||||
function chooseTable(index, item) {
|
||||
if (item.status == 'closed') {
|
||||
if (item.status == "closed") {
|
||||
return uni.showToast({
|
||||
title: '该桌台已关闭!',
|
||||
icon: 'none'
|
||||
})
|
||||
title: "该桌台已关闭!",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
if (index === undefined || item === undefined) {
|
||||
nouser.value = true
|
||||
return emitChooeTable()
|
||||
nouser.value = true;
|
||||
return emitChooeTable();
|
||||
} else {
|
||||
tables.selIndex = index
|
||||
emitChooeTable(item)
|
||||
tables.selIndex = index;
|
||||
emitChooeTable(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//分类
|
||||
const area = reactive({
|
||||
list: [{
|
||||
name: '全部'
|
||||
}],
|
||||
list: [
|
||||
{
|
||||
name: "全部",
|
||||
},
|
||||
],
|
||||
defaultCateIndex: 0,
|
||||
sel: ''
|
||||
})
|
||||
sel: "",
|
||||
});
|
||||
|
||||
function areaChange(e) {
|
||||
area.defaultCateIndex = e.detail.value
|
||||
area.sel = area.list[e.detail.value]
|
||||
query.page = 1
|
||||
getTable()
|
||||
area.defaultCateIndex = e.detail.value;
|
||||
area.sel = area.list[e.detail.value];
|
||||
query.page = 1;
|
||||
getTable();
|
||||
}
|
||||
const query = {
|
||||
page: 1,
|
||||
size: 10,
|
||||
areaId: 0,
|
||||
totalElements: 0
|
||||
}
|
||||
totalElements: 0,
|
||||
};
|
||||
// 页数改变事件
|
||||
function pageChange(page) {
|
||||
console.log(page);
|
||||
query.page = page
|
||||
getTable()
|
||||
query.page = page;
|
||||
getTable();
|
||||
}
|
||||
const tables = reactive({
|
||||
hasAjax: false,
|
||||
selIndex: -1,
|
||||
originList: [],
|
||||
list: []
|
||||
})
|
||||
list: [],
|
||||
});
|
||||
async function getTable() {
|
||||
// let state=status.list[status.active].key
|
||||
// state=state?(state=='all'?'':state):''
|
||||
const areaId = area.list[area.defaultCateIndex].id || ''
|
||||
let {
|
||||
data
|
||||
} = await $table.get({
|
||||
const areaId = area.list[area.defaultCateIndex].id || "";
|
||||
let { data } = await $table.get({
|
||||
...query,
|
||||
areaId,
|
||||
name: searchValue.value,
|
||||
state: 'idle'
|
||||
})
|
||||
state: "idle",
|
||||
});
|
||||
query.totalElements = data.totalRow || 0;
|
||||
tables.hasAjax = true;
|
||||
tables.list = data.records
|
||||
tables.selIndex = data.records.findIndex(v => v.tableCode == option.tableCode)
|
||||
tables.originList = data.records
|
||||
tables.list = data.records;
|
||||
tables.selIndex = data.records.findIndex(
|
||||
(v) => v.tableCode == option.tableCode
|
||||
);
|
||||
tables.originList = data.records;
|
||||
}
|
||||
async function getArea() {
|
||||
const {
|
||||
data
|
||||
} = await $tableArea.get({
|
||||
const { data } = await $tableArea.get({
|
||||
page: 0,
|
||||
size: 300
|
||||
})
|
||||
size: 300,
|
||||
});
|
||||
data.records.unshift({
|
||||
name: '全部'
|
||||
})
|
||||
area.list = data.records.map(v => {
|
||||
name: "全部",
|
||||
});
|
||||
area.list = data.records.map((v) => {
|
||||
return {
|
||||
...v,
|
||||
}
|
||||
})
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
watch(() => area.sel, (newval) => {
|
||||
getTable()
|
||||
})
|
||||
let option = {}
|
||||
onLoad(opt => {
|
||||
Object.assign(option, opt)
|
||||
watch(
|
||||
() => area.sel,
|
||||
(newval) => {
|
||||
getTable();
|
||||
}
|
||||
);
|
||||
let option = {};
|
||||
onLoad((opt) => {
|
||||
Object.assign(option, opt);
|
||||
console.log(option);
|
||||
getTable()
|
||||
getArea()
|
||||
})
|
||||
getTable();
|
||||
getArea();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.line {
|
||||
width: 1px;
|
||||
height: 20rpx;
|
||||
background-color: #E5E5E5;
|
||||
background-color: #e5e5e5;
|
||||
margin-left: 8rpx;
|
||||
margin-right: 16rpx;
|
||||
}
|
||||
|
||||
.my-radio {
|
||||
|
||||
.circle {
|
||||
background: #FFFFFF;
|
||||
background: #ffffff;
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
|
||||
|
|
@ -243,7 +260,6 @@
|
|||
border-radius: 8rpx;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.area {
|
||||
|
|
@ -296,10 +312,8 @@
|
|||
}
|
||||
|
||||
.item:not(:first-child) {
|
||||
border-top: 1px solid #E5E5E5;
|
||||
border-top: 1px solid #e5e5e5;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -384,20 +384,20 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="border-bottom">
|
||||
<template v-if="$seatFee && $seatFee.totalAmount">
|
||||
<template v-if="orderCostSummary.seatFee > 0">
|
||||
<view class="u-flex u-row-between u-m-t-18 u-p-b-34">
|
||||
<view>
|
||||
<text>桌位费</text>
|
||||
</view>
|
||||
<view>¥{{ $seatFee.totalAmount.toFixed(2) || "0.00" }}</view>
|
||||
<view>¥{{ orderCostSummary.seatFee }}</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="$packFee > 0">
|
||||
<template v-if="orderCostSummary.packFee > 0">
|
||||
<view class="u-flex u-row-between u-m-t-18 u-p-b-34">
|
||||
<view>
|
||||
<text>打包费</text>
|
||||
</view>
|
||||
<view>¥{{ $packFee || "0.00" }}</view>
|
||||
<view>¥{{ orderCostSummary.packFee }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
|
@ -412,7 +412,9 @@
|
|||
|
||||
<view class="u-flex price u-m-l-32">
|
||||
<view class="">实收金额</view>
|
||||
<view class="font-bold u-font-32">¥{{ orderCostSummary.finalPayAmount }}</view>
|
||||
<view class="font-bold u-font-32"
|
||||
>¥{{ orderCostSummary.finalPayAmount }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -479,7 +481,6 @@ import { getSafeBottomHeight } from "@/commons/utils/safe-bottom.js";
|
|||
import go from "@/commons/utils/go.js";
|
||||
import { hasPermission } from "@/commons/utils/hasPermission.js";
|
||||
import { getNowCart } from "@/pagesCreateOrder/util.js";
|
||||
import { number } from "uview-plus/libs/function/test";
|
||||
|
||||
import { getShopTableDetail } from "@/http/api/table.js";
|
||||
import { getShopInfo } from "@/http/api/shop.js";
|
||||
|
|
@ -622,7 +623,6 @@ const $seatFee = reactive({
|
|||
* 打包费
|
||||
*/
|
||||
const $packFee = computed(() => {
|
||||
let packAmount = 0;
|
||||
return goods.list
|
||||
.reduce((prve, cur) => {
|
||||
return prve + (cur.packFee || 0) * parseFloat(cur.pack_number).toFixed(2);
|
||||
|
|
@ -630,15 +630,6 @@ const $packFee = computed(() => {
|
|||
.toFixed(2);
|
||||
});
|
||||
|
||||
/**
|
||||
* 菜品数量
|
||||
*/
|
||||
const goodsNumber = computed(() => {
|
||||
const result = goods.list.reduce((prve, cur) => {
|
||||
return prve + cur.number;
|
||||
}, 0);
|
||||
return result;
|
||||
});
|
||||
|
||||
/**
|
||||
* 判断是否是会员
|
||||
|
|
@ -652,57 +643,13 @@ const isVip = computed(() => {
|
|||
);
|
||||
});
|
||||
|
||||
const discount_sale_amount = computed(() => {
|
||||
return goods.list
|
||||
.filter((v) => v.discount_sale_amount && v.discount_sale_amount > 0)
|
||||
.reduce((a, b) => {
|
||||
const lowMemberPrice = b.lowMemberPrice ? b.lowMemberPrice : b.lowPrice;
|
||||
const tPrice = isVip.value ? lowMemberPrice : b.lowPrice;
|
||||
return a + b.number * (tPrice - b.discount_sale_amount);
|
||||
}, 0);
|
||||
});
|
||||
function returnLimitPrice(data) {
|
||||
const price = yskUtils.limitUtils.returnPrice({
|
||||
goods: data,
|
||||
shopInfo: shopInfo,
|
||||
limitTimeDiscountRes: pageData.limitTimeDiscount,
|
||||
shopUserInfo: null,
|
||||
idKey: "id",
|
||||
});
|
||||
return price;
|
||||
}
|
||||
const goodsPrice = computed(() => {
|
||||
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||
const lowMemberPrice = cur.lowMemberPrice
|
||||
? cur.lowMemberPrice
|
||||
: cur.lowPrice;
|
||||
let price = isVip.value ? lowMemberPrice : cur.lowPrice;
|
||||
if (cur.is_time_discount) {
|
||||
price = returnLimitPrice(cur);
|
||||
}
|
||||
const tPrice = Math.floor(price * cur.number * 100) / 100;
|
||||
return prve + (cur.is_gift ? 0 : tPrice);
|
||||
}, 0);
|
||||
const tpackFee = $packFee.value > 0 ? $packFee.value * 1 : 0;
|
||||
|
||||
return (goodsTotalPrice - discount_sale_amount.value + tpackFee || 0).toFixed(
|
||||
2
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* 实收金额
|
||||
*/
|
||||
const allPrice = computed(() => {
|
||||
const n = goodsPrice.value * 1 + $seatFee.totalAmount;
|
||||
return n.toFixed(2);
|
||||
});
|
||||
|
||||
/**
|
||||
* 计算优惠金额
|
||||
*/
|
||||
const youhui = computed(() => {
|
||||
return 0
|
||||
return 0;
|
||||
});
|
||||
|
||||
function toFixed(price, item) {
|
||||
|
|
@ -752,16 +699,17 @@ function onMessage() {
|
|||
switch (msg.operate_type) {
|
||||
case "pad_init":
|
||||
goods.list = [];
|
||||
console.log(msg.data);
|
||||
|
||||
msg.data.map((item) => {
|
||||
cartItem = getNowCart(item, $goods, pageData.user);
|
||||
console.log(cartItem);
|
||||
if (cartItem.isGrounding || cartItem.is_temporary == 1) {
|
||||
cartControls(cartItem, "add");
|
||||
|
||||
} else {
|
||||
delCart(cartItem.id);
|
||||
}
|
||||
});
|
||||
|
||||
if (pageData.eatTypes.isShow) {
|
||||
if (pageData.eatTypes.active == "take-out") {
|
||||
cartItem.pack_number = cartItem.number;
|
||||
|
|
@ -811,6 +759,9 @@ function onMessage() {
|
|||
case "product_update":
|
||||
init();
|
||||
break;
|
||||
case "pad_batch":
|
||||
init();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
@ -838,22 +789,28 @@ function cartControls(cartItem, type) {
|
|||
pageData.table.tableCode = cartItem.table_code;
|
||||
}
|
||||
let cartIndex = 0;
|
||||
|
||||
goods.list.map((item, index) => {
|
||||
if (item.id == cartItem.id) {
|
||||
cartIndex = index;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
if (type == "del") {
|
||||
goods.list.splice(cartIndex, 1);
|
||||
return;
|
||||
}
|
||||
if (type == "add") {
|
||||
goods.list.push(cartItem);
|
||||
goods.list.push({...cartItem,packNumber:cartItem.pack_number});
|
||||
}
|
||||
if (type == "edit") {
|
||||
goods.list[cartIndex].number = cartItem.number;
|
||||
goods.list[cartIndex].pack_number = cartItem.pack_number;
|
||||
goods.list[cartIndex].packNumber = cartItem.pack_number;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -880,6 +837,7 @@ async function getTbShopInfo() {
|
|||
id: uni.getStorageSync("shopId"),
|
||||
});
|
||||
pageData.shopInfo = res.data;
|
||||
seatFeeConfig.pricePerPerson = res.data.tableFee || 0;
|
||||
uni.setStorageSync("shopInfo", res.data);
|
||||
}
|
||||
|
||||
|
|
@ -922,7 +880,18 @@ async function changeUseType() {
|
|||
if (!goods.list.length) {
|
||||
return;
|
||||
}
|
||||
getCart();
|
||||
websocketUtil.send(
|
||||
JSON.stringify({
|
||||
type: "pad",
|
||||
is_pack: pageData.eatTypes.active == "take-out" ? 1 : 0,
|
||||
account: uni.getStorageSync("shopInfo").id,
|
||||
shop_id: uni.getStorageSync("shopInfo").id,
|
||||
operate_type: "batch",
|
||||
table_code: pageData.table.tableCode,
|
||||
})
|
||||
);
|
||||
|
||||
// getCart();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1160,7 +1129,6 @@ async function createAnOrder() {
|
|||
|
||||
let vipPrice = isVip.value ? 1 : 0;
|
||||
let placeNum = pageData.orderInfo ? pageData.orderInfo.placeNum + 1 : 1;
|
||||
let originAmount = goodsPrice.value * 1 + youhui.value * 1;
|
||||
let par = {
|
||||
shopId: pageData.shopInfo.id, //店铺Id
|
||||
userId: pageData.user.userId, //用户Id
|
||||
|
|
@ -1168,12 +1136,12 @@ async function createAnOrder() {
|
|||
dineMode: pageData.eatTypes.active, //用餐模式 堂食 dine-in 外带 take-out 外卖 take-away
|
||||
remark: pageData.form.note, //备注
|
||||
seatNum: 0, //用餐人数
|
||||
packFee: $packFee.value, //打包费
|
||||
originAmount: originAmount, //订单原金额(包含打包费+餐位费) 不含折扣价格
|
||||
packFee:pageData.eatTypes.active=='dine-in'?seatFeeConfig.personCount : 0, //打包费
|
||||
originAmount: orderCostSummary.value.goodsRealAmount, //订单原金额(不包含打包费+餐位费)
|
||||
placeNum: placeNum, //当前订单下单次数
|
||||
waitCall: 0, //是否等叫 0 否 1 等叫
|
||||
vipPrice: vipPrice, //是否使用会员价
|
||||
limitRate:pageData.limitTimeDiscount
|
||||
limitRate: pageData.limitTimeDiscount,
|
||||
};
|
||||
if (!pageData.shopInfo.isTableFee && pageData.table && pageData.table.id) {
|
||||
par.seatNum = userNumbers.defaultCateIndex * 1 + 1;
|
||||
|
|
@ -1186,7 +1154,7 @@ async function createAnOrder() {
|
|||
console.log(res, "创建订单");
|
||||
if (res.code != 200) {
|
||||
uni.showToast({
|
||||
title: res.msg||'创建订单失败!',
|
||||
title: res.msg || "创建订单失败!",
|
||||
icon: "none",
|
||||
});
|
||||
return;
|
||||
|
|
@ -1239,9 +1207,6 @@ async function createAnOrder() {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//选择的优惠券
|
||||
const selCoupon = ref([]);
|
||||
//活动列表
|
||||
|
|
@ -1303,6 +1268,7 @@ const orderExtraConfig = computed(() => {
|
|||
});
|
||||
// 订单费用汇总
|
||||
const orderCostSummary = computed(() => {
|
||||
console.log(goods.list, "购物车数据");
|
||||
const costSummary = yskUtils.OrderPriceCalculator.calculateOrderCostSummary(
|
||||
goods.list,
|
||||
pageData.eatTypes.active,
|
||||
|
|
@ -1315,7 +1281,15 @@ const orderCostSummary = computed(() => {
|
|||
console.log(" 订单费用汇总", costSummary);
|
||||
return costSummary;
|
||||
});
|
||||
|
||||
watch(
|
||||
() => $seatFee.totalNumber,
|
||||
(newVal, oldVal) => {
|
||||
seatFeeConfig.personCount = newVal;
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ export function getNowCart(carItem,goodsList,user) {
|
|||
})
|
||||
} else {
|
||||
// 临时菜
|
||||
console.log(carItem,'salePrice1111111111')
|
||||
carItem.number = parseFloat(carItem.number)
|
||||
carItem.name = carItem.product_name
|
||||
carItem.lowPrice = carItem.discount_sale_amount
|
||||
|
|
|
|||
|
|
@ -1,14 +1,16 @@
|
|||
<template>
|
||||
<view class="bg-gray min-page u-p-30 u-font-28">
|
||||
<view class="u-p-t-60 u-p-b-60 u-text-center">
|
||||
|
||||
<view class="u-font-32">
|
||||
<text class="price-fuhao">¥</text>
|
||||
<text class="font-bold price">{{
|
||||
orderCostSummary.finalPayAmount
|
||||
}}</text>
|
||||
</view>
|
||||
<view class="u-m-t-10 color-999 old-price" v-if="orderCostSummary.merchantReduction.actualAmount">
|
||||
<view
|
||||
class="u-m-t-10 color-999 old-price"
|
||||
v-if="orderCostSummary.merchantReduction.actualAmount"
|
||||
>
|
||||
<text class="">¥</text>
|
||||
<text class=" ">{{ returnMerchantReductionBeforeMoney }}</text>
|
||||
</view>
|
||||
|
|
@ -584,28 +586,7 @@ const discountSaleAmount = computed(() => {
|
|||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 优惠券金额
|
||||
*/
|
||||
const fullCouponDiscountAmount = computed(() => {
|
||||
return pays.quan
|
||||
.filter((v) => v.type == 1)
|
||||
.reduce((prve, cur) => {
|
||||
// console.log("优惠券金额",prve + cur.discountAmount * 1)
|
||||
return prve + cur.discountAmount * 1;
|
||||
}, 0);
|
||||
});
|
||||
|
||||
/**
|
||||
* 商品券金额
|
||||
*/
|
||||
const productCouponDiscountAmount = computed(() => {
|
||||
return pays.quan
|
||||
.filter((v) => v.type == 2)
|
||||
.reduce((prve, cur) => {
|
||||
return prve + cur.discountAmount * 1;
|
||||
}, 0);
|
||||
});
|
||||
|
||||
// 计算商家减免前金额(使用bignumber.js确保精度)
|
||||
const returnMerchantReductionBeforeMoney = computed(() => {
|
||||
|
|
@ -752,7 +733,7 @@ watch(
|
|||
}
|
||||
);
|
||||
watch(
|
||||
() => payPrice.value,
|
||||
() => orderCostSummary.value.finalPayAmount,
|
||||
(newval) => {
|
||||
if (pageData.payUrlShow) {
|
||||
setTimeout(() => {
|
||||
|
|
@ -940,9 +921,6 @@ function changeAccountPoints() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 选择优惠券
|
||||
*/
|
||||
|
|
@ -1016,12 +994,12 @@ function watchChooseuser() {
|
|||
uni.$off("choose-user");
|
||||
uni.$on("choose-user", (data) => {
|
||||
if (pageData.user.id != data.id) {
|
||||
selCoupon.value=[]
|
||||
selCoupon.value = [];
|
||||
accountPoints.sel = false;
|
||||
}
|
||||
pageData.user = data;
|
||||
if (data.id) {
|
||||
getNewUserDiscount()
|
||||
getNewUserDiscount();
|
||||
}
|
||||
|
||||
init();
|
||||
|
|
@ -1031,12 +1009,12 @@ function watchChooseuser() {
|
|||
//获取用户新客立减
|
||||
function getNewUserDiscount() {
|
||||
getDiscountByUserId({
|
||||
shopUserId: pageData.user.id
|
||||
}).then(res=>{
|
||||
shopUserId: pageData.user.id,
|
||||
}).then((res) => {
|
||||
if (res.data) {
|
||||
newUserDiscount.value=res.data.amount||0
|
||||
newUserDiscount.value = res.data.amount || 0;
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1281,6 +1259,7 @@ function objToArrary(obj) {
|
|||
item.map((v) => {
|
||||
v.salePrice = v.salePrice ? v.salePrice : v.price;
|
||||
v.number = v.num;
|
||||
v.packFee = v.packAmount || 0;
|
||||
return v;
|
||||
});
|
||||
arr = [...arr, ...item];
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ importers:
|
|||
specifier: ^3.3.32
|
||||
version: 3.6.10
|
||||
ysk-utils:
|
||||
specifier: ^1.0.56
|
||||
version: 1.0.56
|
||||
specifier: ^1.0.58
|
||||
version: 1.0.58
|
||||
devDependencies:
|
||||
copy-webpack-plugin:
|
||||
specifier: ^12.0.2
|
||||
|
|
@ -177,8 +177,8 @@ packages:
|
|||
'@types/json-schema@7.0.15':
|
||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||
|
||||
'@types/node@24.10.0':
|
||||
resolution: {integrity: sha512-qzQZRBqkFsYyaSWXuEHc2WR9c0a0CXwiE5FWUvn7ZM+vdy1uZLfCunD38UzhuB7YN/J11ndbDBcTmOdxJo9Q7A==}
|
||||
'@types/node@24.10.1':
|
||||
resolution: {integrity: sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==}
|
||||
|
||||
'@webassemblyjs/ast@1.14.1':
|
||||
resolution: {integrity: sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==}
|
||||
|
|
@ -269,8 +269,8 @@ packages:
|
|||
base64-js@1.5.1:
|
||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||
|
||||
baseline-browser-mapping@2.8.25:
|
||||
resolution: {integrity: sha512-2NovHVesVF5TXefsGX1yzx1xgr7+m9JQenvz6FQY3qd+YXkKkYiv+vTCc7OriP9mcDZpTC5mAOYN4ocd29+erA==}
|
||||
baseline-browser-mapping@2.8.26:
|
||||
resolution: {integrity: sha512-73lC1ugzwoaWCLJ1LvOgrR5xsMLTqSKIEoMHVtL9E/HNk0PXtTM76ZIm84856/SF7Nv8mPZxKoBsgpm0tR1u1Q==}
|
||||
hasBin: true
|
||||
|
||||
big.js@5.2.2:
|
||||
|
|
@ -283,8 +283,8 @@ packages:
|
|||
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
browserslist@4.27.0:
|
||||
resolution: {integrity: sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw==}
|
||||
browserslist@4.28.0:
|
||||
resolution: {integrity: sha512-tbydkR/CxfMwelN0vwdP/pLkDwyAASZ+VfWm4EOwlB6SWhx1sYnWLqo8N5j0rAzPfzfRaxt0mM/4wPU/Su84RQ==}
|
||||
engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7}
|
||||
hasBin: true
|
||||
|
||||
|
|
@ -328,8 +328,8 @@ packages:
|
|||
engines: {node: '>=0.10'}
|
||||
hasBin: true
|
||||
|
||||
electron-to-chromium@1.5.249:
|
||||
resolution: {integrity: sha512-5vcfL3BBe++qZ5kuFhD/p8WOM1N9m3nwvJPULJx+4xf2usSlZFJ0qoNYO2fOX4hi3ocuDcmDobtA+5SFr4OmBg==}
|
||||
electron-to-chromium@1.5.250:
|
||||
resolution: {integrity: sha512-/5UMj9IiGDMOFBnN4i7/Ry5onJrAGSbOGo3s9FEKmwobGq6xw832ccET0CE3CkkMBZ8GJSlUIesZofpyurqDXw==}
|
||||
|
||||
emojis-list@3.0.0:
|
||||
resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==}
|
||||
|
|
@ -688,8 +688,8 @@ packages:
|
|||
webpack-cli:
|
||||
optional: true
|
||||
|
||||
ysk-utils@1.0.56:
|
||||
resolution: {integrity: sha512-TsRQGo1TEIVWZTc/j084eKVhTeI4r73dJRrzJHPUI56861hy40ekwYtozoa8v+LURXgEVIwXlMHM6zkgv8zBZw==}
|
||||
ysk-utils@1.0.58:
|
||||
resolution: {integrity: sha512-hpu7QlcIn0lo0WAWjgjPAhEpCD0NQjVT0Xx0enJ6vytJt5ISKvTNO52xKWDPWs2VsW3PVIamMKJbbxX8VZ1QTA==}
|
||||
|
||||
snapshots:
|
||||
|
||||
|
|
@ -801,7 +801,7 @@ snapshots:
|
|||
|
||||
'@types/json-schema@7.0.15': {}
|
||||
|
||||
'@types/node@24.10.0':
|
||||
'@types/node@24.10.1':
|
||||
dependencies:
|
||||
undici-types: 7.16.0
|
||||
|
||||
|
|
@ -920,7 +920,7 @@ snapshots:
|
|||
|
||||
base64-js@1.5.1: {}
|
||||
|
||||
baseline-browser-mapping@2.8.25: {}
|
||||
baseline-browser-mapping@2.8.26: {}
|
||||
|
||||
big.js@5.2.2: {}
|
||||
|
||||
|
|
@ -930,13 +930,13 @@ snapshots:
|
|||
dependencies:
|
||||
fill-range: 7.1.1
|
||||
|
||||
browserslist@4.27.0:
|
||||
browserslist@4.28.0:
|
||||
dependencies:
|
||||
baseline-browser-mapping: 2.8.25
|
||||
baseline-browser-mapping: 2.8.26
|
||||
caniuse-lite: 1.0.30001754
|
||||
electron-to-chromium: 1.5.249
|
||||
electron-to-chromium: 1.5.250
|
||||
node-releases: 2.0.27
|
||||
update-browserslist-db: 1.1.4(browserslist@4.27.0)
|
||||
update-browserslist-db: 1.1.4(browserslist@4.28.0)
|
||||
|
||||
buffer-from@1.1.2: {}
|
||||
|
||||
|
|
@ -978,7 +978,7 @@ snapshots:
|
|||
detect-libc@1.0.3:
|
||||
optional: true
|
||||
|
||||
electron-to-chromium@1.5.249: {}
|
||||
electron-to-chromium@1.5.250: {}
|
||||
|
||||
emojis-list@3.0.0: {}
|
||||
|
||||
|
|
@ -1079,7 +1079,7 @@ snapshots:
|
|||
|
||||
jest-worker@27.5.1:
|
||||
dependencies:
|
||||
'@types/node': 24.10.0
|
||||
'@types/node': 24.10.1
|
||||
merge-stream: 2.0.0
|
||||
supports-color: 8.1.1
|
||||
|
||||
|
|
@ -1246,9 +1246,9 @@ snapshots:
|
|||
|
||||
unicorn-magic@0.3.0: {}
|
||||
|
||||
update-browserslist-db@1.1.4(browserslist@4.27.0):
|
||||
update-browserslist-db@1.1.4(browserslist@4.28.0):
|
||||
dependencies:
|
||||
browserslist: 4.27.0
|
||||
browserslist: 4.28.0
|
||||
escalade: 3.2.0
|
||||
picocolors: 1.1.1
|
||||
|
||||
|
|
@ -1278,7 +1278,7 @@ snapshots:
|
|||
'@webassemblyjs/wasm-parser': 1.14.1
|
||||
acorn: 8.15.0
|
||||
acorn-import-phases: 1.0.4(acorn@8.15.0)
|
||||
browserslist: 4.27.0
|
||||
browserslist: 4.28.0
|
||||
chrome-trace-event: 1.0.4
|
||||
enhanced-resolve: 5.18.3
|
||||
es-module-lexer: 1.7.0
|
||||
|
|
@ -1300,7 +1300,7 @@ snapshots:
|
|||
- esbuild
|
||||
- uglify-js
|
||||
|
||||
ysk-utils@1.0.56:
|
||||
ysk-utils@1.0.58:
|
||||
dependencies:
|
||||
bignumber.js: 9.3.1
|
||||
loadsh: 0.0.4
|
||||
|
|
|
|||
Loading…
Reference in New Issue