Browse Source

2022-12-17

cmy 3 years ago
parent
commit
1d6bb2c727
1 changed files with 17 additions and 8 deletions
  1. 17 8
      app/admin/view/store/placeorder/index.php

+ 17 - 8
app/admin/view/store/placeorder/index.php

@@ -310,6 +310,10 @@
 						//选中用户卡号
 						checkedUserCard(e) {
 							const that = this;
+							layer.msg('加载中请稍等。。。', {
+							  icon: 16
+							  ,shade: 0.01
+							});
 							if (that.userCardInput.length == 12 || that.userCardInput.length == 15 || that
 								.userCardInput.length == 8 || that.userCardInput.length == 11 || that
 								.userCardInput == '1') {
@@ -325,12 +329,7 @@
 											that.UserCard = that.userCardInput;
 											that.userId = data.data.uid;
 											that.userData = data.data.user
-											console.log('获取焦点')
-											that.$nextTick(function() {
-												that.$refs.code.focus();
-												// 清空购物车
-												that.delCartAll()
-											})
+											that.delCartAll()
 										} else {
 											layer.msg(data.msg, {
 												icon: 5
@@ -372,12 +371,16 @@
 						// 清空购物车
 						delCartAll() {
 							const that = this;
-							console.log('gouwuche ', that.userId);
 							$eb.axios.post('{:Url("clear_cart")}', {
 								uid: that.userId
 							}).then(function(res) {
+								that.$nextTick(function() {
+									that.$refs.code.focus();
+								})
+								layer.closeAll('loading');
 								console.log(res, '购物车清空成功')
 							}).catch(function(err) {
+								that.delCartAll();
 								console.log(err);
 							})
 						},
@@ -629,12 +632,13 @@
 								confirmData = res.data
 								const orderKey = res.data.data.orderKey;
 								let money = await that.computedOrder(orderKey);
+								
 								layer.confirm('订单总金额:¥' + that.allPayMoney.toFixed(2) + '<br/> vip优惠:¥' + ((
 										that.allPayMoney - money.pay_price) > 0 ? (
 										that.allPayMoney - money.pay_price).toFixed(
 										2) : 0) + '<br/> 实际支付:¥' + money.pay_price
 									.toFixed(2), {
-										btn: ['立即支付', '取消', '修复订单'], //按钮
+										btn: ['立即支付', '取消', '修复订单','查看数据'], //按钮
 										yes: async function(index) {
 											layer.close(index);
 											try {
@@ -677,6 +681,11 @@
 											console.log('对比');
 											that.orderContrast();
 										},
+										btn3: function(index) {
+											console.log('对比');
+											layer.close(index);
+											layer.alert(`错误返回数据${JSON.stringify(confirmData)}`, {icon: 0});
+										},
 									});
 								console.log(money, '金额计算');
 							} catch (e) {