From 3ad4d7af680a038733cb8e44822ed8309e74b559 Mon Sep 17 00:00:00 2001
From: GaoHao <1210693421@qq.com>
Date: Wed, 16 Oct 2024 09:05:52 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9B=B8=E5=85=B3=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E5=90=8C=E6=AD=A5test?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/js/api.js | 10 +-
framework/1-utils.js | 6 +-
pages/order/order.vue | 77 +-
pages/order_food/components/shoppingCart.vue | 57 +-
.../components/shoppingCartBilling.vue | 19 +-
pages/order_food/order_food - 副本.vue | 2363 -----------------
pages/order_food/order_food.vue | 37 +-
pages/order_food/order_food_search - 副本.vue | 1567 -----------
pages/order_food/order_food_search.vue | 7 +-
pagesOrder/components/orderInfoAfter.vue | 3 +-
pagesOrder/components/orderInfoBefore.vue | 43 +-
pagesOrder/components/paymentMethod.vue | 17 +-
pagesOrder/confirm_order/index.vue | 123 +-
pagesOrder/orderAMeal/index.vue | 4 +-
pagesOrder/order_detail/index - 副本.vue | 559 ----
pagesOrder/order_detail/index.vue | 149 +-
16 files changed, 363 insertions(+), 4678 deletions(-)
delete mode 100644 pages/order_food/order_food - 副本.vue
delete mode 100644 pages/order_food/order_food_search - 副本.vue
delete mode 100644 pagesOrder/order_detail/index - 副本.vue
diff --git a/common/js/api.js b/common/js/api.js
index 88ca514..2236663 100644
--- a/common/js/api.js
+++ b/common/js/api.js
@@ -16,7 +16,9 @@ export default {
getPopUpAd(data) {
return uni.api.get("/tbShopAd/list", data,false);
},
-
+ logincreateCardNo(data) { //获取会员码
+ return uni.api.get("/login/createCardNo", data);
+ },
productqueryShop(data) { //通过桌码获取店铺信息
return uni.api.get("/product/queryShop", data);
},
@@ -56,9 +58,13 @@ export default {
accountPay(data) {
return uni.api.get("/pay/accountPay", data);
},
- payorderPay(data) { //订单支付
+ orderPay(data) { //订单支付
return uni.api.post("/pay/orderPay", data);
},
+ cancelOrderPay(data) { //订单支付
+ return uni.api.post("/notify/cancel", data);
+ },
+
paymodfiyOrderInfo(data) { //查询订单支付状态
return uni.api.post("/pay/modfiyOrderInfo", data);
},
diff --git a/framework/1-utils.js b/framework/1-utils.js
index 401a726..fc02306 100644
--- a/framework/1-utils.js
+++ b/framework/1-utils.js
@@ -293,6 +293,9 @@ const getUserInfo = function (successCallback, failCallback) {
// #endif
}
+const payment = function () {
+
+}
uni.utils = {
md5,
@@ -311,5 +314,6 @@ uni.utils = {
getCurrentPage,
getCurrentRoute,
pluschooseImage,
- getUserInfo
+ getUserInfo,
+ payment
}
\ No newline at end of file
diff --git a/pages/order/order.vue b/pages/order/order.vue
index c2321f4..62e2127 100644
--- a/pages/order/order.vue
+++ b/pages/order/order.vue
@@ -314,7 +314,7 @@
* 立即付款
*/
async showpopupclick(item) {
- let res = await this.api.payorderPay({
+ let res = await this.api.orderPay({
orderId: item.id,
// #ifdef MP-WEIXIN
payType: 'wechatPay',
@@ -328,8 +328,8 @@
title: '加载中',
mask: true
})
- // #ifdef MP-WEIXIN
uni.requestPayment({
+ // #ifdef MP-WEIXIN
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
@@ -337,60 +337,55 @@
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
+ // #endif
+ // #ifdef MP-ALIPAY
+ provider: 'alipay', //支付类型-固定值
+ orderInfo: res.data.tradeNo, // 微信支付商户号
+ // #endif
success: (res) => {
+ let _this = this
uni.showToast({
title: "支付成功"
})
- setTimeout(res => {
- uni.hideLoading()
- uni.switchTab({
- url: '/pages/order/order'
- });
- }, 500)
- this.paymodfiyOrderInfo()
+ // #ifdef MP-WEIXIN
+ uni.requestSubscribeMessage({
+ tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
+ complete() {
+ // uni.cache.set('shopUser', '') //删除shopUser
+ setTimeout(res => {
+ uni.hideLoading()
+ uni.switchTab({
+ url: '/pages/order/order'
+ });
+ }, 500)
+ _this.paymodfiyOrderInfo()
+ },
+ })
+ // #endif
+
+ // #ifdef MP-ALIPAY
+ _this.paymodfiyOrderInfo()
+ uni.switchTab({
+ url: '/pages/order/order'
+ });
+ // #endif
},
- fail: (err) => {
+ fail: async(err) => {
+ let res = await this.api.cancelOrderPay({
+ orderId: item.id,
+ }) //判断是否支付成功
uni.showToast({
icon: 'none',
title: '支付失败'
})
setTimeout(res => {
uni.hideLoading()
- uni.switchTab({
- url: '/pages/order/order'
- });
+
}, 500)
}
});
- // #endif
- // #ifdef MP-ALIPAY
- uni.requestPayment({
- provider: 'alipay', //支付类型-固定值
- orderInfo: res.data.tradeNo, // 微信支付商户号
- success: (res) => {
- let _this = this
- // uni.requestSubscribeMessage({
- // tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
- // complete() {
- // uni.showToast({
- // title: "支付成功"
- // })
- // // uni.cache.set('shopUser', '') //删除shopUser
-
- // },
- // })
- _this.paymodfiyOrderInfo()
- uni.redirectTo({
- url: '/pagesOrder/order_detail/index?orderId=' + _this
- .listinfoid
- });
- },
- fail: () => {
- uni.hideLoading()
- }
- });
- // #endif
+
}
},
/**
diff --git a/pages/order_food/components/shoppingCart.vue b/pages/order_food/components/shoppingCart.vue
index 50f9ffd..6e0db47 100644
--- a/pages/order_food/components/shoppingCart.vue
+++ b/pages/order_food/components/shoppingCart.vue
@@ -40,7 +40,7 @@
-
@@ -60,31 +60,53 @@
-
-
\ No newline at end of file
diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue
index 9210489..4a776ca 100644
--- a/pages/order_food/order_food.vue
+++ b/pages/order_food/order_food.vue
@@ -208,10 +208,10 @@
-
+
-
+
已下单菜品
@@ -372,9 +372,8 @@
scrollxleft: true,
forceUpdate: false,
shopExtend: null,
- shopId: null,
- tableCode: null,
- dinersNum: null,
+ shopId: "",
+ tableCode: "",
}
},
onPageScroll(e) {
@@ -414,10 +413,8 @@
if ( e.tableCode ) {
this.tableCode = e.tableCode
}
- if ( e.dinersNum ) {
- this.dinersNum = e.dinersNum;
- }
},
+
onUnload() {
if (this.socketTicket) {
this.socketTicket.Close()
@@ -434,13 +431,21 @@
},
async onShow() {
let _this = this;
- this.orderdetailFlag = true;
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 0
- });
-
- _this.getLocation()
+
+ this.$nextTick(() => {
+ uni.pageScrollTo({
+ scrollTop: 0,
+ duration: 0
+ });
+ if ( this.shopId ) {
+ this.productqueryProduct() //list 数据
+ this.getShopUserInfo() //list 数据
+ this.handlemessage() //监听websocket返回
+ this.getShopExtend();
+ } else {
+ this.getLocation()
+ }
+ });
},
methods: {
/**
@@ -586,7 +591,7 @@
searchStatus (e) {
if ( e == "searchClick" ) {
uni.navigateTo({
- url: `/pages/order_food/order_food_search?tableCode=${this.tableCode}&dinersNum=${this.dinersNum}&shopId=${this.shopId}`
+ url: `/pages/order_food/order_food_search?tableCode=${this.tableCode}&shopId=${this.shopId}`
});
}
},
diff --git a/pages/order_food/order_food_search - 副本.vue b/pages/order_food/order_food_search - 副本.vue
deleted file mode 100644
index 0c5f4a7..0000000
--- a/pages/order_food/order_food_search - 副本.vue
+++ /dev/null
@@ -1,1567 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- TOP{{index1+1}}
-
-
-
- {{ item1.name }}
- 本店回头客第{{index1+1}}名
- {{item1.shortTitle?item1.shortTitle:''}}
- 月售{{item1.stockNumber}}
-
-
-
- ¥{{ item1.lowPrice }}/{{item1.unitSnap}}
-
-
- 非可售时间
- 已售罄
-
-
-
-
- ¥{{ item1.lowPrice }}/{{item1.unitSnap}}
-
-
-
- {{item1.suit}}{{item1.unitSnap}}起点
- {{item1.cartNumber<99?item1.cartNumber:'99+'}}
-
-
-
-
-
-
- 选规格
- {{item1.cartNumber<99?item1.cartNumber:'99+'}}
-
-
-
-
-
-
-
- {{ item1.cartNumber }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{cartLists_count<99?cartLists_count:'99+'}}
-
-
- ¥
- {{cartLists.amount||'0.00'}}
-
-
- 去结算
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.name }}
- {{ item.skuName }}
-
-
-
- ¥
- {{ item.salePrice }}
-
-
-
-
-
-
- {{ item.number }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{specifications.name}}
-
- 本店回头客第{{specifications.indexb+1}}名
- {{specifications.shortTitle?specifications.shortTitle:''}}
-
-
-
- {{item.name}}
-
-
-
- {{item1.name}}
-
- 下架
-
-
- 售罄
-
-
-
-
-
-
-
-
-
- ¥
- {{salePrice}}
- /{{specifications.unitSnap}}
-
-
-
-
-
-
-
- {{amountcartNumber}}
-
-
-
-
-
-
-
- {{skuidname.toString()}}
-
-
- {{skuBtnText}}
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pages/order_food/order_food_search.vue b/pages/order_food/order_food_search.vue
index f1829c9..8e68d57 100644
--- a/pages/order_food/order_food_search.vue
+++ b/pages/order_food/order_food_search.vue
@@ -91,10 +91,10 @@
-
+
-
+
-
+
@@ -317,6 +317,7 @@
font-weight: bold;
font-size: 32rpx;
color: #333333;
+ padding-bottom: 32rpx;
}
.val{
display: flex;
diff --git a/pagesOrder/components/orderInfoBefore.vue b/pagesOrder/components/orderInfoBefore.vue
index 62bd8a3..92396aa 100644
--- a/pagesOrder/components/orderInfoBefore.vue
+++ b/pagesOrder/components/orderInfoBefore.vue
@@ -83,7 +83,14 @@
-
+
+ 餐位费
+
+ X{{listinfo.orderInfo.seatCount}}
+ ¥
+ {{listinfo.orderInfo.seatAmount}}
+
+
合计:
¥{{listinfo.payAmount}}
@@ -330,12 +337,44 @@
}
}
}
+ .cell-item{
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 32rpx 0;
+ .label{
+ font-weight: bold;
+ font-size: 28rpx;
+ color: #333333;
+ padding-bottom: 32rpx;
+ }
+ .val{
+ display: flex;
+ align-items: flex-end;
+ padding-bottom: 32rpx;
+ border-bottom: 2rpx dashed #e5e5e5;
+ view:nth-child(1){
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #999999;
+ margin-right: 42rpx;
+ }
+ view:nth-child(2){
+ display: flex;
+ align-items: flex-end;
+ font-weight: bold;
+ font-size: 36rpx;
+ color: #333333;
+ }
+ }
+ }
.total-wrap {
width: 100%;
display: flex;
justify-content: space-between;
- font-weight: 500;
+ font-weight: bold;
font-size: 28rpx;
+ color: #333;
.price{
font-weight: bold;
font-size: 32rpx;
diff --git a/pagesOrder/components/paymentMethod.vue b/pagesOrder/components/paymentMethod.vue
index 702efae..ca35a7a 100644
--- a/pagesOrder/components/paymentMethod.vue
+++ b/pagesOrder/components/paymentMethod.vue
@@ -6,7 +6,7 @@
-
+
@@ -44,6 +44,11 @@
{ name: "支付宝支付", type: 3, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
// #endif
],
+ paymentMethodName:[
+ { name: "余额支付", type: 1, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"},
+ { name: "微信支付", type: 2, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"},
+ { name: "支付宝支付", type: 3, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"},
+ ],
radiovalue: 1, // 支付方式
ispws: false, // 输入支付密码
storeInfo: {},
@@ -52,7 +57,7 @@
props:{
amountVIP:{
type: Object
- }
+ },
},
mounted() {
console.log(this.amountVIP)
@@ -63,9 +68,11 @@
* 监听支付方式切换
* @param {Object}
*/
- groupChange(type,name) {
+ groupChange(type) {
+ console.log(type)
this.radiovalue = type;
- this.$emit("groupChange",{type:type ,name:name })
+ let name = this.paymentMethodName[type-1].name;
+ this.$emit("groupChange",{type:type ,name: name })
},
@@ -74,7 +81,7 @@
*/
goRecharge() {
uni.pro.navigateTo('/pages/member/index', {
- shopId: this.shopId
+ shopId: uni.cache.get('shopId')
})
},
}
diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue
index 1f49a26..c903705 100644
--- a/pagesOrder/confirm_order/index.vue
+++ b/pagesOrder/confirm_order/index.vue
@@ -55,7 +55,7 @@
桌号:
{{ shopTableInfo.name }}
- {{ dinersNum }}人
+ {{ shopTableInfo.seatNum }}人
@@ -75,7 +75,14 @@
¥{{ item.totalAmount || item.priceAmount || 0}}
-
+
+ 餐位费
+
+ X{{shopTableInfo.seatNum}}
+ ¥
+ {{(shopTableInfo.seatNum*storeInfo.tableFee).toFixed(2)}}
+
+
-
-
- {{listinfo.name}}
- 「桌号:{{listinfo.tableName}}」
-
-
- 待支付
-
-
- 待发货
-
-
- 订单完成
-
-
- 已发
-
-
- 申请退单
-
-
- 退单
-
-
- 已取消
-
-
- 合台
-
-
-
-
-
- 取餐号
- {{listinfo.outNumber}}
-
-
-
-
-
-
-
- 快递
- 外卖
- 自提
- 堂食
-
- 订单详情
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.productName}}
- {{item.productSkuName}}
-
-
-
- ¥{{item.priceAmount}}
- x{{item.num}}
-
-
-
-
-
- 合计:
- ¥{{listinfo.payAmount}}
-
-
-
-
-
-
-
-
-
-
- 实付金额:
-
- ¥{{listinfo.payAmount}}
-
-
-
- 立即付款
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/pagesOrder/order_detail/index.vue b/pagesOrder/order_detail/index.vue
index 777e127..76d0b6a 100644
--- a/pagesOrder/order_detail/index.vue
+++ b/pagesOrder/order_detail/index.vue
@@ -1,5 +1,27 @@
+
+
+
+ 下单成功
+ 已完成
+
+ 下单时间:{{listinfo.createdAt}}
+ 付款时间:{{listinfo.paidTime}}
+
+
+
+
+ 扫码加好友,优惠多多
+ 优惠活动多
+ 充值有好礼
+ 会员享低价
+ 长按保存,微信内扫一扫加好友
+
+
+
+
+
@@ -64,13 +86,12 @@
srcimge: 'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/wx.jpg'
};
},
- async onLoad(e) {
+ onLoad(e) {
console.log(e)
this.orderId = e.orderId
},
onShow() {
this.orderorderInfo()
- this.getAount();
},
onUnload() {
this.ispws = false
@@ -78,6 +99,12 @@
url: '/pages/order/order'
})
},
+ onNavigationBarButtonTap ( e ) {
+ console.log(e)
+ },
+ onBackPress ( e ) {
+ console.log(e)
+ },
methods: {
/**
@@ -85,7 +112,7 @@
*/
async getAount() {
let res = await this.api.shopUserInfo({
- "shopId": uni.cache.get('shopId'),
+ "shopId": this.shopId,
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
@@ -108,10 +135,11 @@
if (res.code == 0) {
this.listinfo = res.data;
this.listinfoid = res.data.orderId;
- uni.cache.set('shopId',res.data.shopId)
+ this.shopId = res.data.shopId;
if (this.listinfo.useType == " ") {
//堂食先付费
}
+ this.getAount();
}
},
@@ -223,7 +251,7 @@
* 微信支付
*/
async wechatPay() {
- let res = await this.api.payorderPay({
+ let res = await this.api.orderPay({
orderId: this.orderId,
// #ifdef MP-WEIXIN
payType: 'wechatPay',
@@ -237,8 +265,8 @@
title: '加载中',
mask: true
})
- // #ifdef MP-WEIXIN
uni.requestPayment({
+ // #ifdef MP-WEIXIN
provider: 'wxpay', //支付类型-固定值
partnerid: res.data.appId, // 微信支付商户号
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
@@ -246,14 +274,21 @@
package: res.data.package, // 固定值
signType: res.data.signType, //固定值
paySign: res.data.paySign, //签名
+ // #endif
+ // #ifdef MP-ALIPAY
+ provider: 'alipay', //支付类型-固定值
+ orderInfo: res.data.tradeNo, // 微信支付商户号
+ // #endif
success: (res) => {
let _this = this
+ uni.showToast({
+ title: "支付成功"
+ })
+ // #ifdef MP-WEIXIN
uni.requestSubscribeMessage({
tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
complete() {
- uni.showToast({
- title: "支付成功"
- })
+
this.paymodfiyOrderInfo()
setTimeout(res => {
uni.hideLoading()
@@ -263,8 +298,19 @@
}, 500)
},
})
+ // #endif
+ // #ifdef MP-ALIPAY
+ _this.paymodfiyOrderInfo()
+ uni.switchTab({
+ url: '/pages/order/order'
+ });
+ // #endif
},
- fail: (err) => {
+ fail: async(err) => {
+
+ let res = await this.api.cancelOrderPay({
+ orderId: this.orderId,
+ }) //判断是否支付成功
uni.showToast({
icon: 'none',
title: '支付失败'
@@ -278,35 +324,7 @@
}
});
- // #endif
- // #ifdef MP-ALIPAY
- uni.requestPayment({
- provider: 'alipay', //支付类型-固定值
- orderInfo: res.data.tradeNo, // 微信支付商户号
-
- success: (res) => {
- let _this = this
- // uni.requestSubscribeMessage({
- // tmplIds: ['z0fUG7-jhSfYCrw6poOvSRzh4_hgnPkm_5C7E5s5bCQ'],
- // complete() {
- // uni.showToast({
- // title: "支付成功"
- // })
- // // uni.cache.set('shopUser', '') //删除shopUser
-
- // },
- // })
- _this.paymodfiyOrderInfo()
- uni.redirectTo({
- url: '/pagesOrder/order_detail/index?orderId=' + _this.listinfoid
- });
- },
- fail: () => {
- uni.hideLoading()
- }
- });
- // #endif
}
},
@@ -347,7 +365,51 @@
.container {
padding: 32rpx 28rpx 224rpx 28rpx;
}
-
+ .headStatus{
+ display: flex;
+ flex-direction: column;
+ margin-bottom: 32rpx;
+ align-items: center;
+ .status{
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: bold;
+ font-size: 36rpx;
+ color: #333333;
+ .statusName{
+ margin-left: 16rpx;
+ }
+ }
+ .time{
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #999999;
+ margin-top: 18rpx;
+ }
+ }
+ .wxQrcode{
+ background: #FFFFFF;
+ border-radius: 18rpx 18rpx 18rpx 18rpx;
+ padding: 32rpx 24rpx;
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #999999;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 32rpx;
+ .left{
+ display: flex;
+ flex-direction: column;
+ }
+ .title{
+ font-weight: bold;
+ font-size: 28rpx;
+ color: #333333;
+ margin-bottom: 16rpx;
+ }
+ }
.card_box{
background-color: #fff;
// box-shadow: 0rpx 8rpx 12rpx 2rpx rgba(87,86,86,0.35);
@@ -700,15 +762,12 @@
}
.fixedview_tow {
- width: 140rpx;
- height: 56rpx;
- line-height: 56rpx;
- text-align: center;
background: #E3AD7F;
- border-radius: 12rpx 12rpx 12rpx 12rpx;
+ border-radius: 36rpx;
font-weight: 400;
- font-size: 28rpx;
+ font-size: 32rpx;
color: #FFFFFF;
+ padding: 14rpx 44rpx;
}
}
}