From 251490e3ab8e10f413519150b3d61534911fae4f Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Tue, 16 Dec 2025 15:07:09 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=83=A8=E5=88=86?=
=?UTF-8?q?=E6=89=93=E5=8D=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/order/confirm-order.vue | 14 ++++++++++++++
pages/product/index.vue | 28 ++++++++++++++++++++--------
stores/carts.js | 1 -
3 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue
index f736501..55268c0 100644
--- a/pages/order/confirm-order.vue
+++ b/pages/order/confirm-order.vue
@@ -150,6 +150,7 @@
import {
back
} from "@/utils/uniapp.js";
+ import * as limitTimeDiscountapi from '@/common/api/market/limitTimeDiscount.js';
import {
onLoad,
onUnload
@@ -1096,6 +1097,8 @@
Object.assign(listinfo, res);
getOrderInfoAfterCalcInit(res);
}
+
+ const limitTimeDiscountRes=ref(null)
async function init(opt) {
await storeuser.actionsproductqueryProduct();
@@ -1117,6 +1120,17 @@
if (res && typeof res == "object") {
setOrder(res);
}
+ }else{
+ const limitRes = await limitTimeDiscountapi.getConfig({
+ shopId: uni.cache.get('shopId')
+ });
+ if (limitRes && typeof limitRes == 'object') {
+ limitTimeDiscountRes.value = limitRes;
+
+ } else {
+ limitTimeDiscountRes.value = null;
+
+ }
}
//获取店铺信息
const shopInfoRes = await APIusershopInfodetail({
diff --git a/pages/product/index.vue b/pages/product/index.vue
index 1e676a3..0229075 100644
--- a/pages/product/index.vue
+++ b/pages/product/index.vue
@@ -606,7 +606,8 @@
import isBetween from 'dayjs/plugin/isBetween';
import {
- APIshopUserInfo,APIusershopInfodetail
+ APIshopUserInfo,
+ APIusershopInfodetail
} from "@/common/api/member.js";
dayjs.extend(isBetween);
import {
@@ -1535,10 +1536,10 @@
for (let cart of arr) {
const findItem = cartStore.carts.find(v => v.id == cart.id)
- if (findItem&&findItem.is_time_discount != cart.is_time_discount) {
+ if (findItem && findItem.is_time_discount != cart.is_time_discount) {
result.push({
id: cart.id,
- is_time_discount: findItem.is_time_discount
+ is_time_discount: findItem.is_time_discount
})
}
}
@@ -1610,7 +1611,7 @@
shop_id: uni.cache.get('shopId'),
time_dis_info: cartStore.limitTimeDiscount
};
-
+
useSocket.sendMessage({
type: 'shopping',
operate_type: 'time_discount_save',
@@ -1683,7 +1684,6 @@
}
if (Message.operate_type == 'time_discount_save') {
cartStore.limitTimeDiscount = Message.data;
- console.log('time_discount_save', cartStore.limitTimeDiscount);
}
//除去p 每次返回都回执消息
@@ -2183,6 +2183,17 @@
} else {
await userStore.actionsproductqueryShop(newTableCode);
await userStore.actionsproductqueryProduct();
+ const res = await APIhistoryOrder({
+ tableCode: uni.cache.get('tableCode')
+ });
+
+ if(res&&res.id){
+ return uni.showModal({
+ title:'提示',
+ content:'目标台桌使用中无法转桌',
+ showCancel:false
+ })
+ }
if (shopInfoRes.shopInfo.isTableFee === 1) {
// 免桌位费,直接换桌
startUseTable();
@@ -2191,6 +2202,7 @@
tableInfo.value = uni.cache.get('shopTable');
showTableInfoPeopleNumPopup.value = true;
}
+
}
} catch (error) {
console.log(error);
@@ -2212,11 +2224,11 @@
const shopInfoRes = await APIusershopInfodetail({
shopId: uni.cache.get('shopId')
});
- if(shopInfoRes&&shopInfoRes.shopInfo){
+ if (shopInfoRes && shopInfoRes.shopInfo) {
Object.assign(shopInfo, shopInfoRes.shopInfo);
- uni.cache.set('shopInfo',shopInfoRes.shopInfo)
+ uni.cache.set('shopInfo', shopInfoRes.shopInfo)
}
-
+
if (userInfo && typeof userInfo === 'object') {
shopUserInfo.value = userInfo
diff --git a/stores/carts.js b/stores/carts.js
index d32806f..00462cc 100644
--- a/stores/carts.js
+++ b/stores/carts.js
@@ -438,7 +438,6 @@ export const useCartsStore = defineStore("cart", () => {
limitTimeDiscount.value = Message.data;
}
if (Message.operate_type == "time_discount_save") {
- console.log("time_discount_save", Message.data);
limitTimeDiscount.value = Message.data;
}
From 645122c182f05eee10b373a3ec8a783fcd34b198 Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Tue, 16 Dec 2025 17:00:32 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=8D=E6=9D=A5?=
=?UTF-8?q?=E4=B8=80=E5=8D=95=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/config.js | 64 +++++++++-------
components/paymentMethod.vue | 2 +-
.../shop-detail/components/share-popup.vue | 52 ++++++++++++-
distribution/shop-detail/index.vue | 3 +
pages/order/components/orderInfo.vue | 5 ++
pages/order/index.vue | 2 +-
pages/product/index.vue | 49 +++++++++---
stores/carts.js | 2 +-
vite.config.js | 75 ++++++++++---------
9 files changed, 170 insertions(+), 84 deletions(-)
diff --git a/common/config.js b/common/config.js
index f070d96..1c2f8d9 100644
--- a/common/config.js
+++ b/common/config.js
@@ -21,36 +21,42 @@ const baseUrlwws = debug ? proxyApiwws : "wss://czgeatws.sxczgkj.com/wss"; //
const version = "100";
const autoRemoveCache = {
- count: 100000,
- size: 100000,
+ count: 100000,
+ size: 100000,
};
- uni.conf = {
- debug,
- baseUrl,
- version,
- autoRemoveCache,
- baseUrlwws,
+uni.conf = {
+ debug,
+ baseUrl,
+ version,
+ autoRemoveCache,
+ baseUrlwws,
};
+console.log('uni.conf',uni.conf)
+
export const changeEnv = (env) => {
- if (env === "test") {
- uni.conf = {
- debug: true,
- baseUrl: "http://192.168.1.42",
- phpUrl:'http://192.168.1.42:8787/api/',
- phpChatWx:'ws://192.168.1.42:2348',
- version: 100,
- autoRemoveCache,
- baseUrlwws: "ws://192.168.1.42:2348",
- };
- }
- if (env === "prod") {
- uni.conf = {
- debug: false,
- baseUrl: "https://cashier.sxczgkj.com",
- version: 100,
- autoRemoveCache,
- baseUrlwws: "wss://czgeatws.sxczgkj.com/wss",
- };
- }
-};
+ if (env === "test") {
+ let baseUrl = "http://192.168.1.42"
+ // #ifdef H5
+ baseUrl = "/api"
+ // #endif
+ uni.conf = {
+ debug: true,
+ baseUrl,
+ phpUrl: 'http://192.168.1.42:8787/api/',
+ phpChatWx: 'ws://192.168.1.42:2348',
+ version: 100,
+ autoRemoveCache,
+ baseUrlwws: "ws://192.168.1.42:2348",
+ };
+ }
+ if (env === "prod") {
+ uni.conf = {
+ debug: false,
+ baseUrl: "https://cashier.sxczgkj.com",
+ version: 100,
+ autoRemoveCache,
+ baseUrlwws: "wss://czgeatws.sxczgkj.com/wss",
+ };
+ }
+};
\ No newline at end of file
diff --git a/components/paymentMethod.vue b/components/paymentMethod.vue
index 1c2c9fb..7b3aad7 100644
--- a/components/paymentMethod.vue
+++ b/components/paymentMethod.vue
@@ -21,7 +21,7 @@
{{ item.name }}
-
+
当前余额¥{{ orderVIP ? orderVIP.amount || 0 : 0 }}
diff --git a/distribution/shop-detail/components/share-popup.vue b/distribution/shop-detail/components/share-popup.vue
index 97dee80..f8fc284 100644
--- a/distribution/shop-detail/components/share-popup.vue
+++ b/distribution/shop-detail/components/share-popup.vue
@@ -100,17 +100,61 @@ function close() {
function save() {
show.value = false;
+ // 保存图片到相册
uni.saveImageToPhotosAlbum({
filePath: code.value,
success: function () {
uni.showToast({
title: "保存成功",
+ icon: 'none'
});
},
- fail: function () {
- uni.showToast({
- title: "保存失败",
- });
+ fail: function (err) {
+ console.log('保存失败原因:', err);
+ // 判断是否为授权拒绝(微信小程序授权拒绝的特征)
+ if (err.errMsg.includes('auth deny') || err.errMsg.includes('authorize fail')) {
+ // 弹出提示引导用户去设置页开启授权
+ uni.showModal({
+ title: '授权提示',
+ content: '保存图片需要授权访问相册,请前往设置开启授权',
+ showCancel: true,
+ cancelText: '取消',
+ confirmText: '去设置',
+ success: function (res) {
+ if (res.confirm) {
+ // 跳转到微信小程序的授权设置页
+ uni.openSetting({
+ success: function (settingRes) {
+ // 检查用户是否开启了相册授权
+ if (settingRes.authSetting['scope.writePhotosAlbum']) {
+ uni.showToast({
+ title: '授权成功,可重新保存',
+ icon: 'none'
+ });
+ } else {
+ uni.showToast({
+ title: '未开启授权,保存失败',
+ icon: 'none'
+ });
+ }
+ },
+ fail: function () {
+ uni.showToast({
+ title: '打开设置失败',
+ icon: 'none'
+ });
+ }
+ });
+ }
+ }
+ });
+ } else {
+ // 非授权问题的保存失败(如文件路径错误、系统问题等)
+ uni.showToast({
+ title: "保存失败",
+ icon: 'none'
+ });
+ }
},
});
diff --git a/distribution/shop-detail/index.vue b/distribution/shop-detail/index.vue
index 59aa06f..9fb1639 100644
--- a/distribution/shop-detail/index.vue
+++ b/distribution/shop-detail/index.vue
@@ -612,6 +612,9 @@ const showInviteCode = computed(() => {
) {
return true;
}
+ if( config.openType == "auto" ){
+ return true;
+ }
if (!state.distributionUser && config.openType == "manual") {
return true;
}
diff --git a/pages/order/components/orderInfo.vue b/pages/order/components/orderInfo.vue
index aa6a267..0e0a31a 100644
--- a/pages/order/components/orderInfo.vue
+++ b/pages/order/components/orderInfo.vue
@@ -760,6 +760,7 @@
usePoints.value = false;
cartStore.setUserPoints(0);
} else {
+ cartStore.fullReductionActivities = fullReductionActivities;
if (back_discountActivity) {
calcDiscountActivity();
}
@@ -795,6 +796,9 @@
}
console.log("当前满减门槛", discountActivity.value);
}
+
+
+ let fullReductionActivities=[]
async function getDiscountActivity() {
const res = await discountActivityApi.config({
shopId: uni.cache.get("shopId"),
@@ -804,6 +808,7 @@
}
discountActivityRes.value = res;
cartStore.fullReductionActivities = [res];
+ fullReductionActivities=[res];
calcDiscountActivity();
}
diff --git a/pages/order/index.vue b/pages/order/index.vue
index 3ca464d..6972cb1 100644
--- a/pages/order/index.vue
+++ b/pages/order/index.vue
@@ -85,7 +85,7 @@