|
@@ -109,20 +109,22 @@
|
|
|
addGoodToCart(item){
|
|
|
uni.showLoading({
|
|
|
mask: true,
|
|
|
- title: "加入购物车中..."
|
|
|
+ title: "正在加入购物车..."
|
|
|
})
|
|
|
addGoodsToCart(item).then(res => {
|
|
|
if(res.status == 200){
|
|
|
- // 刷新购物车数据
|
|
|
- uni.$emit('getCartList')
|
|
|
// 刷新购物车数量
|
|
|
if(!item.hasCunzai){
|
|
|
this.$store.state.vuex_cartNums = this.$store.state.vuex_cartNums + 1
|
|
|
}
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title:'加入购物车成功'
|
|
|
- })
|
|
|
+ setTimeout(()=>{
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title:'添加成功'
|
|
|
+ })
|
|
|
+ // 刷新购物车数据
|
|
|
+ uni.$emit('getCartList')
|
|
|
+ },100)
|
|
|
}else{
|
|
|
uni.hideLoading()
|
|
|
}
|
|
@@ -137,14 +139,7 @@
|
|
|
// 加入购物车
|
|
|
addCart() {
|
|
|
let item = this.goodContent
|
|
|
- if(this.nums * item.sellGold >= this.goldLimit){
|
|
|
- this.addGoodToCart({goodsNo:item.goodsNo,buyQty:this.nums,hasCunzai:this.hasCunzai(item)})
|
|
|
- }else{
|
|
|
- uni.showToast({
|
|
|
- icon: 'none',
|
|
|
- title: `此商品需满${this.goldLimit}乐豆才能购买`
|
|
|
- })
|
|
|
- }
|
|
|
+ this.addGoodToCart({goodsNo:item.goodsNo,buyQty:this.nums,hasCunzai:this.hasCunzai(item)})
|
|
|
},
|
|
|
// 立即下单
|
|
|
toOrder(){
|