From c001f982b4264122028d6f9d9128b1d6f8bf25cf Mon Sep 17 00:00:00 2001
From: YeMingfei666 <1619116647@qq.com>
Date: Tue, 7 Jul 2026 15:26:08 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=8E=AF=E5=A2=83=E9=93=BE?=
=?UTF-8?q?=E6=8E=A5=E6=9B=BF=E6=8D=A2=EF=BC=8C=E9=83=A8=E5=88=86=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D=EF=BC=8C=E5=A2=9E=E5=8A=A0=E6=89=B9?=
=?UTF-8?q?=E9=87=8F=E9=80=80=E8=8F=9C=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
commons/utils/dict.js | 24 +-
config/appConfig.js | 11 +-
env/env.development.js | 7 +-
http/api/market/coupon.js | 37 ++
http/php/request.ts | 2 +-
pageCreditBuyer/addDebtor.vue | 195 ++++----
pageCreditBuyer/components/number-box.vue | 201 ++++++++
pageCreditBuyer/index.vue | 14 +-
pageMarket/utils/couponUtils.js | 16 +-
.../add-specifications/add-specifications.vue | 4 +-
pageProduct/index/components/control.vue | 57 ++-
pageProduct/index/components/goods.vue | 29 +-
pageProduct/index/index.vue | 138 ++++--
pageUser/index/components/give-coupon.vue | 297 ++++++++++++
pageUser/index/components/user.vue | 8 +-
pageUser/index/index.vue | 24 +-
pageUser/user-coupon/user-coupon.vue | 408 +++++++++++++++++
pages.json | 13 +
pages/appliccation/marketing.vue | 36 +-
pagesCreateOrder/index/index.vue | 109 ++++-
pagesOrder/choose-buyer/choose-buyer.vue | 2 +-
pagesOrder/detail/components/list.vue | 222 +++++----
pagesOrder/detail/components/tuicai.vue | 4 +
pagesOrder/detail/return-dish.vue | 429 ++++++++++++++++++
pagesOrder/index/index.vue | 1 -
pagesOrder/pay-order/pay-order.vue | 12 +-
store/chat.js | 4 +-
utils/couponUtils.js | 16 +-
vite.config.js | 4 +-
29 files changed, 1975 insertions(+), 349 deletions(-)
create mode 100644 http/api/market/coupon.js
create mode 100644 pageCreditBuyer/components/number-box.vue
create mode 100644 pageUser/index/components/give-coupon.vue
create mode 100644 pageUser/user-coupon/user-coupon.vue
create mode 100644 pagesOrder/detail/return-dish.vue
diff --git a/commons/utils/dict.js b/commons/utils/dict.js
index 1a02dc7..e136375 100644
--- a/commons/utils/dict.js
+++ b/commons/utils/dict.js
@@ -3,22 +3,22 @@ export default {
label: "待支付",
type: "unpaid"
},
- {
- label: "制作中",
- type: "in_production"
- },
- {
- label: "待取餐",
- type: "wait_out"
- },
+ // {
+ // label: "制作中",
+ // type: "in_production"
+ // },
+ // {
+ // label: "待取餐",
+ // type: "wait_out"
+ // },
{
label: "订单完成",
type: "done"
},
- {
- label: "申请退单",
- type: "refunding"
- },
+ // {
+ // label: "申请退单",
+ // type: "refunding"
+ // },
{
label: "退单",
type: "refund"
diff --git a/config/appConfig.js b/config/appConfig.js
index f884ef9..bf966b1 100644
--- a/config/appConfig.js
+++ b/config/appConfig.js
@@ -3,13 +3,15 @@ export const ENV = 'test'
export const ENV_BASE_URL = {
java: {
prod: 'https://cashier.sxczgkj.com/',
- test: 'http://192.168.1.42/',
+ // test: 'http://192.168.1.43/',
+ test: 'https://frp.sxczgkj.com/',
h5ProdProxy: '/prodJavaApi/',
h5TestProxy: '/testJavaApi/',
},
php: {
prod: 'https://cashier.sxczgkj.com/',
- test: 'http://192.168.1.42:8787/',
+ // test: 'http://192.168.1.43:8787/',
+ test: 'https://frp.sxczgkj.com:8787/',
h5ProdProxy: '/prodPhpApi/api/',
h5TestProxy: '/testPhpApi/api/',
}
@@ -73,14 +75,15 @@ export function returnBaseUrl(param) {
function returnWss(env) {
// #ifdef H5
if (env === 'test') {
- return 'http://192.168.1.42:2348'
+ return 'http://192.168.1.43:2348'
} else {
return 'https://czgeatws.sxczgkj.com/wss'
}
// #endif
// #ifndef H5
if (env === 'test') {
- return 'ws://192.168.1.42:2348'
+ // return 'ws://192.168.1.43:2348'
+ return 'ws://frp.sxczgkj.com/wss'
} else {
return 'wss://czgeatws.sxczgkj.com/wss'
}
diff --git a/env/env.development.js b/env/env.development.js
index 6dc7bb4..88219bf 100644
--- a/env/env.development.js
+++ b/env/env.development.js
@@ -1,7 +1,8 @@
export default {
- 'JEEPAY_BASE_URL': 'http://192.168.1.42/', // 请求URL(生产环境)
- 'JEEPAY_BASE_URL_H5': 'http://192.168.1.42/',
- 'JEEPAY_BASE_URL_WSS': 'ws://192.168.1.42:2348' ,// sockets
+ 'JEEPAY_BASE_URL': 'http://192.168.1.43/', // 请求URL(生产环境)
+ 'JEEPAY_BASE_URL_H5': 'http://192.168.1.43/',
+ // 'JEEPAY_BASE_URL_WSS': 'ws://192.168.1.43:2348' ,// sockets
+ 'JEEPAY_BASE_URL_WSS': 'ws://frp.sxczgkj.com/wss' ,// sockets
// 'JEEPAY_BASE_URL': 'https://cashier.sxczgkj.com/', // 请求URL(生产环境)
// 'JEEPAY_BASE_URL_H5': 'https://cashier.sxczgkj.com/',
// 'JEEPAY_BASE_URL_WSS': 'wss://czgeatws.sxczgkj.com/wss' // sockets
diff --git a/http/api/market/coupon.js b/http/api/market/coupon.js
new file mode 100644
index 0000000..99c49ab
--- /dev/null
+++ b/http/api/market/coupon.js
@@ -0,0 +1,37 @@
+import http from '@/http/http.js'
+const request = http.request
+const urlType='market/admin/coupon'
+
+export function getRecordByUser(params) {
+ return request({
+ url: `${urlType}/getRecordByUser`,
+ method: "GET",
+ params: {
+ ...params
+ }
+ })
+}
+
+export function deleteRecord(params) {
+ return request({
+ url: `${urlType}/deleteRecord?id=`+params.id,
+ method: "DELETE",
+ })
+}
+
+export function getList(params) {
+ return request({
+ url: `${urlType}/page`,
+ method: "GET",
+ params: {
+ ...params
+ }
+ })
+}
+export function giveCoupon(data) {
+ return request({
+ url: `${urlType}/grant`,
+ method: "POST",
+ data
+ })
+}
\ No newline at end of file
diff --git a/http/php/request.ts b/http/php/request.ts
index b7eec9c..48b28e6 100644
--- a/http/php/request.ts
+++ b/http/php/request.ts
@@ -1,6 +1,6 @@
//服务器接口地址
// const baseURL : string = 'https://newblockwlx.sxczgkj.cn/index.php/api/'
-let baseURL: string = "http://192.168.1.42:8787/api/";
+let baseURL: string = "http://192.168.1.43:8787/api/";
// #ifdef H5
baseURL = "/prodPhpApi/api/";
// #endif
diff --git a/pageCreditBuyer/addDebtor.vue b/pageCreditBuyer/addDebtor.vue
index 5b847ea..826b1fc 100644
--- a/pageCreditBuyer/addDebtor.vue
+++ b/pageCreditBuyer/addDebtor.vue
@@ -1,73 +1,85 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
一经创建无法更改还款方式
-
+
+
+
+
+
+
+
-
+
-
+
-
+
取消
-
+
\ No newline at end of file
diff --git a/pageCreditBuyer/index.vue b/pageCreditBuyer/index.vue
index 88b8a78..7a04a3d 100644
--- a/pageCreditBuyer/index.vue
+++ b/pageCreditBuyer/index.vue
@@ -39,15 +39,23 @@
挂账人:{{item.debtor}}
- 已挂账金额:{{item.owedAmount}}
+ 已挂账金额:
+ {{
+ item.creditAmount - item.accountBalance > 0
+ ? item.creditAmount - item.accountBalance
+ : 0
+ }}
+
挂账额度:{{item.creditAmount}}
- 剩余挂账额度:{{item.remainingAmount}}
+
+ 还款提醒日:{{item.expireRemindDay}}号
账户余额:{{item.accountBalance}}
- 通用门店:{{item.shopName}}
+
+ 还款提醒:{{item.expireRemind}}月前
手机号:{{item.mobile}}
diff --git a/pageMarket/utils/couponUtils.js b/pageMarket/utils/couponUtils.js
index 559a187..aabe176 100644
--- a/pageMarket/utils/couponUtils.js
+++ b/pageMarket/utils/couponUtils.js
@@ -24,14 +24,14 @@ export const emunList = {
label: '消费送券',
value: 5,
},
- {
- label: '固定价格券',
- value: 7,
- },
- {
- label: '免配送费券',
- value: 8,
- }
+ // {
+ // label: '固定价格券',
+ // value: 7,
+ // },
+ // {
+ // label: '免配送费券',
+ // value: 8,
+ // }
],
getType: [{
label: '用户不可自行领取',
diff --git a/pageProduct/add-specifications/add-specifications.vue b/pageProduct/add-specifications/add-specifications.vue
index 7e99f27..e7945b0 100644
--- a/pageProduct/add-specifications/add-specifications.vue
+++ b/pageProduct/add-specifications/add-specifications.vue
@@ -6,7 +6,7 @@
label-position="top" validateTrigger="blur">
+ v-model="specifications.name" placeholder="模版名称,如:主食、就睡、辣度、大小等" />
@@ -17,7 +17,7 @@
+ v-model="item.name" placeholder="规格组名,如:口味、忌口、温度、分量" />
diff --git a/pageProduct/index/components/control.vue b/pageProduct/index/components/control.vue
index 441b87b..9ce9e6d 100644
--- a/pageProduct/index/components/control.vue
+++ b/pageProduct/index/components/control.vue
@@ -1,7 +1,11 @@
+
+
商品添加
+
@@ -19,28 +23,37 @@
default: 30
},
})
-
- let showControl1 = ref(true)
- const emits = defineEmits(['toggleCategory','controlChange','allCheckedChange','offShelf','categoryChange'])
+ let showControl1 = ref(false)
+ const emits = defineEmits(['toggleCategory', 'controlChange', 'allCheckedChange', 'offShelf', 'categoryChange'])
+
+ function allControl() {
+ showControl1.value = true
+ emits('allCheckedChange',showControl1.value)
+ }
+ function allControlCancel(){
+ showControl1.value = false
+ emits('allCheckedChange',showControl1.value)
+ }
function getComputedStyle() {
return {
bottom: props.bottom + 'rpx'
}
}
-
\ No newline at end of file
diff --git a/pageUser/index/components/user.vue b/pageUser/index/components/user.vue
index 4929941..8cb9e97 100644
--- a/pageUser/index/components/user.vue
+++ b/pageUser/index/components/user.vue
@@ -40,7 +40,7 @@
-
+
{{data.couponNum||0}}
优惠券
@@ -81,7 +81,11 @@
default:false
}
})
-
+ function toCoupon(){
+ go.to('PAGES_USER_COUPON',{
+ userId: props.data.id||'',
+ })
+ }
function toOrder(){
go.to('PAGES_ORDER_INDEX',{
userId: props.data.userId||'',
diff --git a/pageUser/index/index.vue b/pageUser/index/index.vue
index 804ed3c..4451b16 100644
--- a/pageUser/index/index.vue
+++ b/pageUser/index/index.vue
@@ -7,9 +7,9 @@
-
+
-
+
@@ -50,6 +50,7 @@
+
@@ -139,12 +140,21 @@
shape="circle">
+
+
+
+
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 3468a6d..8ab1939 100644
--- a/pages.json
+++ b/pages.json
@@ -216,6 +216,13 @@
"navigationBarTitleText": ""
// "navigationBarTitleText" : "新建用户"
}
+ },
+ {
+ "pageId": "PAGES_USER_COUPON",
+ "path": "user-coupon/user-coupon",
+ "style": {
+ "navigationBarTitleText": "优惠券详情"
+ }
}
]
},
@@ -381,6 +388,12 @@
"style": {
"navigationBarTitleText": "券包"
}
+ },
+ {
+ "path": "detail/return-dish",
+ "style": {
+ "navigationBarTitleText": "批量退菜"
+ }
}
]
diff --git a/pages/appliccation/marketing.vue b/pages/appliccation/marketing.vue
index 26f4303..a76086d 100644
--- a/pages/appliccation/marketing.vue
+++ b/pages/appliccation/marketing.vue
@@ -198,24 +198,24 @@ const menuList = ref([
couponType: 6
}
},
- {
- icon: 'gdjkq',
- pageUrl: 'PAGES_EXCHANGE_COUPON',
- title: '固定价格券',
- intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。',
- query: {
- couponType: 7
- }
- },
- {
- icon: 'mfpsq',
- pageUrl: 'PAGES_EXCHANGE_COUPON',
- title: '免配送费券',
- intro: '可设置一张免除订单配送费的券',
- query: {
- couponType: 8
- }
- }
+ // {
+ // icon: 'gdjkq',
+ // pageUrl: 'PAGES_EXCHANGE_COUPON',
+ // title: '固定价格券',
+ // intro: '设置该券后,允许用户以固定价格兑换指定商品,如:设置一个固定价格9.9的券,商品20元,用户使用券后只需要9.9元兑换该商品。',
+ // query: {
+ // couponType: 7
+ // }
+ // },
+ // {
+ // icon: 'mfpsq',
+ // pageUrl: 'PAGES_EXCHANGE_COUPON',
+ // title: '免配送费券',
+ // intro: '可设置一张免除订单配送费的券',
+ // query: {
+ // couponType: 8
+ // }
+ // }
]
}
]);
diff --git a/pagesCreateOrder/index/index.vue b/pagesCreateOrder/index/index.vue
index 65d900d..a1ea4c9 100644
--- a/pagesCreateOrder/index/index.vue
+++ b/pagesCreateOrder/index/index.vue
@@ -1434,28 +1434,95 @@
searchResult.value = returnSearchGoods();
}
- function returnSearchGoods() {
- const newval = searchValue.value;
- let arr = [];
- let goods = [];
- for (let i in data.tabbar) {
- const goodsArr = data.tabbar[i].foods || [];
- for (let k in goodsArr) {
- goods.push({
- ...goodsArr[k],
- index: i,
- goodsIndex: k,
- });
- }
- }
- if (newval == "") {
- arr = goods;
- } else {
- arr = goods.filter((v) => v.name.includes(newval.trim()));
- }
- return arr;
+ // function returnSearchGoods() {
+ // const newval = searchValue.value;
+ // let arr = [];
+ // let goods = [];
+ // for (let i in data.tabbar) {
+ // const goodsArr = data.tabbar[i].foods || [];
+ // for (let k in goodsArr) {
+ // goods.push({
+ // ...goodsArr[k],
+ // index: i,
+ // goodsIndex: k,
+ // });
+ // }
+ // }
+ // if (newval == "") {
+ // arr = goods;
+ // } else {
+ // arr = goods.filter((v) => v.name.includes(newval.trim()));
+ // }
+ // return arr;
+ // }
+
+ // ===========================
+ // 🔥 通用汉字转拼音首字母(无依赖、全汉字支持)
+ // ===========================
+ function getFirstLetter(str) {
+ if (!str) return '';
+ let result = '';
+ for (let i = 0; i < str.length; i++) {
+ const char = str[i];
+ // 核心:利用 localeCompare 排序特性获取拼音首字母(通用、标准、永不失效)
+ const letters = 'abcdefghjklmnopqrstwxyz';
+ let match = '';
+ for (let j = 0; j < letters.length; j++) {
+ const l = letters[j];
+ if (char.localeCompare(l, 'zh-CN') === 0) {
+ match = l;
+ break;
+ }
+ }
+ if (match) {
+ result += match;
+ } else if (/[\u4e00-\u9fa5]/.test(char)) {
+ // 中文处理
+ const charCode = char.charCodeAt(0);
+ if (charCode >= 0x4E00 && charCode <= 0x9FA5) {
+ const index = Math.floor((charCode - 0x4E00) / 0x320);
+ const letter = 'abcdefghjklmnopqrstwxyz'[Math.min(index, 23)];
+ result += letter || '';
+ }
+ } else {
+ // 英文数字符号
+ result += char.toLowerCase();
+ }
+ }
+ return result;
}
-
+
+ // ===========================
+ // 你的搜索函数(直接用)
+ // ===========================
+ function returnSearchGoods() {
+ const newval = searchValue.value;
+ let goods = [];
+
+ for (let i in data.tabbar) {
+ const goodsArr = data.tabbar[i].foods || [];
+ for (let k in goodsArr) {
+ goods.push({
+ ...goodsArr[k],
+ index: i,
+ goodsIndex: k,
+ });
+ }
+ }
+
+ if (!newval.trim()) {
+ return goods;
+ }
+
+ const keyword = newval.trim().toLowerCase();
+ return goods.filter(item => {
+ const name = item.name || '';
+ const pinyin = getFirstLetter(name);
+ console.log(name, '→', pinyin);
+ return name.toLowerCase().includes(keyword) || pinyin.includes(keyword);
+ });
+ }
+
function clearSearch() {
isSearch.value = false;
}
diff --git a/pagesOrder/choose-buyer/choose-buyer.vue b/pagesOrder/choose-buyer/choose-buyer.vue
index d494b7b..1c06e85 100644
--- a/pagesOrder/choose-buyer/choose-buyer.vue
+++ b/pagesOrder/choose-buyer/choose-buyer.vue
@@ -23,7 +23,7 @@
挂账额度:
- {{item.remainingAmount}}
+ {{item.creditAmount}}
账户余额:
diff --git a/pagesOrder/detail/components/list.vue b/pagesOrder/detail/components/list.vue
index a16454f..cde29f1 100644
--- a/pagesOrder/detail/components/list.vue
+++ b/pagesOrder/detail/components/list.vue
@@ -11,10 +11,13 @@
-->
-
- 共
- {{goodsNumber}}
- 份菜品
+
+
+ 共
+ {{goodsNumber}}
+ 份菜品
+
+
第{{ order.placeNum }}次下单
@@ -22,9 +25,11 @@
-
-
-
+
+
+
{{item.name||item.productName||'临时菜'}}
@@ -41,7 +46,8 @@
{{item.name||item.productName}}
-
+
{{item.returnNum}}
-
+
{{item.skuName||''}}
@@ -80,7 +86,9 @@
- ¥{{mathFloorPrice( parseFloat(mathFloorPrice(item.num*item.unitPrice,item)) - (parseFloat(mathFloorPrice(item.returnNum*item.unitPrice,item)) + parseFloat(mathFloorPrice(item.refundNum*item.unitPrice,item))))}}
+
+ ¥{{mathFloorPrice( parseFloat(mathFloorPrice(item.num*item.unitPrice,item)) - (parseFloat(mathFloorPrice(item.returnNum*item.unitPrice,item)) + parseFloat(mathFloorPrice(item.refundNum*item.unitPrice,item))))}}
+
¥{{returnTotalMoney(item)}}
@@ -92,7 +100,9 @@
¥{{returnTotalMoney(item)}}
- ¥{{mathFloorPrice((item.memberPrice?item.num*item.memberPrice:item.num*item.price),item)}}
+
+ ¥{{mathFloorPrice((item.memberPrice?item.num*item.memberPrice:item.num*item.price),item)}}
+
¥{{returnTotalMoney(item)}}
@@ -104,22 +114,23 @@
¥{{returnTotalMoney(item)}}
-
+
X{{item.number||item.num}}
- 出菜时间:{{item.dishOutTime}}
- 上菜时间:{{item.foodServeTime}}
-
+ 出菜时间:{{item.dishOutTime}}
+ 上菜时间:{{item.foodServeTime}}
+
-
+
-
+
-
+
退菜
@@ -128,7 +139,7 @@
-
+
@@ -171,7 +182,7 @@
-
+
退款类型
@@ -205,7 +216,7 @@
-
+
@@ -221,7 +232,7 @@
-
+
重新打印
@@ -280,15 +291,27 @@
\ No newline at end of file
diff --git a/pagesOrder/index/index.vue b/pagesOrder/index/index.vue
index 208bbdb..85c7b7b 100644
--- a/pagesOrder/index/index.vue
+++ b/pagesOrder/index/index.vue
@@ -20,7 +20,6 @@