19 Commits

Author SHA1 Message Date
3064007137 修复商品弹窗选择不同规格价格未变的回显问题 2026-01-05 16:07:28 +08:00
d8c2aef83e 正式先隐藏联系商家功能 2025-12-29 15:43:27 +08:00
362f3cee96 修复我的页面积分列表换行问题 2025-12-29 15:30:17 +08:00
gyq
ca53618004 Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into test 2025-12-29 13:54:55 +08:00
gyq
cbe27a43de 新增跳转企业微信客服功能 2025-12-29 13:54:53 +08:00
5fcbba0cb4 修复确认订单页面收起按钮消失问题,修复套餐商品添加第二次失效问题 2025-12-29 13:48:37 +08:00
0944635c69 Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into test 2025-12-29 10:11:47 +08:00
067025f532 修复订单列表页面签子问题 2025-12-29 10:11:42 +08:00
gyq
8d917d49ed Merge branch 'test' of https://newgitea.sxczgkj.cn/czg_team/cashier_wx into test 2025-12-26 17:23:21 +08:00
gyq
bcc44a0886 增加跳转企业微信客服示例 2025-12-26 17:23:19 +08:00
811abf935c 修复会员判断问题 2025-12-26 17:22:39 +08:00
bde30fa70c 修复临时菜和数签子显示问题,修复下单页面商品弹窗问题 2025-12-26 16:14:42 +08:00
ac7af51a92 代合合并 2025-12-26 09:48:12 +08:00
9b78ee0f48 修复样式问题,修复拼团进度显示问题 2025-12-25 19:40:13 +08:00
113193b142 修复余额显示问题,增加未开启智慧充值禁用余额支付,修复自动删除未找到对应购物车问题 2025-12-25 11:35:04 +08:00
edd10edf9f 修复商品更新剔除下架商品问题 2025-12-24 18:47:41 +08:00
e645aa5516 修复确认订单页面没有台桌信息温柔 2025-12-24 17:59:55 +08:00
158a025ba1 修复加菜跳转问题 2025-12-24 17:31:09 +08:00
4d7c388f74 修复分销明细详情总数显示问题 2025-12-24 15:56:03 +08:00
25 changed files with 1325 additions and 2841 deletions

View File

