Commit 2d810cdf by 施宇

Merge branch 'sy_kc_0115' into Development

# Conflicts:
#	src/views/car/car.vue
#	view/26.js
#	view/51.js
#	view/app.js
#	view/index.html
parents c7303a54 fdfff82a
Showing with 56 additions and 19 deletions
...@@ -81,9 +81,11 @@ ...@@ -81,9 +81,11 @@
</template> </template>
<template v-else> <template v-else>
<p class="mui-col-sm-6 mui-col-xs-6" v-html="itemPrice.purchases+'+'"></p> <p class="mui-col-sm-6 mui-col-xs-6" v-html="itemPrice.purchases+'+'"></p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p> <p class="mui-col-sm-6 mui-col-xs-6 f-red">{{item.ac_type == 6?itemPrice.price_ac:itemPrice.price_c}}</p>
</template> </template>
</template> </template>
<!-- <p class="mui-col-sm-3 mui-col-xs-3"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-4 mui-col-xs-4 f-red">¥{{item.ac_type == 6?itemPrice.price_ac:itemPrice.price_cn}}</p> -->
</div> </div>
</div> </div>
<div class="more-height" v-if="item.tiered&&item.tiered.length>3" <div class="more-height" v-if="item.tiered&&item.tiered.length>3"
...@@ -94,11 +96,11 @@ ...@@ -94,11 +96,11 @@
<div class="mui-col-sm-5 mui-col-xs-5"> <div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num"> <div class="clr add-num">
<div class="mui-numbox edit-input"> <div class="mui-numbox edit-input">
<button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,1)"> <button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,1)">
<i class="icon iconfont icon-jian"></i> <i class="icon iconfont icon-jian"></i>
</button> </button>
<input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode"> <input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode">
<button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,2)"> <button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i> <i class="icon iconfont icon-jia"></i>
</button> </button>
</div> </div>
...@@ -204,11 +206,11 @@ ...@@ -204,11 +206,11 @@
<div class="mui-col-sm-5 mui-col-xs-5"> <div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num"> <div class="clr add-num">
<div class="mui-numbox edit-input"> <div class="mui-numbox edit-input">
<button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,1)"> <button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,1)">
<i class="icon iconfont icon-jian"></i> <i class="icon iconfont icon-jian"></i>
</button> </button>
<input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode"> <input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode">
<button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,2)"> <button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i> <i class="icon iconfont icon-jia"></i>
</button> </button>
</div> </div>
...@@ -353,9 +355,11 @@ ...@@ -353,9 +355,11 @@
</template> </template>
<template v-else> <template v-else>
<p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p> <p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p> <p class="mui-col-sm-6 mui-col-xs-6 f-red">{{item.ac_type == 6?itemPrice.price_ac:itemPrice.price_cn}}</p>
</template> </template>
<!-- <p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">¥{{item.ac_type == 6?itemPrice.price_ac:itemPrice.price_cn}}</p> -->
</div> </div>
</div> </div>
<div class="more-height" v-if="item.tiered&&item.tiered.length>3" <div class="more-height" v-if="item.tiered&&item.tiered.length>3"
...@@ -367,11 +371,11 @@ ...@@ -367,11 +371,11 @@
<div class="mui-col-sm-5 mui-col-xs-5"> <div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num"> <div class="clr add-num">
<div class="mui-numbox edit-input"> <div class="mui-numbox edit-input">
<button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,1)"> <button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,1)">
<i class="icon iconfont icon-jian"></i> <i class="icon iconfont icon-jian"></i>
</button> </button>
<input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode"> <input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode">
<button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,2)"> <button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i> <i class="icon iconfont icon-jia"></i>
</button> </button>
</div> </div>
...@@ -461,8 +465,10 @@ ...@@ -461,8 +465,10 @@
</template> </template>
<template v-else> <template v-else>
<p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p> <p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">{{itemPrice.price_cn}}</p> <p class="mui-col-sm-6 mui-col-xs-6 f-red">{{item.ac_type == 6?itemPrice.price_ac:itemPrice.price_cn}}</p>
</template> </template>
<!-- <p class="mui-col-sm-6 mui-col-xs-6"><font v-html="itemPrice.purchases"></font>+</p>
<p class="mui-col-sm-6 mui-col-xs-6 f-red">¥{{item.ac_type == 6?itemPrice.price_ac:itemPrice.price_cn}}</p> -->
</div> </div>
</div> </div>
<div class="more-height" v-if="item.tiered&&item.tiered.length>3" <div class="more-height" v-if="item.tiered&&item.tiered.length>3"
...@@ -474,11 +480,11 @@ ...@@ -474,11 +480,11 @@
<div class="mui-col-sm-5 mui-col-xs-5"> <div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num"> <div class="clr add-num">
<div class="mui-numbox edit-input"> <div class="mui-numbox edit-input">
<button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,1)"> <button class="mui-btn mui-btn-numbox-minus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,1)">
<i class="icon iconfont icon-jian"></i> <i class="icon iconfont icon-jian"></i>
</button> </button>
<input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode"> <input class="mui-input-numbox valuep" type="number" :id="'test'+item.cart_id" @blur="changeNumber(item.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,3)" :value="item.goods_number | numberCode">
<button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,2)"> <button class="mui-btn mui-btn-numbox-plus " type="button" @click="changeNumber(item.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i> <i class="icon iconfont icon-jia"></i>
</button> </button>
</div> </div>
...@@ -1117,8 +1123,7 @@ ...@@ -1117,8 +1123,7 @@
url_:confirm_ url_:confirm_
}) })
}, },
changeNumber:function(number,mpq,min,stock,cart_id,type){ changeNumber:function(goodType,number,mpq,min,stock,cart_id,type){
var self=this; var self=this;
var num=Util.aggxde(number), var num=Util.aggxde(number),
mpq=Util.aggxde(mpq),//包装数或者倍数 mpq=Util.aggxde(mpq),//包装数或者倍数
...@@ -1151,13 +1156,29 @@ ...@@ -1151,13 +1156,29 @@
}else if(type==2){ }else if(type==2){
//增加 //增加
summitNum=summitNum+mpq; summitNum=summitNum+mpq;
if(summitNum>stock&&self.type==1){ if(summitNum>stock){
if(self.type==1){
summitNum=stock; summitNum=stock;
Toast({ Toast({
message: "购买数量不能大于最大购买数量!", message: "购买数量不能大于最大购买数量!",
duration: 1500 duration: 1500
}); });
return; return;
}else if(self.type == 2){
if(goodType == 6){
self.$toast("想要购买更多,请联系客服");
var inputVal = num||0;
if(inputVal!==0||inputVal!==mpq){
summitNum = Math.floor(stock/mpq)*mpq
}else{
summitNum = inputVal
}
return
}
}
} }
}else{ }else{
//失去焦点改变 //失去焦点改变
...@@ -1173,12 +1194,28 @@ ...@@ -1173,12 +1194,28 @@
document.getElementById('test'+cart_id).value=summitNum; document.getElementById('test'+cart_id).value=summitNum;
return; return;
} }
if(summitNum>stock&&self.type==1){ if(summitNum>stock){
if(self.type==1){
summitNum=stock; summitNum=stock;
Toast({ Toast({
message: "购买数量不能大于最大购买数量!", message: "购买数量不能大于最大购买数量!",
duration: 1500 duration: 1500
}); });
}else if(self.type==2){
console.log(11111)
if(goodType == 6){
self.$toast("想要购买更多,请联系客服");
var inputVal = num||0;
if(inputVal!==0||inputVal!==mpq){
summitNum = Math.floor(stock/mpq)*mpq
}else{
summitNum = inputVal
}
}
console.log(inputVal)
}
document.getElementById('test'+cart_id).value=summitNum; document.getElementById('test'+cart_id).value=summitNum;
return; return;
} }
......
This diff could not be displayed because it is too large.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment