更新下单
This commit is contained in:
@@ -53,9 +53,14 @@
|
|||||||
const keyword = ref()
|
const keyword = ref()
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
uni.navigateBack({
|
try {
|
||||||
delta: 1
|
uni.navigateBack({
|
||||||
});
|
delta: 1
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
uni.pro.switchTab('index/index')
|
||||||
|
//TODO handle the exception
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onRightTextClick = () => {
|
const onRightTextClick = () => {
|
||||||
@@ -73,10 +78,10 @@
|
|||||||
oneStyle: {},
|
oneStyle: {},
|
||||||
towStyle: {}
|
towStyle: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(()=>{
|
watchEffect(() => {
|
||||||
if(store.showSearch>44){
|
if (store.showSearch > 44) {
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="contentbox"
|
<view class="contentbox"
|
||||||
:style="'background:url('+(shopExtend.index_bg?shopExtend.index_bg.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png')+') no-repeat center center / cover' ">
|
:style="'background:url('+(shopExtend?shopExtend.shopExtendList[0].value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png')+') no-repeat center center / cover' ">
|
||||||
<view class="contentboxitem flex-between">
|
<view class="contentboxitem flex-between">
|
||||||
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
|
<view class="contentboxitemleft flex-colum" @click="scanCodehandle(0)">
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png" mode="aspectFill">
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xdiancan.png" mode="aspectFill">
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
import {
|
import {
|
||||||
productStore
|
productStore
|
||||||
} from '@/stores/user.js';
|
} from '@/stores/user.js';
|
||||||
const shopExtend = uni.cache.get('shopUserInfo') ? uni.cache.get('shopUserInfo').shopExtendList[0] : ''
|
const shopExtend = uni.cache.get('shopId') ? uni.cache.get('shopUserInfo') : 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png'
|
||||||
const scanCodehandle = async (i) => {
|
const scanCodehandle = async (i) => {
|
||||||
const store = productStore();
|
const store = productStore();
|
||||||
await store.scanCodeactions()
|
await store.scanCodeactions()
|
||||||
|
|||||||
@@ -171,15 +171,6 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="cell-item"
|
|
||||||
v-if="listinfo && listinfo.pointsDiscountAmount && listinfo.pointsDiscountAmount > 0">
|
|
||||||
<view class="label">积分抵扣</view>
|
|
||||||
<view class="val">
|
|
||||||
<view></view>
|
|
||||||
<view style="font-size: 28rpx;">¥</view>
|
|
||||||
<view>{{listinfo.pointsDiscountAmount.toFixed(2)}}</view>
|
|
||||||
</view>
|
|
||||||
</view> -->
|
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<view class="total-wrap">
|
<view class="total-wrap">
|
||||||
@@ -418,7 +409,10 @@
|
|||||||
shopUserId: props.orderVIP.id,
|
shopUserId: props.orderVIP.id,
|
||||||
orderAmount: props.listinfo.totalCost
|
orderAmount: props.listinfo.totalCost
|
||||||
})
|
})
|
||||||
emits('clickPointsamount', props.listinfo.pointsDiscountAmount);
|
emits('clickPointsamount', {
|
||||||
|
pointsDiscountAmount: props.listinfo.pointsDiscountAmount,
|
||||||
|
pointsNum: calcUsablePointsData.integral
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// * 获取积分相关信息
|
// * 获取积分相关信息
|
||||||
|
|||||||
@@ -178,10 +178,10 @@
|
|||||||
}
|
}
|
||||||
// 查找选中的数组里面 统计指定 id 的重复次数
|
// 查找选中的数组里面 统计指定 id 的重复次数
|
||||||
|
|
||||||
console.log(mergedArray.value)
|
// console.log(mergedArray.value)
|
||||||
console.log(item)
|
// console.log(item)
|
||||||
console.log(Selectedlist.value)
|
// console.log(Selectedlist.value)
|
||||||
console.log(Orderinfo.shoppingCart)
|
// console.log(Orderinfo.shoppingCart)
|
||||||
// if (Orderinfo.shoppingCart.length <= Selectedlist.value.length) {
|
// if (Orderinfo.shoppingCart.length <= Selectedlist.value.length) {
|
||||||
// uni.showToast({
|
// uni.showToast({
|
||||||
// title: '不可多余下单数!',
|
// title: '不可多余下单数!',
|
||||||
|
|||||||
@@ -130,7 +130,7 @@
|
|||||||
|
|
||||||
// 是否显示商家二维码信息
|
// 是否显示商家二维码信息
|
||||||
try {
|
try {
|
||||||
const shopQrcode = ref(uni.cache.get('shopInfo').shopQrcode)
|
const shopQrcode = ref(uni.cache.get('shopUserInfo').shopInfo)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
}
|
}
|
||||||
@@ -146,7 +146,8 @@
|
|||||||
pointsDiscountAmount: 0,
|
pointsDiscountAmount: 0,
|
||||||
packFeess: 0,
|
packFeess: 0,
|
||||||
totalPrices: 0,
|
totalPrices: 0,
|
||||||
Seatcharge: 0
|
Seatcharge: 0,
|
||||||
|
pointsNum: 0
|
||||||
})
|
})
|
||||||
|
|
||||||
// 会员信息
|
// 会员信息
|
||||||
@@ -254,10 +255,10 @@
|
|||||||
const changeFree = (e) => {
|
const changeFree = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
if (e) {
|
if (e) {
|
||||||
|
orderInfoAfterRef.value.bwcclear()
|
||||||
uniqueIds.value = [] // 筛选出商品卷的id
|
uniqueIds.value = [] // 筛选出商品卷的id
|
||||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||||
listinfo.Productroll = 0 // 商品卷总价价格
|
listinfo.Productroll = 0 // 商品卷总价价格
|
||||||
uniqueIds.value = [] // 筛选出商品卷的id
|
|
||||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||||
// 支付方式切换
|
// 支付方式切换
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
@@ -319,6 +320,7 @@
|
|||||||
|
|
||||||
// 这是优惠卷传的值
|
// 这是优惠卷传的值
|
||||||
const handleReturnData = async (data) => {
|
const handleReturnData = async (data) => {
|
||||||
|
console.log(data, uniqueIds.value, '11')
|
||||||
// 这是优惠卷
|
// 这是优惠卷
|
||||||
if (data.typeOrder == 1) {
|
if (data.typeOrder == 1) {
|
||||||
if (data.item) {
|
if (data.item) {
|
||||||
@@ -342,13 +344,15 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const learcoupons = (data) => {
|
const learcoupons = (data) => {
|
||||||
console.log('qing')
|
|
||||||
if (data == 'product') {
|
if (data == 'product') {
|
||||||
uniqueIds.value = [] // 筛选出商品卷的id
|
uniqueIds.value = [] // 筛选出商品卷的id
|
||||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||||
listinfo.Productroll = 0 // 商品卷总价价格
|
listinfo.Productroll = 0 // 商品卷总价价格
|
||||||
} else {
|
} else {
|
||||||
uniqueIds.value = [] // 筛选出商品卷的id
|
// 每次点击优惠卷删除优惠卷里的id
|
||||||
|
if (listinfo.coupondiscountAmount != 0) {
|
||||||
|
uniqueIds.value.pop()
|
||||||
|
}
|
||||||
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
listinfo.coupondiscountAmount = 0 // 优惠卷减去的金额
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -360,7 +364,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const istoricalorders = async () => {
|
const istoricalorders = async () => {
|
||||||
console.log(paymentmethod.payType, '1212')
|
return false;
|
||||||
// 先调用历史订单
|
// 先调用历史订单
|
||||||
let APIhistoryOrderres = await APIhistoryOrder({
|
let APIhistoryOrderres = await APIhistoryOrder({
|
||||||
tableCode: listinfo.tableCode
|
tableCode: listinfo.tableCode
|
||||||
@@ -397,8 +401,6 @@
|
|||||||
|
|
||||||
// * 去支付
|
// * 去支付
|
||||||
const goToPay = async () => {
|
const goToPay = async () => {
|
||||||
// 霸王餐
|
|
||||||
|
|
||||||
// 余额支付
|
// 余额支付
|
||||||
if (paymentmethod.payType == 'accountPay') {
|
if (paymentmethod.payType == 'accountPay') {
|
||||||
if (orderVIP.value.isVip == 0) {
|
if (orderVIP.value.isVip == 0) {
|
||||||
@@ -463,7 +465,7 @@
|
|||||||
orderAmount: listinfo.totalCost, // 最终订单金额
|
orderAmount: listinfo.totalCost, // 最终订单金额
|
||||||
roundAmount: 0, //抹零金额 减免多少钱
|
roundAmount: 0, //抹零金额 减免多少钱
|
||||||
pointsDiscountAmount: listinfo.pointsDiscountAmount, //积分抵扣金额(tb_points_basic_setting表)
|
pointsDiscountAmount: listinfo.pointsDiscountAmount, //积分抵扣金额(tb_points_basic_setting表)
|
||||||
pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
pointsNum: listinfo.pointsNum, //(扣除各类折扣 enable_deduction后使用)
|
||||||
remark: '', //用户备注
|
remark: '', //用户备注
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -492,13 +494,13 @@
|
|||||||
|
|
||||||
//
|
//
|
||||||
const clickPointsamount = (Pointsamount) => {
|
const clickPointsamount = (Pointsamount) => {
|
||||||
listinfo.pointsDiscountAmount = Pointsamount
|
listinfo.pointsDiscountAmount = Pointsamount.pointsDiscountAmount
|
||||||
|
listinfo.pointsNum = Pointsamount.pointsNum
|
||||||
}
|
}
|
||||||
|
|
||||||
const payPasswordref = ref(null)
|
const payPasswordref = ref(null)
|
||||||
// 余额支付
|
// 余额支付
|
||||||
const accountPayevent = async (pwd) => {
|
const accountPayevent = async (pwd) => {
|
||||||
console.log('输入的密码是:', pwd);
|
|
||||||
ispws.value = false;
|
ispws.value = false;
|
||||||
let checkOrderPay = {
|
let checkOrderPay = {
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
@@ -516,7 +518,7 @@
|
|||||||
orderAmount: listinfo.totalCost, // 最中订单金额
|
orderAmount: listinfo.totalCost, // 最中订单金额
|
||||||
roundAmount: 0, //抹零金额 减免多少钱
|
roundAmount: 0, //抹零金额 减免多少钱
|
||||||
pointsDiscountAmount: listinfo.pointsDiscountAmount, //积分抵扣金额(tb_points_basic_setting表)
|
pointsDiscountAmount: listinfo.pointsDiscountAmount, //积分抵扣金额(tb_points_basic_setting表)
|
||||||
pointsNum: 0, //(扣除各类折扣 enable_deduction后使用)
|
pointsNum: listinfo.pointsNum, //(扣除各类折扣 enable_deduction后使用)
|
||||||
remark: '', //用户备注
|
remark: '', //用户备注
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -236,7 +236,7 @@
|
|||||||
</shoppingCartes>
|
</shoppingCartes>
|
||||||
|
|
||||||
<!-- 显示购物车栏 -->
|
<!-- 显示购物车栏 -->
|
||||||
<view class="cart-wrap" v-if="cartLists_count > 0 && !confirmordershow">
|
<view class="cart-wrap" v-if="cartLists_count > 0 && !confirmordershow && isBusinessTime">
|
||||||
<view class="cart-content">
|
<view class="cart-content">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<view class="iconBox">
|
<view class="iconBox">
|
||||||
@@ -280,7 +280,8 @@
|
|||||||
@click="selectSpec(specType, option)"
|
@click="selectSpec(specType, option)"
|
||||||
:class="{ shop_sku_box_item_selected: selectedSpecs[specType] === option }">
|
:class="{ shop_sku_box_item_selected: selectedSpecs[specType] === option }">
|
||||||
{{option}}
|
{{option}}
|
||||||
<view class="shop_sku_box_item_tip" v-if="specifications.item.isPauseSale == 1">
|
<view class="shop_sku_box_item_tip"
|
||||||
|
v-if="specifications.item.result&& specifications.item.result.isPauseSale== 1 && selectedSpecs[specType] === option">
|
||||||
<view>售罄</view>
|
<view>售罄</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -443,7 +444,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const shopExtend = uni.cache.get('shopTable').shopExtendMap.index_bg
|
const shopExtend = uni.cache.get('shopTable').shopExtendMap.shopinfo_bg
|
||||||
|
|
||||||
// 计算高度
|
// 计算高度
|
||||||
const navScroll = ref(null)
|
const navScroll = ref(null)
|
||||||
@@ -584,8 +585,12 @@
|
|||||||
sku_id: '',
|
sku_id: '',
|
||||||
groupSnap: {},
|
groupSnap: {},
|
||||||
item: {
|
item: {
|
||||||
groupSnap: []
|
groupSnap: [],
|
||||||
}
|
result: {
|
||||||
|
isPauseSale: 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
})
|
})
|
||||||
// 用于判断接口数据是否加载完成
|
// 用于判断接口数据是否加载完成
|
||||||
const isDataLoaded = ref(false);
|
const isDataLoaded = ref(false);
|
||||||
@@ -634,13 +639,12 @@
|
|||||||
specifications.product_id = result.productId
|
specifications.product_id = result.productId
|
||||||
// 添加多规格分组
|
// 添加多规格分组
|
||||||
specifications.item.result = result
|
specifications.item.result = result
|
||||||
|
console.log(specifications.item)
|
||||||
if (result.isPauseSale == 0) {
|
if (result.isPauseSale == 0) {
|
||||||
canSubmit.value = true;
|
canSubmit.value = true;
|
||||||
// skuBtnText.value = '添加到购物车'
|
} else {
|
||||||
|
canSubmit.value = false;
|
||||||
}
|
}
|
||||||
// } catch (error) {
|
|
||||||
// canSubmit.value = false;
|
|
||||||
// }
|
|
||||||
} else {
|
} else {
|
||||||
canSubmit.value = false;
|
canSubmit.value = false;
|
||||||
}
|
}
|
||||||
@@ -898,7 +902,6 @@
|
|||||||
|
|
||||||
// 单规格
|
// 单规格
|
||||||
const singleclick = async (item, i) => {
|
const singleclick = async (item, i) => {
|
||||||
console.log(item, i)
|
|
||||||
// 判断购物车是否有该选中商品
|
// 判断购物车是否有该选中商品
|
||||||
let res = await matchingProduct(item)
|
let res = await matchingProduct(item)
|
||||||
websocketsendMessage({
|
websocketsendMessage({
|
||||||
@@ -1267,6 +1270,9 @@
|
|||||||
|
|
||||||
// 计算是否在营业时间内
|
// 计算是否在营业时间内
|
||||||
const isBusinessTime = computed(() => {
|
const isBusinessTime = computed(() => {
|
||||||
|
if (!shopInfo.businessTime) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
const currentTime = getCurrentTime();
|
const currentTime = getCurrentTime();
|
||||||
const [startTime, endTime] = shopInfo.businessTime.split('-');
|
const [startTime, endTime] = shopInfo.businessTime.split('-');
|
||||||
return currentTime >= startTime && currentTime <= endTime;
|
return currentTime >= startTime && currentTime <= endTime;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<image class="topBack"
|
<image class="topBack"
|
||||||
:src="shopExtend?shopExtend.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png'"
|
:src="shopExtend?shopExtend.shopExtendList[1].value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png'"
|
||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
<view class="myContent">
|
<view class="myContent">
|
||||||
<view class="my_info flex-between">
|
<view class="my_info flex-between">
|
||||||
@@ -105,7 +105,7 @@
|
|||||||
// { name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
|
// { name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
|
||||||
])
|
])
|
||||||
const teblist = ref([])
|
const teblist = ref([])
|
||||||
const shopExtend = ref(null)
|
const shopExtend = uni.cache.get('shopId') ? uni.cache.get('shopUserInfo') : 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png'
|
||||||
const userInfo = reactive({})
|
const userInfo = reactive({})
|
||||||
|
|
||||||
const ShopId = ref(uni.cache.get('shopId'))
|
const ShopId = ref(uni.cache.get('shopId'))
|
||||||
|
|||||||
Reference in New Issue
Block a user