编辑商品详情

master
15386982806 2024-01-16 17:54:28 +08:00
parent c47394a162
commit 7ba94c7fe1
4 changed files with 41 additions and 40 deletions

View File

@ -3,14 +3,10 @@ var BASE = {
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
// common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn", seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn" manager: "https://admin-api.pickmall.cn"
common: "http://192.168.31.225:8890",
buyer: "http://192.168.31.225:8888",
seller: "http://192.168.31.225:8889",
manager: "http://192.168.31.225:8887"
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -3,14 +3,10 @@ var BASE = {
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
// common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn", seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn", manager: "https://admin-api.pickmall.cn",
common: "http://192.168.31.225:8890",
buyer: "http://192.168.31.225:8888",
seller: "http://192.168.31.225:8889",
manager: "http://192.168.31.225:8887"
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -3,14 +3,10 @@ var BASE = {
* @description api请求基础路径 * @description api请求基础路径
*/ */
API_DEV: { API_DEV: {
// common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn", buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn", seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn", manager: "https://admin-api.pickmall.cn",
common: "http://192.168.31.225:8890",
buyer: "http://192.168.31.225:8888",
seller: "http://192.168.31.225:8889",
manager: "http://192.168.31.225:8887"
}, },
API_PROD: { API_PROD: {
common: "https://common-api.pickmall.cn", common: "https://common-api.pickmall.cn",

View File

@ -196,7 +196,7 @@
</Card> </Card>
</div> </div>
</Form> </Form>
{{skuInfo}} <!--{{skuInfo}}-->
<Button class="add-sku-btn" size="small" type="primary" @click="addSkuItem"> <Button class="add-sku-btn" size="small" type="primary" @click="addSkuItem">
</Button> </Button>
&nbsp; &nbsp;
@ -1197,9 +1197,20 @@ export default {
this.$Message.error("已存在相同规格项!"); this.$Message.error("已存在相同规格项!");
return; return;
} }
// if (this.zz(0, val) > 20) {
// this.$Message.error("");
// return;
// }
if (this.zz(0, val) > 20) { if (this.zz(0, val) > 20) {
this.$Message.error("规格项最多十个字符长度!"); this.$Message.error("规格值最多十个字符长度!");
return; // val = val.toString().slice(0, 4);
this.$forceUpdate();//
// val = this.truncateString(val);
this.skuInfo[index].name = this.truncateString(val);
// this.$set(this.skuInfo[$index].spec_values[index], 'value', this.truncateString(val));
// this.$set(item, 'value', this.truncateString(val));
this.$forceUpdate();//
// return;
} }
this.skuTableData = this.skuTableData.map((e) => { this.skuTableData = this.skuTableData.map((e) => {
e[val] = e[this.currentSkuItem]; e[val] = e[this.currentSkuItem];
@ -1238,12 +1249,20 @@ export default {
break; break;
} }
} }
console.log('根据统计得到的字节数进行切片并返回结果', str, str.substr(0, Math.floor((count - 1) / 2))); // console.log('', str, str.substr(0, Math.floor((count - 1) / 2)));
return str.substr(0, Math.floor((count - 1) / 2)); // return str.substr(0, Math.floor((count + 1) / 2)); //
} }
}, },
// //
skuValueChange(val, index, item, $index) { skuValueChange(val, index, item, $index) {
if (this.skuTableData.find((i) => i[val.name] === val.value)) {
this.$Message.error("已存在相同规格值!");
return;
}
if (val.value === '') {
this.$Message.error("规格值不能为空!");
return;
}
if (this.zz(0, val.value) > 20) { if (this.zz(0, val.value) > 20) {
this.$Message.error("规格值最多十个字符长度!"); this.$Message.error("规格值最多十个字符长度!");
// val.value = val.value.toString().slice(0, 4); // val.value = val.value.toString().slice(0, 4);
@ -1253,17 +1272,12 @@ export default {
// this.$set(this.skuInfo[$index].spec_values[index], 'value', this.truncateString(val.value)); // this.$set(this.skuInfo[$index].spec_values[index], 'value', this.truncateString(val.value));
// this.$set(item, 'value', this.truncateString(val.value)); // this.$set(item, 'value', this.truncateString(val.value));
this.$forceUpdate();// this.$forceUpdate();//
return; // return;
}
console.log('编辑规格值改变', item);
if (this.skuTableData.find((i) => i[val.name] === val.value)) {
this.$Message.error("已存在相同规格值!");
return;
}
if (val.value === '') {
this.$Message.error("规格值不能为空!");
return;
} }
// console.log('', item);
let curVal = this.currentSkuVal; let curVal = this.currentSkuVal;
this.skuTableData = this.skuTableData.map((e) => { this.skuTableData = this.skuTableData.map((e) => {
if (e[val.name] === curVal) { if (e[val.name] === curVal) {
@ -1467,7 +1481,6 @@ export default {
key: columnName, key: columnName,
}); });
}); });
console.log('渲染头部', this.skuInfo);
// //
if (this.baseInfoForm.salesModel !== "WHOLESALE") { if (this.baseInfoForm.salesModel !== "WHOLESALE") {
pushData.push( pushData.push(