Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
eca0314
"appid": "wxa4bc935c9ba87528",: "9kuai8coffee.asia", // 固定值
TOD-nights Mar 5, 2025
fc71c78
Add vip price
dejavuwl Mar 12, 2025
838ded4
Merge pull request #1 from dejavuwl/master
TOD-nights Mar 12, 2025
ae82bbd
008
TOD-nights Mar 12, 2025
9d37b83
fix price show 0
dejavuwl Mar 13, 2025
15d9f78
Merge pull request #2 from dejavuwl/master
TOD-nights Mar 13, 2025
ca3befa
1
TOD-nights Mar 13, 2025
5966545
coupon
TOD-nights Mar 14, 2025
ad9177f
print
TOD-nights Mar 14, 2025
f19556d
Merge pull request #3 from TOD-nights/print
TOD-nights Mar 14, 2025
6b2a7c7
printer weilai
TOD-nights Mar 19, 2025
e30f6fd
labe
TOD-nights Mar 20, 2025
ab6606b
其他
TOD-nights Mar 20, 2025
db782ba
Update index.wxml
TOD-nights Mar 20, 2025
2553d40
pay.js
TOD-nights Mar 21, 2025
17f5a23
添加电话和数量
TOD-nights Mar 21, 2025
7edddec
Merge branch 'master' into print
TOD-nights Mar 21, 2025
10de0f5
Merge pull request #4 from TOD-nights/print
TOD-nights Mar 21, 2025
b666eac
sn = '742N30GDRND8E4A'
TOD-nights Mar 21, 2025
551ae66
打印小票添加用户电话、用户地址、订单号等信息
zhanziqiang2008 Mar 21, 2025
4947e4b
Merge branch 'print' of https://github.com/TOD-nights/bee into print
TOD-nights Mar 21, 2025
4663271
Merge branch 'print' of https://github.com/TOD-nights/bee into print
TOD-nights Mar 21, 2025
b65b027
Merge pull request #5 from TOD-nights/print
TOD-nights Mar 21, 2025
62ef353
Update pay.js
TOD-nights Mar 21, 2025
9502158
revert
TOD-nights Mar 21, 2025
a1b7495
sn = '742N30GDRND8E4A'
TOD-nights Mar 21, 2025
b02fd1e
revert li
TOD-nights Mar 21, 2025
20ac91d
Revert "revert"
TOD-nights Mar 21, 2025
e81a458
回退数量
TOD-nights Mar 21, 2025
15a91dc
打印方法统一到util.js订单支付失败打印也做了处理
zhanziqiang2008 Mar 22, 2025
ea67fae
打印方法统一到util.js订单支付失败打印也做了处理
zhanziqiang2008 Mar 22, 2025
fdbdc64
订单支付失败打印修改
zhanziqiang2008 Mar 22, 2025
cdbf5a9
Merge branch 'master' into print
zhanziqiang2008 Mar 24, 2025
387b281
打印最终测试无误(未来社区,现金、余额、重新支付测试)
zhanziqiang2008 Mar 24, 2025
7590a58
三种打印,有的手机没法支付问题!
zhanziqiang2008 Mar 25, 2025
2c24b68
三种打印,有的手机没法支付问题!地址判空
zhanziqiang2008 Mar 25, 2025
aae72c7
!1 三种打印,有的手机没法支付问题!地址判空
TOD-nights Mar 25, 2025
22bb42a
修改外卖配送方式参数,限制外卖无地址提交 #7
TOD-nights Mar 26, 2025
367e246
pszq
TOD-nights Mar 26, 2025
4eba784
pszq
TOD-nights Mar 27, 2025
c3dc143
修复缺地址无法下单自取
TOD-nights Mar 29, 2025
3183708
塘下
TOD-nights Apr 2, 2025
3332ef8
瑞安
TOD-nights Apr 2, 2025
19af95c
// 按距离排序
TOD-nights Apr 2, 2025
575626d
feat:coupons fetch/use/rollback
dejavuwl Apr 1, 2025
46daedc
!2 feat:coupons fetch/use/rollback
TOD-nights Apr 2, 2025
08f5e4b
!3 // 按距离排序
TOD-nights Apr 2, 2025
0af3349
!4 !3 // 按距离排序
TOD-nights Apr 2, 2025
92b0199
门店充值
zhuotianxiao Apr 3, 2025
8d4739f
用户关闭定位时的处理逻辑
TOD-nights Apr 4, 2025
e43e543
余额支付修改
zhuotianxiao Apr 8, 2025
6c72067
Update config.js
TOD-nights Apr 10, 2025
5f4785b
fix coupons discount display
dejavuwl Apr 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added ._config.js
Binary file not shown.
Binary file added ._project.config.json
Binary file not shown.
Binary file added ._project.private.config.json
Binary file not shown.
7 changes: 1 addition & 6 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@
"selectedIconPath": "images/nav/index-on.png",
"text": "点餐"
},
{
"pagePath": "pages/queue/index",
"iconPath": "images/nav/qh-off.png",
"selectedIconPath": "images/nav/qh-on.png",
"text": "取号"
},

