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 67 additions and 30 deletions
......@@ -81,9 +81,11 @@
</template>
<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 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>
<!-- <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 class="more-height" v-if="item.tiered&&item.tiered.length>3"
......@@ -94,11 +96,11 @@
<div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num">
<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>
</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">
<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)">
<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.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i>
</button>
</div>
......@@ -204,11 +206,11 @@
<div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num">
<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>
</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">
<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)">
<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.ac_type,item.goods_number,item.multiple,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i>
</button>
</div>
......@@ -353,9 +355,11 @@
</template>
<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 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>
<!-- <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 class="more-height" v-if="item.tiered&&item.tiered.length>3"
......@@ -367,11 +371,11 @@
<div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num">
<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>
</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">
<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)">
<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.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i>
</button>
</div>
......@@ -461,8 +465,10 @@
</template>
<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 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>
<!-- <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 class="more-height" v-if="item.tiered&&item.tiered.length>3"
......@@ -474,11 +480,11 @@
<div class="mui-col-sm-5 mui-col-xs-5">
<div class="clr add-num">
<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>
</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">
<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)">
<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.ac_type,item.goods_number,item.mpl,item.min_buy,item.stock,item.cart_id,2)">
<i class="icon iconfont icon-jia"></i>
</button>
</div>
......@@ -1117,8 +1123,7 @@
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 num=Util.aggxde(number),
mpq=Util.aggxde(mpq),//包装数或者倍数
......@@ -1151,13 +1156,29 @@
}else if(type==2){
//增加
summitNum=summitNum+mpq;
if(summitNum>stock&&self.type==1){
summitNum=stock;
Toast({
message: "购买数量不能大于最大购买数量!",
duration: 1500
});
return;
if(summitNum>stock){
if(self.type==1){
summitNum=stock;
Toast({
message: "购买数量不能大于最大购买数量!",
duration: 1500
});
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{
//失去焦点改变
......@@ -1173,12 +1194,28 @@
document.getElementById('test'+cart_id).value=summitNum;
return;
}
if(summitNum>stock&&self.type==1){
summitNum=stock;
Toast({
message: "购买数量不能大于最大购买数量!",
duration: 1500
});
if(summitNum>stock){
if(self.type==1){
summitNum=stock;
Toast({
message: "购买数量不能大于最大购买数量!",
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;
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