This commit is contained in:
weipengfei 2024-01-26 11:20:18 +08:00
parent 2d88fe3e6a
commit e8a78e457d
4 changed files with 9 additions and 9 deletions

View File

@ -2,8 +2,8 @@
"name" : "惠农商户平台", "name" : "惠农商户平台",
"appid" : "__UNI__1EE148C", "appid" : "__UNI__1EE148C",
"description" : "", "description" : "",
"versionName" : "1.1.3", "versionName" : "1.1.4",
"versionCode" : 113, "versionCode" : 114,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@ -695,7 +695,8 @@
changeSpecType2() { changeSpecType2() {
this.showSpecType = false; this.showSpecType = false;
this.setFormData.spec_type = this.spec_type + ''; this.setFormData.spec_type = this.spec_type + '';
this.setFormData.attrValue = []; if(this.spec_type==0) this.setFormData.attrValue = [{}];
else this.setFormData.attrValue = [];
this.setFormData.attr = []; this.setFormData.attr = [];
}, },
// //

View File

@ -305,7 +305,7 @@
this.showCommodity = true;; this.showCommodity = true;;
this.initData(); this.initData();
this.initClasiffy(); this.initClasiffy();
if (this.import == 1) { if (this.import == 1 ) {
this.getOpenerEventChannel().once('importAttrValue', (e) => { this.getOpenerEventChannel().once('importAttrValue', (e) => {
this.attrValue = e.attrValue; this.attrValue = e.attrValue;
uni.setStorageSync('attrValue', JSON.stringify(e.attrValue)); uni.setStorageSync('attrValue', JSON.stringify(e.attrValue));
@ -697,7 +697,6 @@
} }
Loading(); Loading();
if(this.setFormData.spec_type == 0){ if(this.setFormData.spec_type == 0){
postData.unit_name = '无'
postData.attr = [{ postData.attr = [{
value: '规格', value: '规格',
detail: [] detail: []
@ -710,6 +709,7 @@
}) })
postData.spec_type = 1; //使 postData.spec_type = 1; //使
} }
if(!postData.unit_name&&postData.unit_name!==0&&postData.unit_name!=='0') postData.unit_name = '无';
if(postData.attrValue.length==0)return Toast('请填写规格') if(postData.attrValue.length==0)return Toast('请填写规格')
if (this.product_id) { if (this.product_id) {
productUpdate(this.merId, this.product_id, postData) productUpdate(this.merId, this.product_id, postData)
@ -758,9 +758,8 @@
changeSpecType2() { changeSpecType2() {
this.showSpecType = false; this.showSpecType = false;
this.setFormData.spec_type = this.spec_type + ''; this.setFormData.spec_type = this.spec_type + '';
this.setFormData.attrValue = [ if(this.spec_type==0) this.setFormData.attrValue = [{}];
{} else this.setFormData.attrValue = [];
];
this.setFormData.attr = []; this.setFormData.attr = [];
}, },
// //

View File

@ -158,7 +158,7 @@
this.attrValue = JSON.parse(uni.getStorageSync('attrValue') || '[]'); this.attrValue = JSON.parse(uni.getStorageSync('attrValue') || '[]');
this.attr = JSON.parse(uni.getStorageSync('attr') || '[]'); this.attr = JSON.parse(uni.getStorageSync('attr') || '[]');
this.getOpenerEventChannel().once('updateAttrValue', (e) => { this.getOpenerEventChannel().once('updateAttrValue', (e) => {
e.attrValue.forEach((item, index) => { if(e.attrValue.length>0) e.attrValue.forEach((item, index) => {
item.uuid = Date.now() + '-' + Math.floor(Math.random() * 10000); item.uuid = Date.now() + '-' + Math.floor(Math.random() * 10000);
}) })
this.attrValue = e.attrValue; this.attrValue = e.attrValue;