购物车,订单,霸王餐

This commit is contained in:
wwz 2025-03-20 18:33:21 +08:00
parent 9da31e2faa
commit 5b8100aa64
16 changed files with 1382 additions and 1224 deletions

View File

@ -32,7 +32,8 @@ export const APIhistoryOrder = (data) => {
return request({
url: url + '/user/order/historyOrder',
method: 'get',
data: data
data: data,
toast: false
})
}

View File

@ -312,6 +312,10 @@ const useWebSocket = (options = {}) => {
// 页面显示,尝试连接 WebSocket
const onShowconnect = () => {
if (autoReconnect.value) {
uni.showLoading({
title: `尝试再次连接`,
mask: true
})
connect();
}
}

View File

@ -3,10 +3,10 @@
<view class="paymentMethod">
<view class="paymentMethod_content">
<view class="paymentMethod_title">支付方式</view>
<up-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChange" :size="28"
<up-radio-group v-model="radiovalue" iconPlacement="right" @change="groupChanges" :size="28"
placement="column">
<block v-for="(item,index) in paymentMethodList" :key="index">
<view class="method_list" @click="groupChange(item.type)">
<view class="method_list" @click="groupChanges(item.type)" v-if="index == 0?!changeFreeenable:true">
<view class="method_list_top">
<view class="method_list_top_left">
<image class="icon" :src="item.url" mode="aspectFill" />
@ -38,7 +38,8 @@
computed,
defineEmits,
watch,
watchEffect
watchEffect,
defineExpose
} from 'vue'
const props = defineProps({
@ -53,10 +54,15 @@
freeCheck: {
type: Boolean,
default: false
},
changeFreeenable: {
type: Boolean,
default: false
}
});
const orderVIP = ref(uni.cache.get('orderVIP'))
const emits = defineEmits(['customevent', 'groupChange']);
@ -113,7 +119,7 @@
const storeInfo = ref({})
// *
const groupChange = (type) => {
const groupChanges = (type) => {
if (props.freeCheck && type == 1) {
return;
}
@ -132,6 +138,10 @@
shopId: orderVIP.value.shopId
})
}
//
defineExpose({
groupChanges
});
</script>
<style lang="scss">

View File

