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