@@ -35,8 +35,8 @@ export default async (params) => {
});
}
// #ifdef H5
uni.cache.set('token', 'b61c8b0f1c9d47ad924e33c48b496ce6')
uni.cache.set('userInfo',{"acQrcodeValidTime":"2025-11-17 17:57:16","alipayOpenId":"","birthDay":"2025-10-17","createTime":"2024-07-06 11:30:16","distributionAmount":0,"headImg":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132","id":"36434","idCard":"612401199810058031","isAc":0,"lastLoginTime":"2025-12-25 11:41:15","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"叶明飞","sex":1,"status":1,"updateTime":"2025-12-25 09:41:58","usePayPwd":0,"wechatAcOpenId":"1111","wechatAcQrcode":"","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"})
uni.cache.set('token', '1b5e8baf0cc1492a858a208f113d0971')
uni.cache.set('userInfo',{"acQrcodeValidTime":"2026-01-13 13:35:59","alipayOpenId":"","birthDay":"2025-12-25","createTime":"2024-03-13 10:56:40","distributionAmount":0,"headImg":"https://thirdwx.qlogo.cn/mmopen/vi_32/POgEwh4mIHO4nibH0KlMECNjjGxQUq24ZEaGT4poC6icRiccVGKSyXwibcPq4BWmiaIGuG1icwxaQX6grC9VemZoJ8rg/132","id":"36689","idCard":"","isAc":0,"lastLoginTime":"2025-12-26 10:01:12","nickName":"微信用户","password":"","payPwd":"e10adc3949ba59abbe56e057f20f883e","phone":"18049104914","realName":"","sex":1,"status":1,"updateTime":"2025-12-26 09:59:31","usePayPwd":0,"wechatAcOpenId":"","wechatAcQrcode":"http://weixin.qq.com/q/029s5JtP1xfmJ1g_HDxFco","wechatOpenId":"or1l86yipGvwyfPhrKIAcQuSfAV8"})
// #endif
return new Promise((resolve, reject) => {
const timeoutDuration = params.timeout || 10000; // 可以通过 params 传入超时时间,默认 10 秒

View File

@@ -1,5 +1,6 @@
// const debug = process.env.NODE_ENV == 'development' ? true : false;
const debug = true; // false线上 true本地
// const debug = false; // false线上 true本地
const debug = false; // false线上 true本地
let baseUrl = ''
let baseUrlwws = ''

View File

@@ -55,7 +55,7 @@
</template>
</view>
<!-- 优惠券名称与领取按钮 -->
<view class="u-flex u-row-between u-m-t-16">
<view class="u-flex u-row-between u-m-t-16 u-col-center">
<view>
<text class="title">{{ item.couponInfo.title }}</text>
<text class="num">x{{ item.num }}</text>
@@ -507,6 +507,7 @@ function close() {
outline: none;
margin: 0;
cursor: pointer;
white-space: nowrap;
&:active {
background: #f07080; // 点击深色反馈
}

View File

@@ -1,6 +1,6 @@
<template>
<block v-if="limitDiscount && limitDiscount.id" class="limit-price">
<text>
<block v-if="limitDiscount && limitDiscount.id" >
<text class="limit-price">
{{ returnPrice() }}
</text>
</block>

View File

@@ -1,260 +0,0 @@
<template>
<!-- 支付方式 -->
<view class="paymentMethod">
<view class="paymentMethod_content">
<view class="paymentMethod_title">支付方式</view>
<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="groupChanges(item.type)" :class="{disabled:returnDisabled(item)}"
v-if="(index+1) == radiovalue?!changeFreeenable:true">
<view class="method_list_top">
<view class="method_list_top_left">
<image class="icon" :src="item.url" mode="aspectFill" />
<view class="method_list_top_cen">
<view class="name"> {{ item.name }} </view>
<view class="method_list_bom" v-if="item.type == 1">
<text class="balance">
当前余额{{orderVIP?(orderVIP.amount||0):0}}</text>
<text class="topUpNow" @click="goRecharge">去充值</text>
</view>
</view>
</view>
<up-radio :disabled="returnDisabled(item)" activeColor="#E8AD7B" icon-size="18" size="18" :name="item.type">
</up-radio>
</view>
</view>
</block>
</up-radio-group>
</view>
</view>
</template>
<script setup>
import {
ref,
reactive,
defineProps,
computed,
defineEmits,
watch,
watchEffect,
defineExpose
} from 'vue'
const props = defineProps({
rechargeFreeChecked: {
type: Boolean,
default: false
},
payAmount: {
type: Number,
default: 0
},
freeCheck: {
type: Boolean,
default: false
},
changeFreeenable: {
type: Boolean,
default: false
},
disablePayType: {
type: Array,
default: () => {
return []
}
}
});
function returnDisabled(item) {
if (props.disablePayType.includes(item.name)) {
return true
}else{
return false
}
}
const orderVIP = ref(null)
const emits = defineEmits(['customevent', 'groupChange']);
watchEffect(() => {
orderVIP.value = uni.cache.get('orderVIP')
})
const orderVIPfun = (data) => {
orderVIP.value = data
}
const paymentMethodList = ref([
// #ifdef MP-WEIXIN
{
name: "微信支付",
type: 2,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
payType: 'wechatPay'
},
// #endif
// #ifdef MP-ALIPAY
{
name: "支付宝支付",
type: 3,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png",
payType: 'aliPay'
},
// #endif
{
name: "余额支付",
type: 1,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png",
payType: 'accountPay'
}
])
const paymentMethodName = ref([{
name: "余额支付",
type: 1,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png",
payType: 'accountPay'
},
{
name: "微信支付",
type: 2,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png",
payType: 'wechatPay'
},
{
name: "支付宝支付",
type: 3,
url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png",
payType: 'aliPay'
},
])
const radiovalue = ref(2) // 支付方式
const ispws = ref(false) // 输入支付密码
const storeInfo = ref({})
// * 监听支付方式切换
const groupChanges = (type) => {
if (props.freeCheck && type == 1) {
return;
}
const item=paymentMethodList.value.find(v=>v.type==type)
if(item&&returnDisabled(item)){
uni.showToast({
title:"当前支付方式不可用",
icon:'none'
})
return
}
// if (props.payAmount <= 0 && type != 1) {
// return;
// }
radiovalue.value = type;
let name = paymentMethodName.value[type - 1].name;
emits("groupChange", paymentMethodName.value[type - 1])
}
// 去充值
const goRecharge = () => {
if (orderVIP.value.isVip) {
uni.navigateTo({
url: '/pages/user/member/czzx?shopId=' + orderVIP.value.shopId
})
return
}
uni.navigateTo({
url: '/user/vip/buy-vip?shopId=' + orderVIP.value.shopId
})
// uni.pro.navigateTo('user/member/index', {
// shopId: orderVIP.value.shopId
// })
}
// 将方法暴露给父组件
defineExpose({
groupChanges,
orderVIPfun
});
</script>
<style lang="scss">
.paymentMethod {
box-sizing: border-box;
margin-top: 30rpx;
border-radius: 18rpx;
.paymentMethod_content {
background-color: #fff;
border-radius: 22rpx;
padding: 30rpx 30rpx 0 30rpx;
box-sizing: border-box;
.paymentMethod_title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
box-sizing: border-box;
}
.method_list {
padding: 40rpx 0;
box-sizing: border-box;
&.disabled{
opacity: .6;
}
.method_list_top {
display: flex;
justify-content: space-between;
.method_list_top_left {
display: flex;
align-items: center;
.icon {
width: 54.67rpx !important;
height: 48rpx !important;
margin-right: 22rpx;
}
.name {
font-size: 32rpx;
font-weight: 500;
color: #333;
}
.method_list_top_cen {
display: flex;
flex-direction: column;
}
}
}
.method_list_bom {
display: flex;
align-items: center;
.balance {
margin-right: 20rpx;
font-size: 24rpx;
}
.topUpNow {
color: #FF803D;
font-size: 28rpx;
}
}
}
.method_list:nth-child(odd) {
border-bottom: 2rpx solid #e5e5e5;
}
}
}
</style>

View File

@@ -15,7 +15,7 @@
<view class="name"> {{ item.name }} </view>
<view class="method_list_bom" v-if="item.name == '余额支付'">
<text class="balance">
当前余额{{ orderVIP ? orderVIP.amount || 0 : 0 }}</text>
当前余额{{ shopUserInfo ? shopUserInfo.amount || 0 : 0 }}</text>
<text class="topUpNow" @click="goRecharge">去充值</text>
</view>
</view>
@@ -66,6 +66,14 @@ const props = defineProps({
type: Array,
default: () => [],
},
shopUserInfo:{
type: Object,
default: () => {
return{
amount:0
}
},
}
});
// 工具函数 - 深拷贝对象(切断引用)
@@ -77,15 +85,10 @@ function returnDisabled(item) {
return props.disablePayType.includes(item.name);
}
const orderVIP = ref(null);
const emits = defineEmits(["customevent", "groupChange"]);
watchEffect(() => {
orderVIP.value = uni.cache.get("orderVIP");
});
const orderVIPfun = (data) => {
orderVIP.value = data;
};
// 支付方式列表(保持不变)
const paymentMethodList = ref([
@@ -207,13 +210,12 @@ const goRecharge = () => {
return;
}
uni.navigateTo({
url: `/pages/user/member/czzx?shopId=${orderVIP.value?.shopId || ''}`,
url: `/pages/user/member/czzx?shopId=${props.shopUserInfo?.shopId || ''}`,
});
};
defineExpose({
groupChanges,
orderVIPfun,
});
</script>

View File

@@ -45,17 +45,17 @@
</view>
</view>
<view>
<view
<!-- <view
class="u-p-t-16 u-p-b-20 u-flex u-p-l-28 u-p-r-28"
style="align-items: baseline; justify-content: flex-end"
>
<text class="color-666 font-12"> 总计</text>
<text class="font-16 color-333 font-700" v-if="centerUserInfo">
{{ centerUserInfo.totalIncome }}</text
<text class="font-16 color-333 font-700" >
{{ totalIncome }}</text
>
</view>
</view> -->
<view class="list">
<view class="list u-m-t-32">
<view v-for="(item, index) in state.records" :key="index" class="item">
<view class="u-flex justify-between">
<view>
@@ -113,6 +113,7 @@
<scroll-view
class="popup-list"
direction="vertical"
:scroll-y="true"
@scrollend="scrollBottom"
>
<view
@@ -301,6 +302,7 @@ async function centerUser() {
}
onShow(() => {});
onLoad(async (opt) => {
await getCouponShopsAjax();
@@ -314,13 +316,24 @@ onLoad(async (opt) => {
}
if (opt.shopId) {
querForm.value.shopId = opt.shopId;
const findItem = couponShops.value.find((item) => item.id == opt.shopId);
const findItem = shopList.value.find((item) => item.shopId == opt.shopId);
querForm.value.shopName = findItem.shopName || "";
}
centerUser();
getIncomeDetailsAjax();
});
const totalIncome=computed(()=>{
if(!querForm.value.shopId){
return centerUserInfo.value?(centerUserInfo.value.totalIncome||0):0;
}
const findItem = shopList.value.find((item) => item.shopId == querForm.value.shopId );
if(findItem){
return findItem.income||0
}
return 0
})
watch(
() => querForm.value.status,
(newVal, oldVal) => {

View File

@@ -566,7 +566,7 @@ export function calcSingleGoodsRealPrice(
>
) : number {
const { isMember, memberDiscountRate, limitTimeDiscount: activity } = config;
console.log('isMember',isMember);
//如果是增菜价格为0
if (goods.is_gift || goods.isGift) {
return 0;

View File

@@ -7,7 +7,7 @@
"lodash": "^4.17.21",
"pinia": "^2.3.1",
"pinia-plugin-unistorage": "^0.1.2",
"ysk-utils": "^1.0.81"
"ysk-utils": "^1.0.83"
},
"devDependencies": {
"unplugin-auto-import": "^0.16.7"

View File

@@ -2,11 +2,9 @@
<view class="content min-page bg-f7">
<view class="contentbox">
<template v-if="shopExtend.length">
<image class="bg" :src="shopExtend[0].value" mode="aspectFill"
v-if="!isJsonArrayString(shopExtend[0].value)"></image>
<image class="bg" :src="shopExtend[0].value" mode="aspectFill" v-if="!isJsonArrayString(shopExtend[0].value)"></image>
<swiper class="swiper" autoplay circular v-else>
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)"
:key="index">
<swiper-item class="swiper-item" v-for="(item, index) in JSON.parse(shopExtend[0].value)" :key="index">
<image class="swiper-bg" :src="item"></image>
</swiper-item>
</swiper>
@@ -29,7 +27,6 @@
<image :src="imgs.code" class="code"></image>
</view>
</view>
<view class="new-menus-box">
<view class="new-menus layout2" v-if="allConfig.takeout">
<view class="diner" @click="scanCodehandle(0)">
@@ -60,7 +57,6 @@
<view class="u-font-28 color-999">一键分享快速拼单</view>
</view>
</view>
<view class="points" @click="toIntegralMall">
@@ -122,28 +118,15 @@
</template>
<script setup>
import attractPopup from '@/components/attract-popup.vue';
import {
homeData
} from '@/common/api/market/index.js';
import {
getMemberConfig,
getRechargeConfig
} from '@/common/api/index/index.js';
import {
ref,
reactive,
defineProps,
defineEmits,
onMounted
} from 'vue';
import {
isJsonArrayString
} from '@/utils/util.js';
import attractPopup from '@/components/attract-popup.vue';
import { homeData } from '@/common/api/market/index.js';
import { getMemberConfig, getRechargeConfig } from '@/common/api/index/index.js';
import { ref, reactive, defineProps, defineEmits, onMounted } from 'vue';
import { isJsonArrayString } from '@/utils/util.js';
const attractPopupRef = ref(null);
const attractPopupRef = ref(null);
const imgs = {
const imgs = {
recharge: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/2f22c0ced494497e8d6f981832b191c9.png',
share: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/bcb8d461e96d445ba40256079da775b3.png',
vip: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/cfc3bf5ba12747c6ada4d5a388aceca3.png',
@@ -155,79 +138,75 @@
code: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/044dcaf913054f03a9db7983f048b1e6.png',
defaultAvatar: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/b98d2c7110e847f996e8d7ba4342f0a5.png',
taocan: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/4/1eb9aa9b865b47b39ab9d7ac404601a9.png'
};
// 定义接收的属性
const props = defineProps({
};
// 定义接收的属性
const props = defineProps({
shopExtend: {
type: Array,
default: []
}
});
});
function toGroupBuying() {
function toGroupBuying() {
uni.navigateTo({
url: '/groupBuying/index/index'
})
}
});
}
function toFenxiao() {
function toFenxiao() {
uni.navigateTo({
url: '/distribution/shop-detail/index?shopId=' + uni.cache.get('shopId')
});
}
}
function toIntegralMall() {
function toIntegralMall() {
uni.navigateTo({
url: '/scoreShop/index/index?shopId=' + uni.cache.get('shopId')
});
}
}
import {
productStore
} from '@/stores/user.js';
import {
onShow
} from '@dcloudio/uni-app';
import { productStore } from '@/stores/user.js';
import { onShow } from '@dcloudio/uni-app';
// 显示弹窗
const popupShow = ref(false);
const scanCodehandle = (i) => {
// 显示弹窗
const popupShow = ref(false);
const scanCodehandle = (i) => {
popupShow.value = true;
};
};
// 预点单
function beforehandOrderHandle() {
// 预点单
function beforehandOrderHandle() {
popupShow.value = false;
uni.cache.set('dinersNum', 1);
uni.cache.set('tableCode', shopUserInfo.id);
uni.navigateTo({
url: '/pages/product/index?type=beforehand'
});
}
}
// 扫码点餐
async function scanOrderHandle() {
// 扫码点餐
async function scanOrderHandle() {
popupShow.value = false;
const store = productStore();
await store.scanCodeactions();
}
}
function toTaocan() {
function toTaocan() {
uni.navigateTo({
url: '/userPackage/index/index'
})
}
});
}
const memberindex = (url) => {
const memberindex = (url) => {
uni.pro.navigateTo(url, {
shopId: uni.cache.get('shopId'),
type: 'index'
});
};
const shopUserInfo = reactive({});
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
};
const shopUserInfo = reactive({});
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
function tomember() {
function tomember() {
if (isMember.value) {
const shopId = uni.cache.get('shopId');
if (!shopUserInfo.isVip) {
@@ -245,9 +224,9 @@
icon: 'none'
});
}
}
}
function toCharge() {
function toCharge() {
if (isCharge.value) {
const shopId = uni.cache.get('shopId');
uni.navigateTo({
@@ -259,8 +238,8 @@
icon: 'none'
});
}
}
const getQueryString = (url, name) => {
}
const getQueryString = (url, name) => {
//解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i');
var r = url.substr(1).match(reg);
@@ -268,12 +247,12 @@
return r[2];
}
return null;
};
};
// 获取会员配置
const isMember = ref(0);
const isCharge = ref(0);
async function getVipConfig() {
// 获取会员配置
const isMember = ref(0);
const isCharge = ref(0);
async function getVipConfig() {
try {
const res1 = await getMemberConfig({
shopId: uni.cache.get('shopId')
@@ -287,43 +266,43 @@
} catch (error) {
console.log(error);
}
}
}
const allConfig = reactive({
const allConfig = reactive({
takeout: 0,
group: 0,
pointsMall: 0,
distribution: 0,
couponNum: 0,
pointNum: 0
});
});
function getHomeData() {
function getHomeData() {
homeData().then((res) => {
Object.assign(allConfig, res);
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar
imgs.defaultAvatar = res.userAvatar ? res.userAvatar : imgs.defaultAvatar;
});
}
onMounted(() => {
}
onMounted(() => {
updateData();
});
});
function updateData() {
function updateData() {
Object.assign(shopUserInfo, uni.cache.get('shopUserInfo') || {});
getVipConfig();
getHomeData();
}
defineExpose({
}
defineExpose({
updateData
});
});
</script>
<style scoped lang="scss">
page {
page {
background: #f6f8fa;
}
}
.swiper {
.swiper {
width: 100%;
height: 100%;
@@ -336,9 +315,9 @@
height: 100%;
}
}
}
}
.content {
.content {
.contentbox {
position: relative;
width: 100%;
@@ -426,9 +405,9 @@
}
}
}
}
}
.popup-content {
.popup-content {
width: 90vw;
background-color: #fff;
border-radius: 8px;
@@ -467,9 +446,9 @@
width: 248upx;
}
}
}
}
.menus {
.menus {
display: flex;
padding: 32rpx 40rpx;
margin-top: 150rpx;
@@ -483,9 +462,9 @@
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
flex: 1;
}
}
}
.userInfo {
.userInfo {
display: flex;
padding: 22rpx 24rpx;
margin: 0 4rpx;
@@ -510,9 +489,9 @@
width: 33px;
height: 33px;
}
}
}
.new-menus-box {
.new-menus-box {
margin: 0 16rpx 0 16rpx;
.new-menus {
@@ -544,7 +523,8 @@
background: #ededed;
}
.takeout {}
.takeout {
}
}
&.layout1 {
@@ -569,9 +549,9 @@
}
}
}
}
}
.groupBuying {
.groupBuying {
padding: 16rpx 38rpx;
border-top: 2rpx solid #ededed;
background-color: #fff;
@@ -583,21 +563,21 @@
width: 40px;
height: 40px;
}
}
}
.title {
.title {
color: #333333;
font-size: 36rpx;
font-weight: 700;
}
}
.desc {
.desc {
margin-top: 16rpx;
font-size: 28rpx;
color: #999;
}
}
.points {
.points {
margin-top: 10px;
background-color: #fff;
padding: 16rpx 68rpx;
@@ -610,16 +590,16 @@
width: 98px;
height: 98px;
}
}
}
.taocan {
.taocan {
.img {
width: 117px;
height: 117px;
}
}
}
.bottom_menus {
.bottom_menus {
display: flex;
gap: 14rpx;
margin-top: 10px;
@@ -649,5 +629,5 @@
white-space: nowrap;
}
}
}
}
</style>

