Commit c8f6faad authored by xieyishang's avatar xieyishang

addxx

parent d80bb73d
......@@ -51,23 +51,28 @@
</view>
</view>
<view class="cleelable flex ali-c">
<view v-show="seckill_close==1" class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 秒杀价</view>
<view class="inputbox flex1">
<input class="input" type="number" value="" v-model="item.seckill_price" placeholder="请输入秒杀价" ></input>
<input class="input" type="digit" value="" v-model="item.seckill_price" placeholder="请输入秒杀价" ></input>
</view>
</view>
<view class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 拼团价</view>
<view class="inputbox flex1">
<input class="input" type="number" value="" v-model="item.pt_price" placeholder="请输入秒杀价" ></input>
<input class="input" type="digit" value="" v-model="item.pt_price" placeholder="请输入秒杀价" ></input>
</view>
</view>
<view class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 会员价</view>
<view class="inputbox flex1">
<input class="input" type="digit" value="" v-model="item.min_price" placeholder="请输入会员价" ></input>
</view>
</view>
<view v-show="seckill_close==1" class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 限购数量</view>
<view class="inputbox flex1">
<input class="input" type="number" value="" v-model="item.limit_num" placeholder="请输入限购数量" @input="isInt"></input>
......@@ -76,7 +81,7 @@
</view>
<view class="cleelable flex ali-c">
<view class="names"><text class="bitian">*</text> 秒杀库存</view>
<view class="names"><text class="bitian">*</text> 库存</view>
<view class="inputbox flex1">
<input class="input" type="number" v-model="item.store_count" value="" placeholder="请输入库存" @input="isInt" ></input>
</view>
......@@ -165,7 +170,10 @@
// {name:"名称",child:[{name:"选中的名称",id:0}]},//第一个里面的选中的
// {name:"名称",child:[{name:"选中的名称",id:0}]},//第一个里面的选中的
],//勾选的数据
endobjdata:[],//最后的end 是组装出来的数据
endobjdata:[],//最后的end 是组装出来的数据
//秒杀相关的开关
seckill_close:0,//0关闭 1打开
};
},
computed:{
......@@ -191,7 +199,7 @@
isInt(e){
console.log(e)
if(!this.isInteger(e.detail.value)){
this.$api.msg("秒杀库存或限购数量不能为小数!!");
this.$api.msg("库存或限购数量不能为小数!!");
}
},
......@@ -262,7 +270,7 @@
// store_count:'',
console.log(this.endobjdata)
isbool = this.endobjdata.every((item,index)=>{
return item.price!="" && item.store_count!="" && item.limit_num!="" && item.seckill_price !="" && item.pt_price!="";
return item.price!="" && item.store_count!="" && item.limit_num!="" && item.seckill_price !="" && item.pt_price!="" && item.min_price!="";
})
if(!isbool){
......@@ -275,17 +283,34 @@
return false;
}
if(this.endobjdata[0].activity_price==""||this.endobjdata[0].store_count==""||this.endobjdata[0].limit_num==""){
this.$api.msg("请填写完整秒杀数据");
return false;
if(this.seckill_close==1){
if(this.endobjdata[0].activity_price==""||this.endobjdata[0].store_count==""||this.endobjdata[0].limit_num==""){
this.$api.msg("请填写完整秒杀数据");
return false;
}
}
if(!this.isInteger(this.endobjdata[0].limit_num) || !this.isInteger(this.endobjdata[0].store_count)){
this.$api.msg("秒杀库存或限购数量不能为小数!");
//限购数量
if(!this.endobjdata[0].limit_num && this.seckill_close==1 ){
this.$api.msg("限购数量不能为小数!");
return false;
}
//库存
if(!this.endobjdata[0].store_count ){
this.$api.msg("库存不能为小数!");
return false;
}
//关闭秒杀的时候 秒杀价就是售价
if(this.seckill_close==0){
this.endobjdata = this.endobjdata.map((item,index)=>{
item.seckill_price = item.price;
item.limit_num = 1;
return item;
})
}
addEditProductSpec({
......@@ -319,7 +344,8 @@
console.log(res,"goodsSpec")
if(res.code==0){
if(res.code==0){
this.seckill_close = res.data.seckill_close;//秒杀的填写项的开关
this.goodsSpec_goodsType = res.data.goodsType;
this.goodsSpec_info = res.data.info;
if(res.data.info!=null){
......@@ -469,7 +495,7 @@
if(sarrobj[0].length!=0){
let endobjdata = sarrobj.map((item,index)=>{
// sarr[index].replace(/,/g,'_')
let objsdata = {key_name:sarr[index].join(" "),spec_id:sarrobjtwo[index].join("_"),key:sarrobj[index].join("_"),price:"",store_count:"",sku:"",spec_img:"",cost_price:"",pt_price:""};
let objsdata = {key_name:sarr[index].join(" "),spec_id:sarrobjtwo[index].join("_"),key:sarrobj[index].join("_"),price:"",store_count:"",sku:"",spec_img:"",cost_price:"",pt_price:"",min_price:""};
return objsdata;
})
......
......@@ -5,8 +5,8 @@ module.exports = {
isdebug:false,//正式
// isdebug:true,//测试
// isdebug:false,//正式
isdebug:true,//测试
// xqdebug:false,//正式权限
xqdebug:true,//发布审核权限 也是测试环境的 主要用于ios
......
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 to comment