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