{
"pagePath": "pages/order-details/doing",
"iconPath": "images/nav/qc-off.png",
Expand Down
13 changes: 9 additions & 4 deletions config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
module.exports = {
apiHost: 'http://127.0.0.1:18083',
apiHost: 'https://9kuai8coffee.asia',
//apiHost: 'http://localhost:8081',
// apiHost: 'https://api.it120.cc',//api工厂的值
subDomain: "cocktailBeeOrder", // 固定值
version: "6.1.1",
note: '已点菜品,合计按钮显示不正确',
subDomain: "9kuai8coffee.asia", // 固定值


version: "20.1.2",

note: '标签机 会员价 ',

merchantId: 27, // 商户ID,可在后台工厂设置-->商户信息查看
customerServiceType: 'QW' // 客服类型,QW为企业微信,需要在后台系统参数配置企业ID和客服URL,否则为小程序的默认客服
}
12 changes: 3 additions & 9 deletions i18n/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,18 @@ function setTabBarLanguage(){
text: $t.index.order
})

wx.setTabBarItem({
index: 1,
pagePath: "pages/queue/index",
iconPath: "images/nav/qh-off.png",
selectedIconPath: "images/nav/qh-on.png",
text: $t.queue.t
})


wx.setTabBarItem({
index: 2,
index: 1,
pagePath: "pages/order-details/doing",
iconPath: "images/nav/qc-off.png",
selectedIconPath: "images/nav/qc-on.png",
text: $t.index.PickingUp
})

