From bf8afdc0f4e25a074301095faa65041b007a69fc Mon Sep 17 00:00:00 2001 From: 15386982806 Date: Tue, 16 Jan 2024 17:29:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=B0=E5=AE=B6=E7=AB=AF=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/public/config.js | 12 ++-- buyer/src/pages/home/enumeration.js | 2 +- manager/public/config.js | 58 ++++++++++--------- seller/public/config.js | 12 ++-- .../goods/goods-seller/goodsOperationSec.vue | 46 ++++++++++++--- 5 files changed, 86 insertions(+), 44 deletions(-) diff --git a/buyer/public/config.js b/buyer/public/config.js index 2272ff76..f1061804 100644 --- a/buyer/public/config.js +++ b/buyer/public/config.js @@ -3,10 +3,14 @@ var BASE = { * @description api请求基础路径 */ API_DEV: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" + // common: "https://common-api.pickmall.cn", + // buyer: "https://buyer-api.pickmall.cn", + // seller: "https://store-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: { common: "https://common-api.pickmall.cn", diff --git a/buyer/src/pages/home/enumeration.js b/buyer/src/pages/home/enumeration.js index 60a6f82f..60caf556 100644 --- a/buyer/src/pages/home/enumeration.js +++ b/buyer/src/pages/home/enumeration.js @@ -30,7 +30,7 @@ export const orderStatusList = [ status: 'TAKE' }, { - name: '已取消', + name: '已关闭', status: 'CANCELLED' }, { diff --git a/manager/public/config.js b/manager/public/config.js index ada826fc..5be44003 100644 --- a/manager/public/config.js +++ b/manager/public/config.js @@ -1,29 +1,33 @@ var BASE = { - /** - * @description api请求基础路径 - */ - API_DEV: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" - }, - API_PROD: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn" - }, - /** - * @description // 跳转买家端地址 pc端 - */ - PC_URL: "https://pc-b2b2c.pickmall.cn", - /** - * @description // 跳转买家端地址 wap端 - */ - WAP_URL: "https://m-b2b2c.pickmall.cn", - /** - * @description api请求基础路径前缀 - */ - PREFIX: "/manager" + /** + * @description api请求基础路径 + */ + API_DEV: { + // common: "https://common-api.pickmall.cn", + // buyer: "https://buyer-api.pickmall.cn", + // seller: "https://store-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: { + common: "https://common-api.pickmall.cn", + buyer: "https://buyer-api.pickmall.cn", + seller: "https://store-api.pickmall.cn", + manager: "https://admin-api.pickmall.cn" + }, + /** + * @description // 跳转买家端地址 pc端 + */ + PC_URL: "https://pc-b2b2c.pickmall.cn", + /** + * @description // 跳转买家端地址 wap端 + */ + WAP_URL: "https://m-b2b2c.pickmall.cn", + /** + * @description api请求基础路径前缀 + */ + PREFIX: "/manager" }; diff --git a/seller/public/config.js b/seller/public/config.js index 87161bcb..939235af 100644 --- a/seller/public/config.js +++ b/seller/public/config.js @@ -3,10 +3,14 @@ var BASE = { * @description api请求基础路径 */ API_DEV: { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - seller: "https://store-api.pickmall.cn", - manager: "https://admin-api.pickmall.cn", + // common: "https://common-api.pickmall.cn", + // buyer: "https://buyer-api.pickmall.cn", + // seller: "https://store-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: { common: "https://common-api.pickmall.cn", diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 3c5f1323..b526b55d 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -178,9 +178,9 @@ + @on-change="skuValueChange(val, index, item, $index)">   @@ -1220,8 +1221,41 @@ export default { } return len; }, + truncateString(str) { + let len = str.length; // 获取原始字符串的长度 + if (len <= 10 && /^[\u4e00-\u9fa5]+$/.test(str)) { // 判断字符串长度小于等于10且只包含中文时直接返回原字符串 + return str; + } else { + let count = 0; // 记录已经统计的字节数(UTF-8编码) + for (let i = 0; i < len; i++) { + let charCode = str.charCodeAt(i); + if ((charCode >= 0x0001 && charCode <= 0x007F) || (charCode >= 0xFF60 && charCode <= 0xFF9F)) { // ASCII字符或全角字符 + count += 1; + } else { + count += 2; // UTF-8编码中非ASCII字符占两个字节 + } + if (count > 10 * 2) { // 当已经统计的字节数大于10*2时,说明已经达到了限制条件 + break; + } + } + console.log('根据统计得到的字节数进行切片并返回结果', str, str.substr(0, Math.floor((count - 1) / 2))); + return str.substr(0, Math.floor((count - 1) / 2)); // 根据统计得到的字节数进行切片并返回结果 + } + }, // 编辑规格值 - skuValueChange(val, index, item) { + skuValueChange(val, index, item, $index) { + if (this.zz(0, val.value) > 20) { + this.$Message.error("规格值最多十个字符长度!"); + // val.value = val.value.toString().slice(0, 4); + this.$forceUpdate();// 调用该方法会触发组件的重新渲染 + // val.value = this.truncateString(val.value); + 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.$forceUpdate();// 调用该方法会触发组件的重新渲染 + return; + } + console.log('编辑规格值改变', item); if (this.skuTableData.find((i) => i[val.name] === val.value)) { this.$Message.error("已存在相同规格值!"); return; @@ -1230,10 +1264,6 @@ export default { this.$Message.error("规格值不能为空!"); return; } - if (this.zz(0, val.value) > 20) { - this.$Message.error("规格值最多十个字符长度!"); - return; - } let curVal = this.currentSkuVal; this.skuTableData = this.skuTableData.map((e) => { if (e[val.name] === curVal) { @@ -1437,7 +1467,7 @@ export default { key: columnName, }); }); - + console.log('渲染头部', this.skuInfo); // 有成本价和价格的情况 if (this.baseInfoForm.salesModel !== "WHOLESALE") { pushData.push(