diff --git a/src/pages/exchangecode/commodity/goodedit.js b/src/pages/exchangecode/commodity/goodedit.js index bc055889..e6d46ce6 100644 --- a/src/pages/exchangecode/commodity/goodedit.js +++ b/src/pages/exchangecode/commodity/goodedit.js @@ -212,10 +212,19 @@ componentDidMount() { Notify.error(`商品总库存量不能小于已使用数量`); return; } + + + let urls = _.map(this.state.productpic,(o)=>{ return o.url }) + if(urls.length <= 0) + { + Notify.error(`商品图至少请上传一张`); + return; + } + let formdata = { "product_type": this.state.model.type, "product_name": this.state.model.name, diff --git a/src/pages/exchangecode/product/add.js b/src/pages/exchangecode/product/add.js index e4b287fa..8fbb1e5f 100644 --- a/src/pages/exchangecode/product/add.js +++ b/src/pages/exchangecode/product/add.js @@ -70,12 +70,14 @@ export default class adduserinfo extends React.Component{ let model = this.state.model; model.product_id = model_temp.product_id; model.product_type = model_temp.product_type + model.contract_price = model_temp.contract_price model.official_price = model_temp.official_price model.cost_price = model_temp.cost_price model.quantity = model_temp.quantity model.product_name = model_temp.product_name model.show_url = model_temp.show_url + model.account_type = model_temp.account_type model.detail_url = model_temp.detail_url let defaultPic = [] let arr = [] @@ -196,6 +198,13 @@ export default class adduserinfo extends React.Component{ let urls = _.map(this.state.productpic,(o)=>{ return o.url }) + if(urls.length <= 0) + { + Notify.error(`商品图至少请上传一张`); + return; + } + + console.log("存储的链接",8888) temp[index].describe_url = urls @@ -214,6 +223,13 @@ export default class adduserinfo extends React.Component{ let urls = _.map(this.state.productpic,(o)=>{ return o.url }) + + if(urls.length <= 0) + { + Notify.error(`商品图至少请上传一张`); + return; + } + model.describe_url = urls this.setState({model:model}) diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 513b29ee..83b83a05 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -402,7 +402,6 @@ export default class acclist extends React.Component{ sum += parseInt( o.quantity); }) - console.log("sum",sum) if(sum < this.state.codeInfo.issued) { Notify.error("所选商品库存总数小于发放量") @@ -421,7 +420,6 @@ export default class acclist extends React.Component{ return item.text }) - console.log(rank) let tableData = this.state.distdata; let temp = { @@ -453,6 +451,8 @@ export default class acclist extends React.Component{ }) temp.product = arr; + console.log("dasdas",temp) + if(this.state.rowIndex > -1) { @@ -989,8 +989,8 @@ export default class acclist extends React.Component{ { this.onStyleChange(e)} } value={this.state.model.style} disabled={this.state.isEdit} > 串码 链接 - 二维码 - 白名单 + 二维码 + 白名单 diff --git a/src/pages/plan/key/product/add.js b/src/pages/plan/key/product/add.js index 1170f468..337e3d73 100644 --- a/src/pages/plan/key/product/add.js +++ b/src/pages/plan/key/product/add.js @@ -94,6 +94,11 @@ export default class adduserinfo extends React.Component{ Notify.error(`请上传商品Logo`); return } + if(this.state.model.describe_url.length <= 0) + { + Notify.error(`商品图至少请上传一张`); + return; + } let temp = [] diff --git a/src/pages/plan/product/add.js b/src/pages/plan/product/add.js index cc1261de..bf37bf93 100644 --- a/src/pages/plan/product/add.js +++ b/src/pages/plan/product/add.js @@ -74,6 +74,7 @@ export default class adduserinfo extends React.Component{ model.product_name = model_temp.product_name model.show_url = model_temp.show_url model.detail_url = model_temp.detail_url + model.account_type = model_temp.account_type let defaultPic = [] let arr = [] @@ -210,6 +211,11 @@ export default class adduserinfo extends React.Component{ let urls = _.map(this.state.productpic,(o)=>{ return o.url }) + if(urls.length <= 0) + { + Notify.error(`商品图至少请上传一张`); + return; + } console.log(8888) temp[index].describe_url = urls temp[index].map_product_name = this.state.model.map_product_name @@ -226,6 +232,11 @@ export default class adduserinfo extends React.Component{ let urls = _.map(this.state.productpic,(o)=>{ return o.url }) + if(urls.length <= 0) + { + Notify.error(`商品图至少请上传一张`); + return; + } model.describe_url = urls this.setState({model:model})