View File

@@ -7,13 +7,20 @@
<view class="limitDiscount" v-if="showLimitDiscount(item)"
>限时折扣</view
>
<up-image
width="76"
height="76"
radius="6"
:src="item.productImg"
v-if="item.productId != -999"
v-if="item.isTemporary != 1&&item.is_temporary!=1"
></up-image>
<up-image
v-else-if="(item.isTemporary||item.is_temporary) &&(item.product_name=='签子'||item.productName=='签子')"
width="76"
height="76"
radius="6"
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
mode="heightFix"
></up-image>
<up-image
width="76"
@@ -25,7 +32,7 @@
></up-image>
</view>
<view class="info">
<text class="productName">{{ item.productName }}</text>
<text class="productName">{{ item.productName||item.product_name }}</text>
<text class="productSkuName" v-if="item.skuName">{{
item.skuName
}}</text>
@@ -55,18 +62,22 @@
<view class="price">
<view class="priceAmount">
¥
<goodsPrice
v-if="!item.is_temporary&&!item.isTemporary"
:cart="item"
:limitDiscount="limitDiscount"
:shopUserInfo="shopUserInfo"
:shopInfo="shopInfo"
idKey="product_id"
></goodsPrice>
<text v-else>{{item.discount_sale_amount}}</text>
<view class="old-price" v-if="showLimitDiscount(item)"
>¥{{ item.salePrice }}</view
>
</view>
<view class="num">x{{ item.num }}</view>
<view class="num" v-if="!item.is_temporary&&!item.isTemporary">x{{ item.num }}</view>
<view class="num" v-else>x{{ item.number }}</view>
</view>
</view>
</view>

View File

@@ -44,7 +44,7 @@
:shopInfo="cartStore.shopInfo" :shopUserInfo="cartStore.shopUserInfo"
:limitDiscount="cartStore.limitTimeDiscount"></orderItemVue>
<view class="u-flex u-row-center u-m-t-16 u-font-28">
<view class="u-flex u-row-center u-m-t-16 u-font-28" v-if="cartStore.allGoods.length>4">
<view class="u-flex u-col-baseline" @click="showAllGoods=!showAllGoods">
<text>{{showAllGoods?'收起':'展开'}}</text>
<view class="guodu u-m-l-10 u-m-t-2" :class="{rotate:!showAllGoods}">

View File

@@ -70,7 +70,10 @@
<view class="item" v-for="item in value" :key="item.id">
<view class="cover">
<up-image width="76" height="76" radius="16" :src="item.productImg"
v-if="item.productId!=-999"></up-image>
v-if="!item.isTemporary"></up-image>
<u-image width="56" height="56" radius="10"
v-else-if="item.isTemporary &&item.productName=='签子'"
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"></u-image>
<up-image width="76" height="76" radius="16"
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
mode="heightFix" v-else></up-image>

File diff suppressed because it is too large Load Diff

View File