@ -171,7 +171,7 @@
</view>
</view>
</view>
<view class="cell-item"
<!-- <view class="cell-item"
v-if="listinfo && listinfo.pointsDiscountAmount && listinfo.pointsDiscountAmount > 0">
<view class="label">积分抵扣</view>
<view class="val">
@ -179,7 +179,7 @@
<view style="font-size: 28rpx;"></view>
<view>{{listinfo.pointsDiscountAmount.toFixed(2)}}</view>
</view>
</view>
</view> -->
</block>
<view class="total-wrap">
@ -193,7 +193,7 @@
<view class="row" @click="copyHandle(listinfo.orderNo)">
<text class="t">订单编号</text>
<text class="info"
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{listinfo.orderNo}}点击复制</text>
style="overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">{{listinfo.orderNo}}(点击复制)</text>
</view>
<view class="row">
<text class="t">下单时间</text>
@ -316,7 +316,12 @@
default: {
isTableFee: 0
}
},
changeFreeenable: {
type: Boolean,
default: false
}
})
const is_type = ref(0)
@ -337,8 +342,23 @@
}
//
const bwcclear = () => {
IntegralInputclose()
//
favorablelist[1].value = ''
favorablelist[0].value = ''
}
//
const goUrl = (item) => {
if (props.changeFreeenable) {
uni.showToast({
title: '不可与其他优惠共享!',
icon: 'none'
})
return false;
}
switch (item.type) {
case 'coupon':
//
@ -433,7 +453,8 @@
//
defineExpose({
dataprocessing,
getCalcUsablePoints
getCalcUsablePoints,
bwcclear
});
</script>
@ -701,6 +722,7 @@
}
.shop-info {
padding-top: 28rpx;
border-bottom: 2rpx dashed #e5e5e5;
.item:nth-child(1) {

View File

@ -4,99 +4,84 @@
<view class="rechargeFree_bg" @click="changeFree">
<view class="left">
<view class="icon">优惠</view>
<view class="text">充值消费{{freeDingConfig.rechargeTimes}}订单满{{freeDingConfig.rechargeThreshold}}元可用本单立享免单</view>
<view class="text">
充值消费{{freeDineConfig.rechargeTimes}}订单满{{freeDineConfig.rechargeThreshold}}元可用本单立享免单</view>
</view>
<u-checkbox-group iconPlacement="right" >
<u-checkbox :disabled="freeDisabled" v-model="rechargeFreeChecked" :checked="rechargeFreeChecked" @change="changeFree" activeColor="#E8AD7B" shape="circle" icon-size="36" size="36">
</u-checkbox>
</u-checkbox-group>
<up-checkbox :disabled="!freeDineConfig.enable" @change="change" shape="circle" usedAlone v-model:checked="changeFreeenable" icon-size="20" size="20">
</up-checkbox>
<!-- <up-checkbox-group iconPlacement="right">
<up-checkbox : v-model="changeFreeenable"
:checked="freeDineConfig.enable" @change="change" activeColor="#E8AD7B" shape="circle"
icon-size="16" size="16">
</up-checkbox>
</up-checkbox-group> -->
</view>
</view>
</template>
<script>
export default {
data() {
return {
freeDisabled: false,
}
<script setup>
import {
ref,
defineProps,
defineEmits
} from 'vue';
//
const props = defineProps({
freeDineConfig: {
type: Object,
default: {}
},
props:{
shopUserInfo:{
type: Object
},
freeDingConfig:{
type: Object
},
payAmount: {
type: Number
},
rechargeFreeChecked: {
type: Boolean
},
payAmount: {
type: Number,
default: 0
},
watch: {
payAmount (newVal) {
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
this.freeDisabled = true
} else {
this.freeDisabled = false
}
}
},
mounted() {
if ( this.freeDingConfig && this.payAmount < this.freeDingConfig.rechargeThreshold ) {
this.freeDisabled = true
} else {
this.freeDisabled = false
}
console.log(this.freeDisabled )
},
methods: {
/**
* 监听是否免单
*/
changeFree ( e ) {
if ( this.freeDisabled ) {
return;
}
this.$emit("changeFree",this.rechargeFreeChecked)
}
}
});
const emits = defineEmits(['changeFree']);
const changeFreeenable = ref(false)
/**
* 监听是否免单
*/
const change = (e) => {
emits('changeFree', e);
}
</script>
<style lang="scss">
//
.rechargeFree{
<style lang="scss" scoped>
.rechargeFree {
// padding: 0 20rpx;
margin-top: 32rpx;
.rechargeFree_bg{
.rechargeFree_bg {
display: flex;
justify-content: space-between;
align-items: center;
padding: 32rpx 24rpx;
border-radius: 24rpx;
background-color: #fff;
.left{
.left {
display: flex;
align-items: center;
.icon{
.icon {
width: 68rpx;
height: 36rpx;
text-align: center;
line-height: 36rpx;
background: linear-gradient( 180deg, #FEDE81 0%, #FEB263 100%);
background: linear-gradient(180deg, #FEDE81 0%, #FEB263 100%);
border-radius: 12rpx 0rpx 12rpx 0rpx;
font-weight: 500;
font-size: 20rpx;
color: #FFFFFF;
margin-right: 12rpx;
}
.text{
width: 90%;
.text {
width: 80%;
font-weight: 500;
font-size: 28rpx;
color: #333333;
@ -104,5 +89,4 @@
}
}
}
</style>
</style>

View File

@ -80,6 +80,7 @@
ref,
reactive,
onMounted,
computed
} from 'vue';
import {
onLoad,
@ -113,7 +114,7 @@
// 使
const navigatorGo = (item) => {
console.log(Orderinfo.payAmount, item)
// console.log(Orderinfo.payAmount, item)
if (Orderinfo.payAmount < item.fullAmount) {
uni.showToast({
title: "当前订单金额不足使用金额",
@ -138,6 +139,23 @@
});
}
// num
const mergedArray = computed(() => {
const map = new Map();
Orderinfo.shoppingCart.forEach(item => {
if (map.has(item.productId)) {
const existingItem = map.get(item.productId);
existingItem.num += item.num;
} else {
map.set(item.productId, {
...item
});
}
});
return Array.from(map.values());
});
const Selectedlist = ref([])
//
@ -146,12 +164,31 @@
if (!item.show) {
return false;
}
console.log(Orderinfo.shoppingCart)
if (Orderinfo.shoppingCart.length < Selectedlist.value.length) {
// id
const count = Selectedlist.value.filter(item => item.id === item.id).length;
// id
const foundObject = mergedArray.value.find(i => i.productId === item.proId)
if (foundObject.num <= count) {
uni.showToast({
title: '不可多余下单参数哦!'
title: '不可多余商品!',
icon: 'none'
})
return false;
}
// id
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: '!',
// icon:'none'
// })
// return false;
// }
if (item.Selected) {
Selectedlist.value = Selectedlist.value.filter(i => i.id !== item.id)
@ -251,15 +288,12 @@
};
});
}
console.log(res)
if (res.length > 0) {
fromInfo.list = res
} else {
fromInfo.list = []
return false
}
console.log(res)
}
//
const cancelCoupon = () => {
@ -296,12 +330,8 @@
uni.setNavigationBarTitle({
title: Orderinfo.typeOrder == 2 ? '商品卷' : '优惠卷',
success: () => {
console.log('导航栏标题修改成功');
},
fail: (err) => {
console.error('导航栏标题修改失败', err);
}
success: () => {},
fail: (err) => {}
});
Orderinfo.shopUserId = options.shopUserId

View File

@ -36,39 +36,18 @@
<!-- x详情 -->
<orderInfoAfter ref="orderInfoAfterRef" :rechargeFreeChecked="rechargeFreeChecked" :freeCheck="freeCheck"
:listinfo="listinfo" :orderVIP="orderVIP" :ordershopUserInfo='ordershopUserInfo' @istype="istype"
@clickPointsamount='clickPointsamount' @learcoupons="learcoupons">
@clickPointsamount='clickPointsamount' @learcoupons="learcoupons" :changeFreeenable='changeFreeenable'>
</orderInfoAfter>
<!-- 充值免单 -->
<!-- <block v-if="listinfo.useType == 'dine-in-after'">
<rechargeFree
:rechargeFreeChecked="rechargeFreeChecked"
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
ref="rechargeFree"
:freeDisabled="freeDisabled"
:payAmount="listinfo.payAmount"
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="orderVIP" @changeFree="changeFree"></rechargeFree>
</block>
<block v-else>
<rechargeFree
:rechargeFreeChecked="rechargeFreeChecked"
v-if="listinfo.freeDingConfig&&listinfo.freeDingConfig.enable == 1&&(!listinfo.couponInfoList&&listinfo.pointsDiscountAmount<=0)&&(listinfo.status == 'unpaid' || listinfo.status == 'paying')"
ref="rechargeFree"
:freeDisabled="freeDisabled"
:payAmount="listinfo.payAmount"
:freeDingConfig="listinfo.freeDingConfig" :shopUserInfo="orderVIP" @changeFree="changeFree"></rechargeFree>
</block> -->
<!-- 霸王餐 -->
<rechargeFree :freeDineConfig="orderVIP.freeDineConfig" :payAmount="listinfo.totalPrices"
v-if="listinfo.status == 'unpaid' && orderVIP.freeDineConfig.enable" @changeFree="changeFree">
</rechargeFree>
<!-- 支付方式 -->
<paymentMethodes ref="paymentMethodref" :orderVIP="orderVIP" @groupChange="groupChange"
v-if="listinfo.status == 'unpaid'">
:changeFreeenable='changeFreeenable' v-if="listinfo.status == 'unpaid'">
</paymentMethodes>
<!-- <paymentMethodes ref="paymentMethodes" :rechargeFreeChecked="rechargeFreeChecked"
v-if="orderVIP&&listinfo.status == 'unpaid' || listinfo.status == 'paying'" :freeCheck="freeCheck"
:payAmount="listinfo.payAmount" :orderVIP="orderVIP" @groupChange="groupChange"></paymentMethodes> -->
<view class="fixedview">
<view class="flex-between" v-if="listinfo.status == 'unpaid'">
<view class="fixedview_one flex-start">
@ -77,8 +56,13 @@
<text>¥</text>{{listinfo.totalCost}}
</view>
</view>
<view class="fixedview_tow" @tap="$u.debounce(goToPay,1000)">
{{paymentmethod.paymentBtnText}}
<view class="flex-colum-end">
<view class="fixedview_tow" @tap="$u.debounce(istoricalorders,1000)">
{{paymentmethod.paymentBtnText}}
</view>
<!-- <view class="fixedview_tows" @tap="$u.debounce(APIputuserorderclick,1000)">
取消订单
</view> -->
</view>
</view>
</view>
@ -97,11 +81,12 @@
} from 'vue';
import {
APIgetOrderById
APIgetOrderById,
APIputuserorder,
APIhistoryOrder
} from '@/common/api/order/index.js'
import {
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
@ -131,7 +116,7 @@
import payPassword from '@/components/payPassword.vue'
import orderInfoAfter from './components/orderInfoAfter.vue'
// import orderInfoBefore from '../components/orderInfoBefore.vue'
// import rechargeFree from '../components/rechargeFree.vue'
import rechargeFree from './components/rechargeFree.vue'
import paymentMethodes from '@/components/paymentMethod.vue'; //
import {
onBackPress
@ -186,13 +171,13 @@
})
if (res) {
Object.assign(listinfo, res);
if (listinfo.status == 'unpaid') {
try {
let res = await APIhistoryOrder({
orderId: orderId.value
})
} catch (error) {}
}
// if (listinfo.status == 'unpaid') {
// try {
// let res = await APIhistoryOrder({
// orderId: orderId.value
// })
// } catch (error) {}
// }
//
if (listinfo.detailMap) {
let combinedArray = [];
@ -245,6 +230,13 @@
0 ? listinfo.Seatcharge : 0) - (listinfo.Productroll || 0) - (listinfo
.coupondiscountAmount || 0) - (listinfo.pointsDiscountAmount || 0);
listinfo.totalCost = Math.round(sums * 100) / 100;
//
console.log(orderVIP.value.freeDineConfig.enable, changeFreeenable.value)
if (orderVIP.value.freeDineConfig.enable && changeFreeenable.value) {
listinfo.totalCost = (parseFloat(listinfo.totalCost) * parseFloat(orderVIP.value
.freeDineConfig
.rechargeTimes)).toFixed(2)
}
//
if (listinfo.totalCost && listinfo.status == 'unpaid') {
uni.$u.debounce(memberPointscalcUsablePoints, 500)
@ -256,6 +248,34 @@
}
});
//
const changeFreeenable = ref(false)
const changeFree = (e) => {
console.log(e)
if (e) {
uniqueIds.value = [] // id
listinfo.coupondiscountAmount = 0 //
listinfo.Productroll = 0 //
uniqueIds.value = [] // id
listinfo.coupondiscountAmount = 0 //
//
// #ifdef MP-WEIXIN
paymentMethodref.value.groupChanges(2)
// paymentmethod.radiovalue = 2;
// paymentmethod.paymentBtnText = "";
// paymentmethod.payType = 'wechatPay';
// #endif
// #ifdef MP-ALIPAY
paymentMethodref.value.groupChanges(3)
// paymentmethod.radiovalue = 3;
// paymentmethod.paymentBtnText = "";
// paymentmethod.payType = 'wechatPay';
// #endif
}
changeFreeenable.value = e
}
const saveImage = (url) => {
uni.saveImage({
url: url,
@ -268,6 +288,9 @@
});
}
//
const paymentMethodref = ref(null)
//
const paymentmethod = reactive({
radiovalue: 2,
@ -330,8 +353,52 @@
}
}
//
const APIputuserorderclick = async () => {
await APIputuserorder(listinfo.id)
uni.navigateBack()
}
const istoricalorders = async () => {
console.log(paymentmethod.payType, '1212')
//
let APIhistoryOrderres = await APIhistoryOrder({
tableCode: listinfo.tableCode
})
//
if (APIhistoryOrderres.detailMap) {
let combinedArray = [];
for (const key in APIhistoryOrderres.detailMap) {
if (APIhistoryOrderres.detailMap.hasOwnProperty(key)) {
let subArray = APIhistoryOrderres.detailMap[key];
combinedArray = [...combinedArray, ...subArray]
}
}
//
if (listinfo.combinedArray.length === combinedArray.length) {
goToPay()
} else {
uni.showToast({
title: '你的订单已更新!',
icon: 'none'
})
orderorderInfo()
}
} else {
uni.showToast({
title: '你的小伙伴已提交订单~',
icon: 'none'
})
setTimeout(() => {
orderorderInfo()
}, 1000)
}
}
// *
const goToPay = async () => {
//
//
if (paymentmethod.payType == 'accountPay') {
if (orderVIP.value.isVip == 0) {
@ -369,34 +436,48 @@
}
return false
}
let checkOrderPay = {
orderId: orderId.value,
vipPrice: orderVIP.value.isVip == 1 && ordershopUserInfo.value.isMemberPrice == 1 ? 1 :
0, //使01
userAllPack: is_type.value == 0 ? 0 : 1, //
seatNum: is_type.value == 0 ? listinfo.seatNum : 0, //
originAmount: listinfo.originAmount, //+
discountRatio: 1, //( ) 1
discountAmount: 0, // 0
productCouponDiscountAmount: listinfo.Productroll, //
fullCouponDiscountAmount: listinfo.coupondiscountAmount, //
couponList: uniqueIds.value, //使
orderAmount: listinfo.totalCost, //
roundAmount: 0, //
pointsDiscountAmount: listinfo.pointsDiscountAmount, //(tb_points_basic_setting)
pointsNum: 0, //( enable_deduction使)
remark: '', //
}
try {
await storeMemberpay.actionsltPayOrder({
checkOrderPay,
payType: paymentmethod.payType,
buyerRemark: '',
returnUrl: ''
if (orderVIP.value.freeDineConfig.enable && changeFreeenable.value) {
await storeMemberpay.actionspayltPayVip({
shopId: orderVIP.value.shopId,
shopUserId: orderVIP.value.id,
orderId: orderId.value,
userAllPack: is_type.value == 0 ? 0 : 1, //
amount: listinfo.totalCost, //
returnUrl: '', //
buyerRemark: ''
})
} catch (error) {
//TODO handle the exception
return false;
} else {
let checkOrderPay = {
orderId: orderId.value,
vipPrice: orderVIP.value.isVip == 1 && ordershopUserInfo.value.isMemberPrice == 1 ? 1 :
0, //使01
userAllPack: is_type.value == 0 ? 0 : 1, //
seatNum: is_type.value == 0 ? listinfo.seatNum : 0, //
originAmount: listinfo.originAmount, //+
discountRatio: 1, //( ) 1
discountAmount: 0, // 0
productCouponDiscountAmount: listinfo.Productroll, //
fullCouponDiscountAmount: listinfo.coupondiscountAmount, //
couponList: uniqueIds.value, //使
orderAmount: listinfo.totalCost, //
roundAmount: 0, //
pointsDiscountAmount: listinfo.pointsDiscountAmount, //(tb_points_basic_setting)
pointsNum: 0, //( enable_deduction使)
remark: '', //
}
try {
await storeMemberpay.actionsltPayOrder({
checkOrderPay,
payType: paymentmethod.payType,
buyerRemark: '',
returnUrl: ''
})
} catch (error) {
//TODO handle the exception
}
}
orderorderInfo()
}
@ -906,6 +987,7 @@
left: 0;
width: 100%;
// height: 80rpx;
.flex-between {
width: 100%;
padding: 36rpx 54rpx 102rpx 54rpx;
@ -932,14 +1014,26 @@
}
}
.fixedview_tow {
background: #E3AD7F;
border-radius: 36rpx;
font-weight: 400;
font-size: 32rpx;
color: #FFFFFF;
padding: 14rpx 44rpx;
.flex-colum-end {
.fixedview_tow {
background: #E3AD7F;
border-radius: 36rpx;
font-weight: 400;
font-size: 32rpx;
color: #FFFFFF;
padding: 14rpx 44rpx;
}
.fixedview_tows {
background: #c3c3c3;
border-radius: 36rpx;
font-weight: 400;
font-size: 32rpx;
color: #FFFFFF;
padding: 14rpx 44rpx;
}
}
}
}
</style>

File diff suppressed because it is too large Load Diff

View File

@ -145,6 +145,7 @@
product_id: item.id,
sku_id: item.skuId,
number: await calculateValue(item.cartNumber, i),
is_print: 1,
})
}

View File

@ -2,7 +2,7 @@
<view>
<Nav />
<!-- 顶部面板 -->
<view class="top--panel">
<view class="top--panel" :class="{ 'grayscale':!isBusinessTime }">
<image class="panelimgbackground"
:src="shopExtend?shopExtend.value:'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png'"
mode="aspectFill">
@ -126,7 +126,7 @@
</view>
<!-- 滚动区域 -->
<view class="scroll-panel" id="scroll-panel">
<view class="scroll-panel" id="scroll-panel" :class="{ 'grayscale':!isBusinessTime }">
<view class="list-box">
<view class="left" :style="{top: `${store.height}px`}">
<scroll-view :scroll-into-view="leftIntoView" :scroll-with-animation="false" :scroll-y="true"
@ -319,7 +319,8 @@
</view>
<view class="operation-wrap">
<view class="btn">
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"></up-icon>
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
v-if="shopCartNumber>0"></up-icon>
<view class="btnClick" @click="shopCart('-')">
</view>
</view>
@ -611,28 +612,35 @@
const selectSpec = async (specType, option) => {
//
shopCartNumber.value = 0
// selectedSpecs
selectedSpecs.value = {
...selectedSpecs.value,
[specType]: option
};
if (allSpecsSelected.value) {
try {
let result = await APIminiAppskuinfo({
specInfo: selectedSpecsStr.value,
id: specifications.item.id
});
specifications.sku_id = result.id
specifications.product_id = result.productId
//
specifications.item.result = result
if (result.isPauseSale == 0) {
canSubmit.value = true;
// skuBtnText.value = ''
}
} catch (error) {
canSubmit.value = false;
const newSelectedSpecs = {};
const specKeys = Object.keys(specifications.item.selectSpecInfo);
for (const key of specKeys) {
if (key === specType) {
newSelectedSpecs[key] = option;
} else {
newSelectedSpecs[key] = selectedSpecs.value[key];
}
}
selectedSpecs.value = newSelectedSpecs;
if (allSpecsSelected.value) {
// try {
let result = await APIminiAppskuinfo({
specInfo: selectedSpecsStr.value,
id: specifications.item.id
});
specifications.sku_id = result.id
specifications.product_id = result.productId
//
specifications.item.result = result
if (result.isPauseSale == 0) {
canSubmit.value = true;
// skuBtnText.value = ''
}
// } catch (error) {
// canSubmit.value = false;
// }
} else {
canSubmit.value = false;
}
@ -691,12 +699,17 @@
return false;
};
//
//
const allConditionsSatisfied = computed(() => {
return specifications.item.groupSnap.every((setmenu, index) => {
// specifications.item.groupSnap
if (!specifications.item?.groupSnap) {
return false;
}
return specifications.item.groupSnap.every((optionGroup, index) => {
//
const selected = selectedOptions.value[index] || [];
//
const hasEnoughSelection = selected.length === setmenu.number;
const hasEnoughSelection = selected.length === optionGroup.number;
return hasEnoughSelection;
});
});
@ -836,7 +849,8 @@
shopCartNumber.value,
pro_group_info: selectedGroupSnap.value,
goods_type: specifications.item.type == "package" ? 'package' : '',
is_print: 1
is_print: 1,
product_type: specifications.item.type
})
//
selectedGroupSnap.value = []
@ -884,6 +898,7 @@
//
const singleclick = async (item, i) => {
console.log(item, i)
//
let res = await matchingProduct(item)
websocketsendMessage({
@ -895,7 +910,8 @@
product_id: item.id,
sku_id: item.skuId,
number: await calculateValue(item.cartNumber, i),
is_print: 1
is_print: 1,
product_type: item.type
})
}
@ -1017,7 +1033,9 @@
//
if (Message.operate_type == 'del' && Message.status == 1) {
cartList.value = cartList.value.filter(item => item.id != Message.data.id);
// 使
cartList.value = cartList.value.filter(item => item.id !== Message.data?.id);
// cartList.value = cartList.value.filter(item => item.id != Message.data.id);
}
//
@ -1084,49 +1102,6 @@
}
if (cartItem.is_temporary === 1) {
return [{
// cartListId: 5309
// cartListinfo: Proxy {id: 5309, shop_id: 203, table_code: "40309814459", sku_id: 2863, product_id: 1273, }
// cartNumber: "2.00"
// coverImg: "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/2/490de935cc9042bfa56d0c392f806484.jpg"
// groupType: null
// id: "1273"
// isHot: 1
// isSaleTime: 1
// isSoldStock: 0
// memberPrice: 0.88
// name: ""
// originPrice: 0.88
// packFee: 0
// salePrice: 2.88
// skuId: "2863"
// skuList: Proxy {0: {}}
// stockNumber: 0
// suitNum: 1
// type: "single"
// unitName: ""
// cartListId: 5324
// cartListinfo: Proxy {id: 5324, shop_id: 203, table_code: "40309814459", sku_id: 0, product_id: -74982031, }
// cartNumber: "25.00"
// create_time: "2025-03-18 15:05:37"
// discount_sale_amount: "357.00"
// discount_sale_note: ""
// id: 5324
// is_gift: 0
// is_print: 0
// is_temporary: 1
// is_wait_call: 0
// number: "25.00"
// pack_number: "0.00"
// pro_group_info: ""
// product_id: -74982031
// product_name: ""
// remark: ""
// shop_id: 203
// sku_id: 0
// sku_name: "VB"
// table_code: "40309814459"
// update_time: null
...cartItem,
memberPrice: cartItem.discount_sale_amount,
salePrice: cartItem.discount_sale_amount,
@ -1174,7 +1149,7 @@
}
}, 0);
//
return cart = Math.ceil(cart * 100) / 100;
return parseFloat(cart.toFixed(2));
} else {
return 0
}
@ -1250,6 +1225,54 @@
}));
})
// //
// const getCurrentDateTime = () => {
// const now = new Date();
// const dayOfWeek = ['', '', '', '', '', '', ''][now.getDay()];
// const hours = now.getHours().toString().padStart(2, '0');
// const minutes = now.getMinutes().toString().padStart(2, '0');
// const currentTime = `${hours}:${minutes}`;
// return {
// dayOfWeek,
// currentTime
// };
// };
// //
// const isBusinessTime = computed(() => {
// const {
// dayOfWeek,
// currentTime
// } = getCurrentDateTime();
// console.log(shopInfo)
// const [startDay, endDay] = [shopInfo.businessStartDay, shopInfo.businessEndDay];
// const [startTime, endTime] = shopInfo.businessTime.split('-');
// const dayIndex = ['', '', '', '', '', '', ''].indexOf(dayOfWeek);
// const startDayIndex = ['', '', '', '', '', '', ''].indexOf(startDay);
// const endDayIndex = ['', '', '', '', '', '', ''].indexOf(endDay);
// console.log(shopInfo.businessTime, 1111)
// const isInDayRange = dayIndex >= startDayIndex && dayIndex <= endDayIndex;
// const isInTimeRange = currentTime >= startTime && currentTime <= endTime;
// console.log(isInDayRange, isInTimeRange, 1111)
// return isInDayRange && isInTimeRange;
// });
//
const getCurrentTime = () => {
const now = new Date();
const hours = now.getHours().toString().padStart(2, '0');
const minutes = now.getMinutes().toString().padStart(2, '0');
return `${hours}:${minutes}`;
};
//
const isBusinessTime = computed(() => {
const currentTime = getCurrentTime();
const [startTime, endTime] = shopInfo.businessTime.split('-');
return currentTime >= startTime && currentTime <= endTime;
});
//
const productqueryProduct = async () => {
try {
@ -1272,9 +1295,10 @@
// userStore.actionsAPIuser()
//
isDataLoaded.value = true;
} else {
uni.showToast({
title: '错误二维码'
title: '暂无列表数据...'
});
isDataLoaded.value = false;
setTimeout(() => {
@ -1307,20 +1331,6 @@
const currentPage = pages[pages.length - 1];
//
const options = currentPage.options;
// // #ifdef MP-WEIXIN
// if (options.q) {
// console.log(options.q)
// const store = productStore();
// await store.scanCodeactions(options.q)
// }
// // #endif
// // #ifdef MP-ALIPAY
// if (getApp().globalData.tableCode) {
// await store.scanCodeactions(getApp().globalData.tableCode)
// }
// // #endif
await productqueryProduct()
setTimeout(() => {
//
@ -1331,6 +1341,11 @@
</script>
<style lang="scss" scoped>
.grayscale {
filter: grayscale(100%);
pointer-events: none;
}
.top--panel {
// padding: 0 20rpx;
background-color: #fff;
@ -1920,9 +1935,12 @@
border-bottom: 2rpx solid #F0F0F0;
}
.shop_sku_box:last-child {
padding-bottom: 60rpx;
}
.shop_sku_box {
padding: 20rpx 28rpx;
padding: 20rpx;
.shop_sku_box_name {
margin-top: 20rpx;

View File

@ -146,7 +146,9 @@
}
// 使
const navigatorGo = (item) => {}
const navigatorGo = (item) => {
uni.pro.switchTab('index/index')
}
const getCouponList = async () => {
let res = await APIcouponfindByUserId({

View File

@ -93,7 +93,7 @@
res = await APIshopUserpointsRecord({
page: formData.form.page,
size: formData.form.size,
status: formData.status
status: formData.form.status
})
}
if (res.totalPage == 0 || res.totalPage == 1 && res.totalRow <= 10) {
@ -188,7 +188,7 @@
align-items: center;
color: #333;
margin-top: -60rpx;
padding: 0 120rpx;
// padding: 0 120rpx;
font-size: 28rpx;
.fonts {

View File

@ -110,7 +110,6 @@
import {
APIuseractivate,
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
@ -250,7 +249,7 @@
uni.pro.navigateTo(item.url, {
shopId: infoForn.shopId,
type: item.name == '明细' ? 1 : 2,
shopInfo: JSON.stringify(infoForn.userInfo.shopInfo)
shopInfo: JSON.stringify(infoForn.userInfo)
})
// uni.navigateTo({
@ -320,7 +319,7 @@
});
return false;
}
console.log({
await store.actionspayltPayVip({
shopId: infoForn.shopId,
activateId: infoForn.id,
shopUserId: infoForn.userInfo.id,
@ -328,15 +327,6 @@
returnUrl: '', //
buyerRemark: ''
})
let res = await store.actionspayltPayVip({
shopId: infoForn.shopId,
activateId: infoForn.id,
shopUserId: infoForn.userInfo.id,
amount: infoForn.amount, //
returnUrl: '', //
buyerRemark: ''
})
console.log(res)
}
@ -377,11 +367,6 @@
uni.cache.set('shopId', options.shopId, 30)
infoForn.shopId = options.shopId ? options.shopId : uni.cache.get('shopId')
}
// let resone = await APIusershopInfodetail({
// shopId: infoForn.shopId
// })
// infoForn.shopUserInfo = resone.shopInfo
asyncshopUserInfo()
if (options.type == 'detail') {
detailtype.value = 'detail'

View File

@ -101,7 +101,6 @@
onMounted
} from 'vue'
import {
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
@ -135,7 +134,7 @@
uni.pro.navigateTo('user/member/billDetails', {
shopId: shopUserInfo.shopId,
type: type,
shopInfo: JSON.stringify(shopUserInfo.shopInfo)
shopInfo: JSON.stringify(shopUserInfo)
})
} else if (type == 3) {
uni.pro.navigateTo('user/coupon', {
@ -183,11 +182,6 @@
if (pageParams.shopId) {
shopUserInfo.shopId = pageParams.shopId
uni.cache.set('shopId', pageParams.shopId, 30)
// let res = await APIusershopInfodetail({
// shopId: pageParams.shopId
// })
// shopInfo
// shopUserInfo.shopExtend = res.shopExtend.member_bg
asyncshopUserInfo()
}

View File

@ -32,7 +32,7 @@
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png">
</image>
<view class="my_list_item_name">积分</view>
<view class="my_list_item_num">{{userInfo.accountPoints ||'0'}}</view>
<view class="my_list_item_num">{{userInfo.accountPoints ||userInfo.points}}</view>
</view>
<view class="my_list_item">
<image class="my_list_item_icon"
@ -131,10 +131,17 @@
//
const Myassets = () => {
uni.pro.navigateTo('user/member/memberdetails', {
shopId: uni.cache.get('shopId'),
type: 'index'
})
if (uni.cache.get('shopId')) {
uni.pro.navigateTo('user/member/memberdetails', {
shopId: uni.cache.get('shopId'),
type: 'index'
})
} else {
uni.pro.navigateTo('user/member/list', {
shopId: uni.cache.get('shopId'),
type: 'index'
})
}
}
const clickTo = (item, index) => {
@ -191,13 +198,12 @@
onShow(async () => {
await store.actionsAPIuser()
let res = uni.cache.get('orderVIP')
if (uni.cache.get('shopId')) {
Object.assign(userInfo, res)
Object.assign(userInfo, uni.cache.get('orderVIP'))
} else {
Object.assign(userInfo, {
...res,
...res.assetsSummary
...uni.cache.get('userInfo'),
...uni.cache.get('userInfo').assetsSummary
})
}
})

View File

@ -36,7 +36,9 @@ export const Memberpay = defineStore('memberpay', {
openId: uni.cache.get('userInfo').wechatOpenId,
// #endif
returnUrl: data.returnUrl ? data.returnUrl : '',
buyerRemark: data.buyerRemark ? data.buyerRemark : ''
buyerRemark: data.buyerRemark ? data.buyerRemark : '',
orderId: data.orderId,
userAllPack: data.userAllPack
})
if (res) {
uni.showLoading({