wx.setTabBarItem({
index: 3,
index: 2,
pagePath: "pages/my/index",
iconPath: "images/nav/my-off.png",
selectedIconPath: "images/nav/my-on.png",
Expand Down
4 changes: 2 additions & 2 deletions i18n/zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ module.exports = {
title: '会员',
consumption: '累计消费',
notVIP: '非会员',
tip: '消费达到金额可自动成为会员',
tip: '余额达到100可自动成为会员 余额少于9.8失去会员资格,重新充值100元以上恢复会员资格',
growth: '会员成长体系',
growthName: '级别名称',
growthDiscount: '购物折扣',
growthConsumption: '消费标准(元)',
profile: '注:当购物消费达指定标准自动成为该级别会员',
profile: '注:',
},
feedback: {
title: '意见反馈',
Expand Down
Binary file modified images/coupon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added miniprogram_npm/._.DS_Store
Binary file not shown.
Binary file added miniprogram_npm/apifm-wxapi/._index.js
Binary file not shown.
6 changes: 6 additions & 0 deletions miniprogram_npm/apifm-wxapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,12 @@ module.exports = {
token: token
});
},
balance_pay: function balance_pay(token, orderId) {
return request('/order/balance_pay', true, 'post', {
orderId: orderId,
token: token
});
},
orderPayV2: function orderPayV2(data) {
return request('/order/pay', true, 'post', data);
},
Expand Down
232 changes: 229 additions & 3 deletions pages/all-orders/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ const wxpay = require('../../utils/pay.js')
const WXAPI = require('apifm-wxapi')
const AUTH = require('../../utils/auth')
const APP = getApp()
var util = require('../../utils/util.js')
APP.configLoadOK = () => {

}
Page({
data: {
apiOk: false
apiOk: false,
dataP:''
},
cancelOrderTap: function(e) {
const that = this;
Expand Down Expand Up @@ -89,14 +91,48 @@ Page({
},
_toPayTap: function (orderId, money){
const _this = this
// console.log(orderId)
// console.log(wx.getStorageSync(orderId))
//未支付的现金订单,从本地缓存中获取订单信息
_this.data.dataP = ''
try{
_this.data.dataP = wx.getStorageSync(orderId +"O")
console.log("缓存中取出的打印数据:", _this.data.dataP)
}
catch(e){
console.log("缓存中取出的打印数据报错:",e)
}

if (money <= 0) {
// 直接使用余额支付
WXAPI.orderPay(wx.getStorageSync('token'), orderId).then(function (res) {
console.log("余额支付:",r)
if(r.code==700 &&_this.data.dataP){
//打印的数据
if(_this.data.dataP && _this.data.dataP ===true){

//小票
that.print2(_this.data.dataP)
//标签
that.print(_this.data.dataP)
}

}
_this.onShow();
})
} else {
wxpay.wxpay('order', money, orderId, "/pages/all-orders/index");
}
//缓存中有打印信息
if(_this.data.dataP){
wxpay.wxpay('order', money, orderId, "/pages/all-orders/index",_this.data.dataP);

}//缓存中无打印信息
else{
wxpay.wxpay('order', money, orderId, "/pages/all-orders/index");
}



}
},
onLoad: function(options) {
getApp().initLanguage(this)
Expand Down Expand Up @@ -201,4 +237,194 @@ Page({
phoneNumber: res.data.info.linkPhone,
})
},
//打印标签,参数为支付返回的data数据
print(data){
var that = this
//芯烨云打印接口
let url = 'https://open.xpyun.net/api/openapi/xprinter/printLabel'
//开发者密钥
let userKey = 'b2e9014204774a058bc7e8640e36e8ed'
//开发者id xu1271669848@gmail.com
let userId = 'xu1271669848@gmail.com'
let timstamp = Math.trunc(new Date().getTime()/1000) + ""
let sign = userId + userKey + timstamp
//打印机序列号,店铺id对应打印机序列号
let sn = ''
//紫金店
if(data.shopInfo.id==2){
sn = '32817SCU1VAF54B'

}//未来店
else if (data.shopInfo.id==1){
sn = '32EL21088705948'
}
//塘下店
else if (data.shopInfo.id==4){
sn = '325Z1VC2ANA044B'
}
//瑞安店
else if (data.shopInfo.id==3){
sn = '32EVUCUVY0B4848'
}




//如果没有打印机,则返回
if(!sn){
return
}
//当前日期 时分秒
let timeStr = that.getDate()
let content = ''

for(let i=0;i<data.goodsList.length;i++){
for(let k=0;k<data.goodsList[i].number;k++){
content+= '<PAGE><SIZE>40,30</SIZE>' +
'<TEXT x="8" y="0" w="1" h="1" r="0"># '+(i+1) +'/' + data.goodsList.length + ' 总金额:'+data.data.amountReal + '</TEXT>'+
'<TEXT x="8" y="24" w="1" h="1" r="0">'+ data.goodsList[i].name +'</TEXT>'
for(let j=0;j<data.goodsList[i].sku.length;j++){
content+='<TEXT x="8" y="' + (j+2)*24 +'" w="1" h="1" r="0">'+ data.goodsList[i].sku[j].optionValueName +'</TEXT>'
}
content+= '<TEXT x="8" y="'+(data.goodsList[i].sku.length+2)*24 +'" w="1" h="1" r="0">'+'单价: ¥'+data.goodsList[i].price + '</TEXT>'+
'<TEXT x="8" y="166" w="1" h="1" r="0">'+ data.data.orderNumber+ '</TEXT>'+
'<TEXT x="8" y="190" w="1" h="1" r="0">'+ timeStr + '</TEXT>'+
'<TEXT x="8" y="214" w="1" h="1" r="0">'+ data.shopInfo.name + '</TEXT>' + '</PAGE>'

}
}


//请求参数
let param = {
user: userId,
timestamp: timstamp,
sign: util.sha1(sign),
sn: sn,
content: content
}
console.log(param)

let header = {
"Content-Type": "application/json;charset=UTF-8"
}

wx.request({
url: url,
data: param,
method: "post",
header:header,
success: res=>{
console.log("标签打印返回:",res)
}


})
},
//打印小票,参数为支付返回的data数据
print2(data){
var that = this

//芯烨云打印接口
let url = 'https://open.xpyun.net/api/openapi/xprinter/print'
//开发者密钥
let userKey = 'b2e9014204774a058bc7e8640e36e8ed'
//开发者id xu1271669848@gmail.com
let userId = 'xu1271669848@gmail.com'
let timstamp = Math.trunc(new Date().getTime()/1000) + ""
let sign = userId + userKey + timstamp
//小票机序列号,店铺id对应小票机序列号
let sn = ''
//紫金店
if(data.shopInfo.id==2){
sn = '74Y4LWMD9R9AF4B'
}
//未来店
else if (data.shopInfo.id==1){
sn = '742N30GDRND8E4A'
}
//塘下店
else if (data.shopInfo.id==4){
sn = '74S8LPEQ3584048'
}
//瑞安店
else if (data.shopInfo.id==3){
sn = '744905VQE26ED4A'
}


//如果没有打印机,则返回
if(!sn){
return
}
//当前日期 时分秒
let timeStr = that.getDate()
let content = '<CB>9.8 COFFEE<BR><BR><BR></CB>' +'<TABLE col="22,3,7" w=1 h=1 b=0 lh=68> '

for(let i=0;i<data.goodsList.length;i++){
content+= '<tr>'+ data.goodsList[i].name +'<td>' + data.goodsList[i].number +'<td>' + data.goodsList[i].price + '元</tr>'
content+='<tr>|'
for(let j=0;j<data.goodsList[i].sku.length;j++){
content+=data.goodsList[i].sku[j].optionValueName + '|'
}
content+='<td> <td> </tr>'
}
content+='</TABLE>'
content+='<R>合计:'+ data.data.amountReal+'元<BR></R><BR>'

content+= '<L>下单时间: '+ timeStr + '<BR>'+
'订单编号: '+ data.data.orderNumber + '<BR>' +
'用户电话: '+ data.mobile + '<BR>'
if(data.peisongType =='pszq'){
content+= '用户地址: '+ data.address + '<BR>'
}
// if(that.data.peisongType=='zq'){
// content+= ' 取单号: '+that.data.curAddressData.address + '<BR>'
// }
content+= '门店名称: ' + data.shopInfo.name +'<BR>'+
'备注: ' + data.remark +'<BR>'
content+= '</L>'


//请求参数
let param = {
user: userId,
timestamp: timstamp,
sign: util.sha1(sign),
sn: sn,
content: content
}
console.log(param)

let header = {
"Content-Type": "application/json;charset=UTF-8"
}

wx.request({
url: url,
data: param,
method: "post",
header:header,
success: res=>{
console.log("小票打印返回:",res)
}


})
},
//获取当前年月日时分秒,打印时间
getDate(){
var now = new Date();
var year = now.getFullYear(); // 年
var month = now.getMonth() + 1; // 月
var day = now.getDate(); // 日
var hour = now.getHours(); // 时
var minute = now.getMinutes(); // 分
var second = now.getSeconds(); // 秒

// 格式化输出
var timeString = year + "-" + (month < 10 ? "0" + month : month) + "-" + (day < 10 ? "0" + day : day) + " " + (hour < 10 ? "0" + hour : hour) + ":" + (minute < 10 ? "0" + minute : minute) + ":" + (second < 10 ? "0" + second : second);
return timeString

}
})
1 change: 1 addition & 0 deletions pages/asset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Page({
const postData = {
token: wx.getStorageSync('token'),
money: money,
shopId: wx.getStorageSync('shopInfo').id,
payName: "在线充值",
remark: "在线充值",
}
Expand Down
2 changes: 1 addition & 1 deletion pages/coupons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Page({
wx.showLoading({
title: '',
})
WXAPI.coupons().then(function (res) {
WXAPI.coupons({token: wx.getStorageSync('token')}).then(function (res) {
wx.hideLoading({
success: (res) => {},
})
Expand Down
Loading