|
@@ -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}',
|
|
|
- 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.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
|
|
|
});
|