Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

Kirin 2 lat temu
rodzic
commit
f8fa5679e9
1 zmienionych plików z 34 dodań i 20 usunięć
  1. 34 20
      app/admin/view/store/placeorder/index.php

+ 34 - 20
app/admin/view/store/placeorder/index.php

@@ -180,7 +180,7 @@
 												{{ls.price}}
 											</i-Col>
 											<i-Col span="4" class="text-cente">
-												{{(ls.price*ls.num).toFixed(2)}}
+												{{domNum(ls.price*ls.num)}}
 											</i-Col>
 											<i-Col span="4" class="text-cente">
 												{{+ls.is_consumer==0?'普通商品':'消费券商品'}}
@@ -250,7 +250,7 @@
 						return {
 							form: {
 								store_id: '{eq name="type" value="1"}{$store.0.id}{/eq}', //商家id
-								pay_type: 'weixin' //支付类型
+								pay_type: 'offline' //支付类型
 							},
 							shopList: [], //当前选中的商品
 							userCardInput: '', //用户输入内容
@@ -280,10 +280,16 @@
 						}
 					},
 					methods: {
+						// 向下取整舍弃数
+						domNum: function(value) {
+							return Math.floor(value*100)/100
+						},
 						// 修复订单
 						async orderContrast() {
 							// 开始处理数据
-							const ind = layer.load(2)
+							const ind = layer.load(1,{
+								shade: 0.1
+							})
 							const that = this;
 							const userCart = (await $eb.axios.get('{:Url("lst")}' + '?uid=' + that.userId))
 								.data.data.valid; //线上购物车商品
@@ -310,10 +316,13 @@
 						//选中用户卡号
 						checkedUserCard(e) {
 							const that = this;
-							layer.msg('加载中请稍等。。。', {
-							  icon: 16
-							  ,shade: 0.01
-							});
+							// layer.msg('加载中请稍等。。。', {
+							//   icon: 16
+							//   ,shade: 0.01
+							// });
+							layer.load(1,{
+								shade: 0.1
+							})
 							if (that.userCardInput.length == 12 || that.userCardInput.length == 15 || that
 								.userCardInput.length == 8 || that.userCardInput.length == 11 || that
 								.userCardInput == '1') {
@@ -331,17 +340,18 @@
 											that.userData = data.data.user
 											that.delCartAll()
 										} else {
+											layer.closeAll('loading');
 											layer.msg(data.msg, {
 												icon: 5
 											});
-
 										}
-
 									}).catch(function(err) {
-									console.log(err);
-								})
+										layer.closeAll('loading');
+										console.log(err);
+									})
 								//设置获取焦点
 							} else {
+								layer.closeAll('loading');
 								layer.msg('请输入8位,12位,17位卡号会员卡号,或输入1', {
 									icon: 5
 								});
@@ -441,14 +451,16 @@
 								return
 							}
 							that.lodingAddCart = true;
-							await that.isShopNum().then(() => {
-								that.lodingAddCart = false;
-							}).catch(() => {
-								that.lodingAddCart = false;
+							layer.load(1,{
+								shade: 0.1
 							})
+							await that.isShopNum();
+							that.lodingAddCart = false;
+							layer.closeAll('loading');
 							// 处理设置允许获得焦点
 							that.$nextTick(function() {
 								that.$refs.code.focus();
+								console.log('成功');
 							})
 						},
 						//查询商品是否有库存
@@ -619,20 +631,21 @@
 							for (let i = 0; i < that.shopList.length; i++) {
 								pusharr.push(that.shopList[i].cartId);
 							}
+							layer.load(1,{
+								shade: 0.1
+							})
 							//提交订单
 							try {
-
 								//提交数据
 								let pushData = {
 									cartId: pusharr.join(','),
 									uid: that.userId
 								}
-
 								let res = await $eb.axios.post('{:Url("confirm")}', pushData);
 								confirmData = res.data
 								const orderKey = res.data.data.orderKey;
 								let money = await that.computedOrder(orderKey);
-								
+								layer.closeAll('loading');
 								layer.confirm('订单总金额:¥' + that.allPayMoney.toFixed(2) + '<br/> vip优惠:¥' + ((
 										that.allPayMoney - money.pay_price) > 0 ? (
 										that.allPayMoney - money.pay_price).toFixed(
@@ -681,14 +694,15 @@
 											console.log('对比');
 											that.orderContrast();
 										},
-										btn3: function(index) {
-											console.log('对比');
+										btn4: function(index) {
+											console.log('对比2');
 											layer.close(index);
 											layer.alert(`错误返回数据${JSON.stringify(confirmData)}`, {icon: 0});
 										},
 									});
 								console.log(money, '金额计算');
 							} catch (e) {
+								layer.closeAll('loading');
 								layer.msg(e.message, {
 									icon: 5
 								});