@@ -67,7 +67,7 @@
</rechargeFree>
<!-- 支付方式 -->
<paymentMethodes ref="paymentMethodref" :orderVIP="orderVIP" @groupChange="groupChange"
<paymentMethodes ref="paymentMethodref" :shopUserInfo="orderVIP" @groupChange="groupChange"
:disablePayType="disablePayType" :changeFreeenable="isBwc" v-model="paymentmethod"
v-if="listinfo.status == 'unpaid' || !listinfo.id">
<template #bottom>
@@ -203,6 +203,7 @@
useWebSocket
} from "@/stores/carts-websocket.js";
import * as chatApi from "@/http/php/chat";
import * as rechargeApi from '@/common/api/market/recharge.js'
import MsgListItem from '@/components/msg-list-item/msg-list-item.vue'
@@ -858,8 +859,6 @@
icon: "none",
});
const shopUserInfo = uni.cache.get("shopUserInfo");
console.log("shopUserInfo", shopUserInfo);
console.log("listinfo", listinfo);
if (shopUserInfo) {
if (shopUserInfo.userId == listinfo.userId) {
pay_unlock();
@@ -1011,7 +1010,6 @@
// 更新数据
if (orderVIP.value) {
orderVIP.value = uni.cache.get("orderVIP");
paymentMethodref.value.orderVIPfun(uni.cache.get("orderVIP"));
if (listinfo.id && ordershopUserInfo.value.registerType != "before") {
orderorderInfo();
}
@@ -1034,7 +1032,7 @@
console.log("跳转到加菜页面");
const arr= getCurrentPages()
console.log(arr);
if(arr[arr.length-1]&&arr[arr.length-1].route=='pages/product/index'){
if(arr.length>=2&&arr[arr.length-2]&&arr[arr.length-2].route=='pages/product/index'){
back();
}else{
uni.cache.set('tableCode',listinfo.tableCode)
@@ -1113,10 +1111,11 @@
}
const limitTimeDiscountRes = ref(null)
const rechargeConfig=ref(null)
async function init(opt) {
await storeuser.actionsproductqueryProduct();
console.log("init");
const res1= await storeuser.actionsproductqueryProduct();
orderVIP.value=res1
console.log('orderVIP',orderVIP.value)
cartStore.clearOrderConfig();
Object.assign(options, opt);
listinfo.id = options.orderId;
@@ -1146,10 +1145,23 @@
}
}
//获取台桌信息
let tableRes = await getTableInfo({
tableCode: options.tableCode || "",
});
console.log("tableRes", tableRes);
listinfo.tableName = tableRes?tableRes.name:'';
//获取店铺信息
const shopInfoRes = await APIusershopInfodetail({
shopId: options.shopId,
});
//智慧充值
const rechargeConfigRes=await rechargeApi.config({shopId: options.shopId})
if(rechargeConfigRes&&typeof rechargeConfigRes ==='object'){
rechargeConfig.value=rechargeConfigRes
}
//获取积分配置
pointsApi.pointsConfig().then(res => {
cartStore.setPointDeductionRule(res);
@@ -1274,6 +1286,9 @@
if (!isCanUseCharge.value) {
arr.add("余额支付");
}
if(rechargeConfig.value&&!rechargeConfig.value.isEnable){
arr.add("余额支付");
}
return Array.from(arr);
});

View File

@@ -583,7 +583,6 @@
console.log(uni.cache.get('orderVIP'))
orderVIP.value = uni.cache.get('orderVIP')
ordershopUserInfo.value = orderVIP.value.shopInfo
paymentMethodref.value.orderVIPfun(uni.cache.get('orderVIP'))
if (orderId.value) {
orderorderInfo()
}

View File

@@ -62,8 +62,14 @@
<view class="shop-info">
<view class="shop-item">
<view class="cover" v-for="(item1,index1) in item.goods" :key="index1">
<u-image width="56" height="56" radius="10" :src='item1.productImg'
v-if="item1.productId!=-999"></u-image>
<u-image width="56" height="56" radius="10" :src="item1.productImg"
v-if="!item1.isTemporary"></u-image>
<u-image width="56" height="56" radius="10"
v-else-if="item1.isTemporary &&item1.productName=='签子'"
src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png"
></u-image>
<u-image width="112" height="112" radius="20"
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/table.png'"
mode="heightFix" v-else></u-image>
@@ -130,32 +136,37 @@
import {
useNavbarStore
} from '@/stores/navbarStore';
import {APIshopUserInfo} from '@/common/api/member.js'
import {
APIshopUserInfo
} from '@/common/api/member.js'
const store = useNavbarStore();
async function agignOrder(item){
async function agignOrder(item) {
await APIshopUserInfo({
shopId:item.shopId
}).then(shopUserInfo=>{
if(shopUserInfo){
shopId: item.shopId
}).then(shopUserInfo => {
if (shopUserInfo) {
uni.cache.set("dinersNum", 1);
uni.cache.set("tableCode", shopUserInfo.id);
uni.cache.set("shopId", item.shopId);
uni.navigateTo({
url: "/pages/product/index?type=beforehand&order_id="+item.id+'&one_more_order=1',
url: "/pages/product/index?type=beforehand&order_id=" + item.id +
'&one_more_order=1',
});
}
})
}
function totalGoodsNum(arr){
if(!arr){
function totalGoodsNum(arr) {
if (!arr) {
return 0
}
return arr.reduce((prve,cur)=>{
return prve+cur.num
},0)
return arr.reduce((prve, cur) => {
return prve + cur.num
}, 0)
}
function isRemoveOrder(item) {
uni.showModal({
title: '提示',
@@ -578,7 +589,8 @@
.ml-20 {
margin-left: 20rpx;
}
.take_food_number{
.take_food_number {
padding: 20rpx;
background-color: #F8F8F8;
margin-left: 36rpx;

View File

@@ -1,9 +1,9 @@
<template>
<up-popup :show="visible" :round="20" mode="bottom" @close="close" :close-on-click-overlay="true">
<view class="" style="height: calc(100vh - 70px);">
<view class="shop_sku" >
<view class="u-flex u-flex-col box" :style="{maxHeight:boxHeight+'px'}">
<view class="shop_sku">
<scroll-view scroll-y style="height: calc(100vh - 240px); width: 100%">
<scroll-view scroll-y class="scroll-view" :style="{maxHeight:boxHeight +'px'}">
<!-- <view class="positionabsolute">
<up-icon name="arrow-down" @click="close" color="#333" size="22"></up-icon>
</view> -->
@@ -19,7 +19,8 @@
{{ goods.shortTitle ? goods.shortTitle : '' }}
</view>
<view v-if="goods.type != 'package'">
<view class="shop_sku_box" v-for="(specOptions, specType) in goods.selectSpecInfo" :key="specType">
<view class="shop_sku_box" v-for="(specOptions, specType) in goods.selectSpecInfo"
:key="specType">
<view class="shop_sku_box_name">
{{ specType }}
</view>
@@ -45,11 +46,15 @@
<view v-else>
<view class="shop_sku_box">
<view v-for="(setmenu, setmenuindex) in goods.groupSnap" :key="setmenuindex">
<view class="shop_sku_box_name">{{ setmenu.title }} {{ setmenu.count }}
{{ setmenu.number }}</view>
<view class="shop_sku_box_name" v-if="goods.groupType!=0">{{ setmenu.title }}
{{ setmenu.count }}
{{ setmenu.number }}
</view>
<view class="shop_sku_box_name" v-else>{{ setmenu.title }} {{ setmenu.count }}件商品</view>
<view class="flex-start">
<view class="shop_sku_box_item" v-for="(option, goodsid) in setmenu.goods"
:key="goodsid" @click="goodsidClick(setmenuindex, option, goodsid)" :class="{
:key="goodsid" @click="goodsidClick(setmenuindex, option, goodsid,setmenu)"
:class="{
shop_sku_box_item_selected: isOptionSelected(setmenuindex, option)
}" :disabled="isMaxSelected(setmenuindex) && !isOptionSelected(setmenuindex, option)">
{{ option.proName }}
@@ -120,8 +125,9 @@
</view>
</scroll-view>
<view class="shop_bottom">
<!-- 占位 -->
<view class="shop_bottom" style="opacity: 0;">
<view class="flex-between">
<view class="price price-sku" v-if="goods.type != 'package' && goods.result">
<text class="i"></text>
@@ -159,6 +165,64 @@
</view>
<view class="operation-wrap" v-if="goods.type != 'package'&&stockNumberIsFull(goods)">
<view class="btn">
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
v-if="shopCartNumber > 0"></up-icon>
<view class="btnClick"></view>
</view>
<text class="num">{{ shopCartNumber }}</text>
<view class="btn">
<up-icon name="plus-circle-fill" color="#E9AB7A" size="25"></up-icon>
<view class="btnClick"></view>
</view>
</view>
</view>
<view class="shop_skuselect flex-start" v-if="selectedSpecsStr">
<view class="shop_skuselectname">{{ selectedSpecsStr }}</view>
</view>
<view class="addShopping">
库存不足
</view>
</view>
<!-- <view style="width: 100%;height: 123px;"></view> -->
</scroll-view>
<view class="shop_bottom" style="position: absolute;bottom: 0;">
<view class="flex-between">
<view class="price price-sku" v-if="goods.type != 'package' && goods.result">
<text class="i"></text>
<view class="num">
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="selSku"
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
</view>
<text class="num" v-if="false">
{{
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
? goods.result.memberPrice || goods.result.salePrice
: goods.result.salePrice
}}
</text>
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
<text
v-if="goods.result.suitNum > 1">{{ goods.result.suitNum }}{{ goods.result.unitName }}起点</text>
</view>
<view class="price price-package " v-else>
<text class="i"></text>
<view class="num">
<GoodsPrice :limitDiscount="cartStore.limitTimeDiscount" :cart="selSku"
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
</view>
<text class="i" v-if="goods.unitName">/{{ goods.unitName }}</text>
<text v-if="selSku&&selSku.suitNum > 1">{{ selSku.suitNum }}{{ selSku.unitName }}起点</text>
</view>
<view v-if="goods.type == 'package'&&goods.groupType==1">
</view>
<view class="operation-wrap" v-else-if="stockNumberIsFull(goods)">
<view class="btn">
<up-icon name="minus-circle-fill" color="#E9AB7A" size="25"
v-if="shopCartNumber > 0"></up-icon>
@@ -181,11 +245,13 @@
</template>
<template v-else>
<template v-if="isSkuGoods">
<view v-if="goods.type == 'package'" class="addShopping package"
<view v-if="goods.type == 'package' && goods.groupType!=0" class="addShopping package"
:class=" allConditionsSatisfied ? 'active' : ''" @click="submitSelection(goods)">
添加到购物车
</view>
<view v-else class="sku addShopping" :class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
<view v-else class="sku addShopping"
:class="shopCartNumber > 0 && canSubmit ? 'active' : ''"
@click="submitSelection(goods)">
添加到购物车
</view>
@@ -197,8 +263,6 @@
</view>
</template>
</template>
</view>
</view>
</view>
@@ -236,6 +300,7 @@
import {
computed,
inject,
onMounted,
ref,
watch
} from "vue";
@@ -266,7 +331,10 @@
});
// / 选择规格的方法
const goodsidClick = (setmenuindex, option, goodsid) => {
const goodsidClick = (setmenuindex, option, goodsid, setmenu) => {
if (props.goods.groupType == 0) {
return
}
if (!selectedOptions.value[setmenuindex]) {
// 如果 selectedOptions.value[setmenuindex] 不存在,初始化一个空数组
selectedOptions.value[setmenuindex] = [];
@@ -278,11 +346,14 @@
} else if (!isMaxSelected(setmenuindex)) {
// 如果未达到最大选择数量,添加到选中列表
selectedOptions.value[setmenuindex].push(option);
} else if (isMaxSelected(setmenuindex) && setmenu.number == 1) {
selectedOptions.value[setmenuindex] = [option]
}
};
// 计算所有选中条件是否都符合
const allConditionsSatisfied = computed(() => {
console.log('props.goods', props.goods);
// 检查 specifications.item.groupSnap 是否存在
if (!props.goods?.groupSnap) {
return false;
@@ -306,6 +377,8 @@
const selSku = ref(null)
// 处理规格选择的方法
const selectSpec = async (specType, option) => {
console.log('specType', specType)
console.log('option', option)
// 规格清零
shopCartNumber.value = 0;
@@ -407,6 +480,9 @@
});
function stockNumberIsFull(item) {
if (item.isStock && item.stockNumber < item.suitNum) {
return false
@@ -542,13 +618,18 @@
if (goods.type != 'package' && shopCartNumber.value <= 0) {
return;
}
if (goods.type == 'package' && !allConditionsSatisfied.value) {
if (goods.type == 'package' && goods.groupType != 0 && !allConditionsSatisfied.value) {
return
}
if ((goods.type == 'package' && allConditionsSatisfied.value) || (goods.type ==
'sku' && canSubmit.value)) {
let res = cartStore.carts.find(cart => cart.product_id == goods.id && cart.sku_id == selSku.value.id)
let res = null;
if (goods.type == 'package') {
res = null
} else {
res = cartStore.carts.find(cart => cart.product_id == goods.id && cart.sku_id == selSku.value.id)
}
let suitNum = 1;
let sku_id = ''
// 是否是套餐 有就传
@@ -649,16 +730,30 @@
}
}
};
const boxHeight = ref(500)
onMounted(async () => {
// #ifdef MP-WEIXIN || MP-ALIPAY
const menuButtonInfo = uni.getMenuButtonBoundingClientRect();
const systemInfo = uni.getSystemInfoSync();
const statusBarHeight = systemInfo.statusBarHeight;
// 计算标题的垂直偏移量
const verticalOffset = menuButtonInfo.top;
const titleHeight = menuButtonInfo.height;
console.log('systemInfo', systemInfo);
boxHeight.value = systemInfo.windowHeight - verticalOffset - menuButtonInfo.height - systemInfo
.safeAreaInsets.bottom - 4
// #endif
})
</script>
<style lang="scss" scoped>
.box {
height: 100vh;
display: flex;
flex-direction: column;
background: transparent;
.top {
width: 750rpx;
}
.scroll-view {}
}
.shop_sku {
@@ -668,7 +763,11 @@
border-radius: 20rpx;
background: #fff;
box-sizing: border-box;
display: flex;
flex-direction: column;
justify-content: space-between;
overflow: hidden;
.positionabsolute {
position: absolute;
top: 30rpx;
@@ -803,6 +902,7 @@
background-color: #fff;
box-shadow: 0rpx -6rpx 14rpx 2rpx rgba(0, 0, 0, 0.1);
.price {
display: flex;
align-items: flex-end;

View File

@@ -26,17 +26,18 @@
<view class="limit-discount" v-if="showLimitDiscount(item)">
限时折扣
</view>
<up-image :src="item.coverImg" width="124rpx" height="124rpx" mode="aspectFill"
<up-image v-if="!item.cartListinfo.is_temporary" :src="item.coverImg" width="124rpx" height="124rpx" mode="aspectFill"
radius="10"></up-image>
<up-image v-else-if="item.cartListinfo.is_temporary&&item.cartListinfo.product_name=='签子'" src="https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/5/b97054debd83486ab7ad8e20ca6a360a.png" width="124rpx" height="124rpx" mode="aspectFill"
radius="10"></up-image>
<up-image v-else width="124rpx" height="124rpx" mode="aspectFill"
radius="10"></up-image>
</view>
<view class="info">
<view class="name">
{{
item.cartListinfo.is_temporary == 1
? "临时菜"
: item.name
}}
<view class="name" v-if=" item.cartListinfo.is_temporary == 1">
{{item.cartListinfo.product_name||item.cartListinfo.name|| item.name}}
</view>
<view class="name" v-else>{{item.name}}</view>
<view class="select-sku-wrap" v-if="item.type == 'sku'">
<text v-for="i in item.skuList" :key="i.id">
{{ item.cartListinfo.sku_id == i.id ? i.name : "" }}
@@ -206,9 +207,6 @@
limitDiscount: props.limitDiscount.id ? props.limitDiscount : null,
shopUserInfo: shopUserInfo,
});
if (goods.name == "纯生纯生纯生") {
console.log("returnRealPrice", price);
}
return price;
}

View File

@@ -105,7 +105,7 @@
:class="shopInfo.isVip == 0 || shopInfo.isMemberPrice == 0 ? 'lineThrough' : ''">¥</text>
<!-- 会员价与价格 -->
<text class="price">
{{ shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? item.memberPrice || item.salePrice : item.salePrice }}
{{ shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1 ? item.memberPrice || item.salePrice : item.salePrice }}
</text>
<!-- 单位 -->
<text class="unit" v-if="item.unitName">/{{ item.unitName }}</text>
@@ -257,7 +257,7 @@
<view class="money">
<view>¥</view>
<text class="money_num" style="margin-right: 10rpx">
{{ shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1 ? item1.memberPrice || item1.salePrice : item1.salePrice }}
{{ shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1 ? item1.memberPrice || item1.salePrice : item1.salePrice }}
</text>
<text v-if="item1.unitName">/{{ item1.unitName }}</text>
</view>
@@ -491,7 +491,7 @@
<text class="num" v-if="false">
{{
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1
? specifications.item.result.memberPrice || specifications.item.result.salePrice
: specifications.item.result.salePrice
}}
@@ -509,7 +509,7 @@
</view>
<text class="num" v-if="false">
{{
shopInfo.isVip == 1 && shopInfo.isMemberPrice == 1
shopUserInfo.isVip == 1 && shopUserInfo.isMemberPrice == 1
? specifications.item.memberPrice || specifications.item.salePrice
: specifications.item.salePrice
}}
@@ -750,7 +750,7 @@
useCartStore
} from '@/stores/order.js';
import {
computed
computed, provide
} from 'vue';
const cartStore = useCartStore();
/**
@@ -762,7 +762,6 @@
proxy
} = getCurrentInstance();
//点单智能推荐
function onBuyClick(item) {
let index = -1;
@@ -802,7 +801,6 @@
/**
* 通用数据合集 start
*/
const showGoodsModal = ref(false)
// 门店信息
const shopInfo = reactive({});
@@ -1450,7 +1448,6 @@
show:true,
goods:specifications.item
})
// showGoodsModal.value=true
};
// 判断商品是否在可售时间内
const isProductAvailable = async (sellDaysStr, startTimeStr, endTimeStr) => {
@@ -1685,20 +1682,27 @@
// 返回商品对应sku数据
function cartInit(arr) {
const result = []
console.log('cartInitArr', arr);
console.log('allGoodsArr', allGoodsArr);
cartStore.carts = arr.map(v => {
const goods = allGoodsArr.find(g => g.id == v.product_id)
const goods = cartStore.allGoodsArr.find(g => g.id == v.product_id)
const goodsSkuList = goods ? goods.skuList : []
const findSku = goodsSkuList.find(sku => sku.id == v.sku_id)
const memberPrice = findSku ? findSku.memberPrice : 0
const is_temporary=v.is_temporary||v.isTemporary
const is_time_discount = limitUtils.canUseLimitTimeDiscount({
...v,
memberPrice
}, cartStore.limitTimeDiscount, shopInfo,
shopUserInfo.value, 'product_id');
if (!goods) {
if (!goods&&!is_temporary) {
console.log('删除未匹配到的商品', {
id: v.id,
operate_type: "del",
table_code: uni.cache.get('tableCode'),
shop_id: uni.cache.get('shopId'),
type: "shopping",
})
useSocket.sendMessage({
id: v.id,
operate_type: "del",
@@ -1747,7 +1751,7 @@
isLoading.value = false;
return false;
}
console.log('product index 收到消息', Message);
// 检查消息是否已经处理过
if (processedMessageIds.has(Message.msg_id)) {
return;
@@ -2184,11 +2188,11 @@
}
return currentTime >= startTime && currentTime <= endTime;
});
let allGoodsArr = []
const allGoodsArr = ref([])
// 列表请求
const productqueryProduct = async () => {
cartStore.goodsIsloading = false;
allGoodsArr = []
allGoodsArr.value=[]
try {
shopProductList.hots = await productminiApphotsquery();
shopProductList.productInfo = await APIgroupquery();
@@ -2200,38 +2204,46 @@
setTimeout(() => {
uni.pro.switchTab('index/index');
}, 1000);
return; // 出错直接返回,避免后续逻辑
}
if (shopProductList.productInfo.length > 0 || shopProductList.hots.length > 0) {
//TODO handle the exception
//第一步:将所有商品的 cartNumber 初始化为 0
shopProductList.productInfo.forEach((group) => {
group.productList.forEach(async (product) => {
product.isSaleTimeshow = await isProductAvailable(product.days, product
.startTime, product.endTime);
allGoodsArr.push(product)
// 第一步处理productInfo替换forEach为for...of支持await
for (const group of shopProductList.productInfo) {
for (const product of group.productList) {
product.cartNumber = 0;
// 等待异步函数执行完成后再push
product.isSaleTimeshow = await isProductAvailable(
product.days,
product.startTime,
product.endTime
);
allGoodsArr.value.push(product);
cartStore.setGoodsMap(product.id, product);
});
});
shopProductList.hots.forEach(async (i) => {
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
allGoodsArr.push(i)
cartStore.setGoodsMap(i.id, i);
});
console.log('shopProductList', shopProductList);
}
}
// 第二步处理hots同理替换forEach为for...of
for (const i of shopProductList.hots) {
i.cartNumber = 0;
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
allGoodsArr.value.push(i);
cartStore.setGoodsMap(i.id, i);
}
// 此时所有异步操作完成allGoodsArr已有数据
// console.log('allGoodsArr', allGoodsArr);
// console.log('shopProductList', shopProductList);
console.log('cartStore.carts', cartStore.carts)
cartStore.allGoodsArr=allGoodsArr.value
if (cartStore.carts.length > 0) {
cartInit(cartStore.carts)
cartInit(cartStore.carts);
}
cartStore.goodsIsloading = true;
scrollTopSize.value = 0;
topArr.value = [];
// userStore.actionsAPIuser()
// 数据可以更新
isDataLoaded.value = true;
// 历史订单
Historicalorders();
updateProductQuantities();
} else {

View File

@@ -60,6 +60,9 @@
<text v-if="item.bizCode == 'cashback'">
消费返现
</text>
<text v-if="item.bizCode == 'cashback_refund'">
消费返现扣减
</text>
<text v-if="item.bizCode == 'freeIn'">
霸王餐充值
</text>

View File

@@ -1,12 +1,16 @@
<template>
<view class="container">
<image class="topBack" :src="
<image
class="topBack"
:src="
userInfo.shopExtendList
? userInfo.shopExtendList[1].value
? userInfo.shopExtendList[1].value
: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png'
: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png'
" mode="aspectFill"></image>
"
mode="aspectFill"
></image>
<view class="myContent">
<view class="my_info flex-between">
<view class="my_info_left">
@@ -15,8 +19,7 @@
<image class="my_info_left_head" :src="userInfo.headImg" mode="aspectFill"></image>
</button>
<!-- <view class="name">{{ userInfo.nickName }}</view> -->
<input type="nickname" class="name" v-model="userInfo.nickName" placeholder="输入昵称"
@blur="onNicknameInput" />
<input type="nickname" class="name" v-model="userInfo.nickName" placeholder="输入昵称" @blur="onNicknameInput" />
<!-- #endif -->
<!-- #ifndef MP-WEIXIN -->
<image class="my_info_left_head" :src="userInfo.headImg" mode="aspectFill"></image>
@@ -27,8 +30,7 @@
<image class="my_info_right_qr" src="/static/icon/code.png" mode="aspectFill"></image>
<view class="msg-view" @click="viewUserMsgList">
<view class="msg-icon-wrapper">
<image v-if="unreadMsgCount > 0" class="my-msg-icon" src="/static/mine/msg_select.png"
mode="aspectFill"></image>
<image v-if="unreadMsgCount > 0" class="my-msg-icon" src="/static/mine/msg_select.png" mode="aspectFill"></image>
<image v-else class="my-msg-icon" src="/static/mine/msg.png" mode="aspectFill"></image>
<!-- 角标 -->
@@ -39,7 +41,6 @@
</view>
</view>
<!-- <image class="my_info_right_qr" @click="clickEvent" v-if="userInfo.isVip == 1 && ShopId"
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_qRcode.png'" mode="aspectFill">
</image>
@@ -55,9 +56,7 @@
<view class="amount">
<view class="u-flex u-flex-between u-m-t-20">
<view class="u-flex">
<image style="width: 50rpx; height: 37rpx"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/storedValue.png"
mode="aspectFill"></image>
<image style="width: 50rpx; height: 37rpx" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/storedValue.png" mode="aspectFill"></image>
<text class="color-333 font-14 u-m-l-20">储值</text>
</view>
<view class="u-flex color-666" @click="toChargeList">
@@ -67,23 +66,17 @@
</view>
<view class="card-list">
<view class="card-list-item" v-for="(item, index) in rechargeList" :key="index"
@click="toCharge(item)">
<view class="card-list-item" v-for="(item, index) in rechargeList" :key="index" @click="toCharge(item)">
<up-image radius="20rpx" width="182rpx" height="182rpx" :src="item.logo"></up-image>
<view class="info text-center">
<view class="color-333 u-m-t-14">
<text class="font-10">¥</text>
<text class="font-16 font-700">{{
item.amount || "0.00"
}}</text>
<text class="font-16 font-700">{{ item.amount || '0.00' }}</text>
</view>
<view class="font-12 color-666 u-line-1">{{
item.shopName
}}</view>
<view class="font-12 color-666 u-line-1">{{ item.shopName }}</view>
</view>
</view>
<view class="u-flex u-flex-column u-flex-center" style="width: 12px" v-if="rechargeList.length"
@click="toChargeList">
<view class="u-flex u-flex-column u-flex-center" style="width: 12px" v-if="rechargeList.length" @click="toChargeList">
<view class="text-center color-333 font-12">查看全部</view>
</view>
</view>
@@ -91,8 +84,7 @@
<view class="vip u-m-t-40">
<view class="u-flex u-flex-between u-m-t-20">
<view class="u-flex">
<image style="width: 50rpx; height: 40rpx" src="/static/icon/vip.png" mode="aspectFill">
</image>
<image style="width: 50rpx; height: 40rpx" src="/static/icon/vip.png" mode="aspectFill"></image>
<text class="color-333 font-14 u-m-l-20">会员</text>
</view>
<view class="u-flex color-666" @click="tomemberList">
@@ -102,13 +94,10 @@
</view>
<view class="card-list">
<view class="card-list-item" v-for="(item, index) in memberList" :key="index"
@click="tomember(item)">
<view class="card-list-item" v-for="(item, index) in memberList" :key="index" @click="tomember(item)">
<up-image radius="20rpx" width="182rpx" height="182rpx" :src="item.logo"></up-image>
<view class="info text-center">
<view class="font-12 color-666 u-m-t-14 u-line-1">{{
item.shopName
}}</view>
<view class="font-12 color-666 u-m-t-14 u-line-1">{{ item.shopName }}</view>
</view>
</view>
<view class="u-flex u-flex-column u-flex-center" style="width: 12px" v-if="memberList.length">
@@ -119,9 +108,7 @@
<view class="amount">
<view class="u-flex u-flex-between u-m-t-20">
<view class="u-flex">
<image style="width: 50rpx; height: 44rpx"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png" mode="aspectFill">
</image>
<image style="width: 50rpx; height: 44rpx" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/points.png" mode="aspectFill"></image>
<text class="color-333 font-14 u-m-l-20">积分</text>
</view>
<view class="u-flex color-666" @click="toCoin()">
@@ -131,22 +118,16 @@
</view>
<view class="card-list">
<view class="card-list-item" v-for="(item, index) in coinList" :key="index"
@click="toCoin(item)">
<view class="card-list-item" v-for="(item, index) in coinList" :key="index" @click="toCoin(item)">
<up-image radius="20rpx" width="182rpx" height="182rpx" :src="item.logo"></up-image>
<view class="info text-center">
<view class="color-333 u-m-t-14">
<text class="font-16 font-700">{{
item.pointBalance || "0"
}}</text>
<text class="font-16 font-700">{{ item.pointBalance || '0' }}</text>
</view>
<view class="font-12 color-666 u-line-1">{{
item.shopName
}}</view>
<view class="font-12 color-666 u-line-1">{{ item.shopName }}</view>
</view>
</view>
<view class="u-flex u-flex-column u-flex-center" style="width: 12px" v-if="coinList.length"
@click="toCoin()">
<view class="u-flex u-flex-column u-flex-center" style="width: 12px" v-if="coinList.length" @click="toCoin()">
<view class="text-center color-333 font-12">查看全部</view>
</view>
</view>
@@ -154,16 +135,13 @@
</view>
<view class="my_item my_fun u-m-t-30">
<view class="my_fun_list">
<view class="my_list_item" v-for="(item, index) in myFunList" :key="index"
@click="clickTo(item, index)">
<view class="my_list_item" v-for="(item, index) in myFunList" :key="index" @click="clickTo(item, index)">
<view class="my_list_item_left">
<image class="my_list_item_icon" :src="item.icon" mode="aspectFill"></image>
<view class="my_list_item_name">{{ item.name }}</view>
</view>
<view class="my_list_item_right u-flex">
<text v-if="item.type == 'score'" class="font-12">{{
userInfo.pointBalance || 0
}}</text>
<text v-if="item.type == 'score'" class="font-12">{{ userInfo.pointBalance || 0 }}</text>
<!-- <text v-else-if="item.type=='my_coupon'" class="font-12 ">{{userInfo.couponNum || 0}}</text> -->
<text class="font-12 color-999" v-else>查看</text>
<u-icon class="u-m-t-2" name="arrow-right" color="#999999" size="12"></u-icon>
@@ -190,47 +168,58 @@
</template>
<script setup>
import weQrcode from "@/components/wechat-ac-qrcode.vue";
import devetools from "@/components/devetools.vue";
import weQrcode from '@/components/wechat-ac-qrcode.vue';
import devetools from '@/components/devetools.vue';
import {
ref,
computed,
onMounted,
reactive,
watch
} from "vue";
import {
onLoad,
onReady,
onShow
} from "@dcloudio/uni-app";
import {
productStore
} from "@/stores/user.js";
import * as vipApi from "@/common/api/account/vip.js";
import * as rechargeApi from "@/common/api/market/recharge.js";
import {
pointsShopList
} from '@/common/api/market/points.js'
import {
getUnReadCountReq
} from "../../common/api/account/message";
import {
updateUserInfoReq
} from "../../common/api/api";
import {
uploadFile
} from '@/common/api/upload.js';
import { ref, computed, onMounted, reactive, watch } from 'vue';
import { onLoad, onReady, onShow } from '@dcloudio/uni-app';
import { productStore, Storelogin } from '@/stores/user.js';
import * as vipApi from '@/common/api/account/vip.js';
import * as rechargeApi from '@/common/api/market/recharge.js';
import { pointsShopList } from '@/common/api/market/points.js';
import { getUnReadCountReq } from '../../common/api/account/message';
import { updateUserInfoReq } from '../../common/api/api';
import { uploadFile } from '@/common/api/upload.js';
function qrcodeResult(res) {
qrcode.value = res;
// 打开企业微信客服
const userStore = Storelogin();
function openContact() {
const shopInfo = uni.cache.get('ordershopUserInfo');
if (shopInfo.weworkId && shopInfo.weworkUrl) {
wx.openCustomerServiceChat({
// corpId: 'wwc76ab19fa6df267f',
corpId: shopInfo.weworkId,
extInfo: {
// url: 'https://work.weixin.qq.com/kfid/kfc40ac2dc5e20c2e8e'
url: shopInfo.weworkUrl
},
// 成功回调
success: (res) => {
console.log('跳转企业微信客服成功', res);
},
// 失败回调
fail: (err) => {
console.error('跳转企业微信客服失败', err);
uni.showToast({
title: '跳转客服失败,请稍后重试',
icon: 'none'
});
}
});
} else {
uni.showToast({
title: '未开放',
icon: 'none'
});
}
}
const store = productStore();
const myFunList = ref([
function qrcodeResult(res) {
qrcode.value = res;
}
const store = productStore();
const myFunList = ref([
// {
// name: "积分",
// type: "score",
@@ -238,14 +227,14 @@
// url: '/user/score/list'
// },
{
name: "优惠券",
type: "my_coupon",
icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png",
name: '优惠券',
type: 'my_coupon',
icon: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_coupon.png'
},
{
name: "分销",
type: "fenxiao",
icon: "/static/icon/fenxiao.svg",
name: '分销',
type: 'fenxiao',
icon: '/static/icon/fenxiao.svg'
},
// {
// name: "商家推送",
@@ -269,34 +258,35 @@
// icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/my_member.png"
// },
// { name: "关于", type: "", icon: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/inRegard.png"},
]);
// { name: '联系商家', type: 'contact', icon: 'https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/1/2b0480c32c1844dbae2c09f6a729c6e8.png' }
]);
const userInfo = reactive({});
const userInfo = reactive({});
const ShopId = ref(uni.cache.get("shopId"));
console.log("ShopId", uni.cache.get("shopId"));
const ShopId = ref(uni.cache.get('shopId'));
console.log('ShopId', uni.cache.get('shopId'));
function tomemberList() {
function tomemberList() {
uni.navigateTo({
url: "/pages/user/member/list",
url: '/pages/user/member/list'
});
}
}
function tomember(item) {
function tomember(item) {
uni.navigateTo({
url: "/user/vip/vip?shopId=" + item.shopId,
url: '/user/vip/vip?shopId=' + item.shopId
});
}
}
const clickEvent = () => {
const clickEvent = () => {
if (ShopId.value) {
if (!userInfo.isVip) {
uni.navigateTo({
url: "/user/vip/buy-vip?shopId=" + ShopId.value,
url: '/user/vip/buy-vip?shopId=' + ShopId.value
});
} else {
uni.navigateTo({
url: "/user/vip/vip?shopId=" + ShopId.value,
url: '/user/vip/vip?shopId=' + ShopId.value
});
}
@@ -312,115 +302,118 @@
// })
// }
} else {
uni.pro.navigateTo("member/list", {
type: "user_payCode",
uni.pro.navigateTo('member/list', {
type: 'user_payCode'
});
}
};
};
// 我的资产
const Myassets = () => {
if (uni.cache.get("shopId")) {
uni.pro.navigateTo("user/member/memberdetails", {
shopId: uni.cache.get("shopId"),
type: "index",
// 我的资产
const Myassets = () => {
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",
uni.pro.navigateTo('user/member/list', {
shopId: uni.cache.get('shopId'),
type: 'index'
});
}
};
};
function toCharge(item) {
function toCharge(item) {
uni.navigateTo({
url: "/pages/user/member/czzx?shopId=" + item.shopId,
url: '/pages/user/member/czzx?shopId=' + item.shopId
});
}
}
function toChargeList() {
function toChargeList() {
uni.navigateTo({
url: "/pages/user/member/amount-list",
url: '/pages/user/member/amount-list'
});
}
}
const clickTo = (item, index) => {
const clickTo = (item, index) => {
if (item.url) {
uni.navigateTo({
url: item.url,
url: item.url
});
return;
}
let shopId = null;
switch (item.type) {
case "msg":
case 'msg':
uni.navigateTo({
url: "/pageChat/index"
url: '/pageChat/index'
});
break;
case "my_order":
uni.pro.switchTab("order/index");
case 'my_order':
uni.pro.switchTab('order/index');
break;
case "my_member":
uni.pro.navigateTo("user/member/list");
case 'my_member':
uni.pro.navigateTo('user/member/list');
break;
case "recharge":
if (uni.cache.get("shopId") && uni.cache.get("token")) {
uni.pro.navigateTo("member/index", {
shopId: uni.cache.get("shopId"),
type: "index",
case 'recharge':
if (uni.cache.get('shopId') && uni.cache.get('token')) {
uni.pro.navigateTo('member/index', {
shopId: uni.cache.get('shopId'),
type: 'index'
});
} else {
uni.pro.navigateTo("member/list", {
type: "user_recharge",
uni.pro.navigateTo('member/list', {
type: 'user_recharge'
});
}
break;
case "points": //积分
if (uni.cache.get("shopId") && uni.cache.get("token")) {
uni.pro.navigateTo("/pagesPoints/index/index", {
shopId: uni.cache.get("shopId"),
type: "user",
case 'points': //积分
if (uni.cache.get('shopId') && uni.cache.get('token')) {
uni.pro.navigateTo('/pagesPoints/index/index', {
shopId: uni.cache.get('shopId'),
type: 'user'
});
} else {
uni.pro.navigateTo("member/list", {
type: "user_points",
uni.pro.navigateTo('member/list', {
type: 'user_points'
});
}
break;
case "my_coupon": //优惠券
uni.pro.navigateTo("user/coupon", {
shopId: uni.cache.get("shopId") || "",
case 'my_coupon': //优惠券
uni.pro.navigateTo('user/coupon', {
shopId: uni.cache.get('shopId') || ''
});
break;
case "fenxiao": //优惠券
case 'fenxiao': //优惠券
uni.navigateTo({
url: "/distribution/index",
url: '/distribution/index'
});
break;
case "myself": //内部页面
uni.pro.navigateTo("user/myself");
case 'myself': //内部页面
uni.pro.navigateTo('user/myself');
break;
case "scan_applet":
case 'scan_applet':
uni.navigateToMiniProgram(JSON.parse(item.value));
break;
case "absolute": //外链url
case 'absolute': //外链url
uni.navigateTo({
url: `/pages/webview/webview?url=${item.menuUrl}`,
url: `/pages/webview/webview?url=${item.menuUrl}`
});
break;
case 'contact': // 联系商家
openContact();
break;
}
};
};
const memberList = ref([]);
const rechargeList = ref([]);
const memberTotal = ref(0);
const rechargeTotal = ref(0);
const memberList = ref([]);
const rechargeList = ref([]);
const memberTotal = ref(0);
const rechargeTotal = ref(0);
const coinTotal = ref(0);
const coinList = ref([]);
async function getData() {
const coinTotal = ref(0);
const coinList = ref([]);
async function getData() {
const res = await vipApi.list();
memberTotal.value = res.length;
memberList.value = res.slice(0, 3);
@@ -430,103 +423,103 @@
const res3 = await pointsShopList();
coinTotal.value = res3.length;
coinList.value = res3;
}
coinList.value = res3.slice(0, 3);
}
function toCoin(item) {
if(item){
function toCoin(item) {
if (item) {
uni.navigateTo({
url: "/pages/user/member/billDetails?type=2&shopId="+item.shopId+"&id="+(item.id||''),
url: '/pages/user/member/billDetails?type=2&shopId=' + item.shopId + '&id=' + (item.id || '')
});
return
return;
}
uni.navigateTo({
url: "/user/score/list",
url: '/user/score/list'
});
}
}
const unreadMsgCount = ref(0);
const unreadMsgCount = ref(0);
const getUnReadMsgCount = async () => {
let res = await getUnReadCountReq()
const getUnReadMsgCount = async () => {
let res = await getUnReadCountReq();
let badge = Number(res)
let badge = Number(res);
if (badge > 0) {
uni.setTabBarBadge({
index: 2,
text: badge.toString()
})
});
} else {
uni.removeTabBarBadge({
index: 2
})
});
}
unreadMsgCount.value = badge
}
unreadMsgCount.value = badge;
};
const viewUserMsgList = () => {
const viewUserMsgList = () => {
uni.navigateTo({
url: "/pages/user/message/index"
})
}
url: '/pages/user/message/index'
});
};
onShow(() => {
loadUserInfo()
console.log("userInfo", userInfo);
onShow(() => {
loadUserInfo();
console.log('userInfo', userInfo);
getData();
getUnReadMsgCount()
});
getUnReadMsgCount();
});
const loadUserInfo = async () => {
const loadUserInfo = async () => {
await store.actionsAPIuser();
if (uni.cache.get("shopId")) {
Object.assign(userInfo, uni.cache.get("orderVIP"));
if (uni.cache.get('shopId')) {
Object.assign(userInfo, uni.cache.get('orderVIP'));
} else {
Object.assign(userInfo, {
...uni.cache.get("userInfo"),
...uni.cache.get("userInfo").assetsSummary,
...uni.cache.get('userInfo'),
...uni.cache.get('userInfo').assetsSummary
});
}
}
};
const qrcode = ref("");
const showQrcode = computed(() => {
const followIndex = uni.cache.get("followIndex");
if (followIndex == "mine" && qrcode.value) {
const qrcode = ref('');
const showQrcode = computed(() => {
const followIndex = uni.cache.get('followIndex');
if (followIndex == 'mine' && qrcode.value) {
return true;
}
});
const onChooseAvatar = async (e) => {
const fileRes = await uploadFile(e.detail.avatarUrl);
updateUserInfo({
headImg: fileRes
});
};
const onChooseAvatar = async (e) => {
const fileRes = await uploadFile(e.detail.avatarUrl)
const onNicknameInput = (e) => {
updateUserInfo({
"headImg": fileRes
})
}
nickName: e.detail.value
});
};
const onNicknameInput = (e) => {
updateUserInfo({
"nickName": e.detail.value
})
}
const updateUserInfo = async (param) => {
await updateUserInfoReq(param);
const updateUserInfo = async (param) => {
await updateUserInfoReq(param)
loadUserInfo()
}
loadUserInfo();
};
</script>
<style scoped lang="scss">
.topBack {
.topBack {
width: 100%;
height: 400rpx;
position: absolute;
}
}
.myContent {
.myContent {
position: relative;
z-index: 1;
padding: 298rpx 0 60rpx 0;
@@ -668,9 +661,9 @@
}
}
}
}
}
.card-list {
.card-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
column-gap: 40rpx;
@@ -687,21 +680,21 @@
overflow: hidden;
}
}
}
}
.qrcode {
.qrcode {
padding: 24rpx;
margin: 60rpx 32rpx 60rpx 32rpx;
border-radius: 18rpx;
border: 2rpx solid #d9d9d9;
}
}
.qrcode-box {
.qrcode-box {
position: fixed;
transform: translateX(200vw, 200vh);
}
}
.right-icons {
.right-icons {
display: flex;
.my_info_right_qr {
@@ -742,5 +735,5 @@
text-align: center;
}
}
}
}
</style>

10
pnpm-lock.yaml generated
View File

@@ -30,8 +30,8 @@ importers:
specifier: ^0.1.2
version: 0.1.2
ysk-utils:
specifier: ^1.0.81
version: 1.0.81
specifier: ^1.0.83
version: 1.0.83
devDependencies:
unplugin-auto-import:
specifier: ^0.16.7
@@ -357,8 +357,8 @@ packages:
webpack-virtual-modules@0.6.2:
resolution: {integrity: sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==}
ysk-utils@1.0.81:
resolution: {integrity: sha512-c6SOfOaw43aDDuyXgEv24Vo561EfFoa1gfGbY+p1EfXHoGPOE6tQLekbWW9bn37KAse0Gdef7VCbdv0Dr6ltaw==}
ysk-utils@1.0.83:
resolution: {integrity: sha512-48KLQJXQtF8nLaaFHR1hAFx/QGS848fg7n37BpZEtwliD+D5ZHQFPOCZNaM68jiwDTWhNg41rHpZzhAUQXe+/Q==}
snapshots:
@@ -684,7 +684,7 @@ snapshots:
webpack-virtual-modules@0.6.2: {}
ysk-utils@1.0.81:
ysk-utils@1.0.83:
dependencies:
bignumber.js: 9.3.1
loadsh: 0.0.4

View File

@@ -40,6 +40,9 @@ export const useCartsStore = defineStore("cart", () => {
//用户信息
const shopUserInfo = ref(uni.cache.get("shopUserInfo") || {});
//全部的商品列表
const allGoodsArr=ref([])
const consumeDiscount = ref({});
// 适配工具库 BaseCartItem 接口的商品数据转换函数
@@ -326,7 +329,11 @@ export const useCartsStore = defineStore("cart", () => {
.map((v) => {
const item = getProductDetails(v);
if (!item) {
const is_temporary=v.is_temporary||v.isTemporary
if(is_temporary){
return v
}
if (!item&&!is_temporary) {
socketSendMsg({
id: v.id,
operate_type: "del",
@@ -496,10 +503,10 @@ export const useCartsStore = defineStore("cart", () => {
return false;
}
const isUse =
shopUserInfo.value.isVip && shopUserInfo.value.isMemberPrice && shopInfo.value
.isMemberPrice == 1 ?
shopUserInfo.value.isVip && shopUserInfo.value.isMemberPrice ?
true :
false;
console.log('useVipPrice',isUse);
return isUse;
});
@@ -754,6 +761,6 @@ export const useCartsStore = defineStore("cart", () => {
//限时折扣
limitTimeDiscount,
shopUserInfo,
socketSendMsg,
socketSendMsg,allGoodsArr
};
});

View File

@@ -716,9 +716,10 @@
const index = item.packageInfo.tieredDiscount.findIndex(v => v.peopleNum==nowStep.value.peopleNum)
if (index != -1) {
const percent= (index + 1) / item.packageInfo.tieredDiscount.length * 100
return percent>=100?100:0;
}
return percent>=100?100:percent;
}else{
return 0
}
})
const nowPrice = computed(() => {
if (!item.packageInfo) {