diff --git a/manager/src/components/editor/config.js b/manager/src/components/editor/config.js
index e6b9c350..71d464d0 100644
--- a/manager/src/components/editor/config.js
+++ b/manager/src/components/editor/config.js
@@ -2,13 +2,21 @@ import plugins from "./plugins";
import toobar from "./toolbar";
const localCDN = window.location.origin + process.env.BASE_URL + "tinymce"; //本地引入,兼容子路径部署(publicPath)
+
+const DEPRECATED_TINYMCE_PLUGINS = new Set(["template"]);
+
+export function resolveTinymcePlugins(list = plugins) {
+ const names = Array.isArray(list) ? list : String(list || "").split(/[ ,]+/);
+ return names.filter((name) => name && !DEPRECATED_TINYMCE_PLUGINS.has(name)).join(" ");
+}
+
export const initEditor = {
base_url: localCDN,
height: "400px",
language: "zh-Hans",
menubar: "file edit view format table", // 菜单:指定应该出现哪些菜单
toolbar: toobar, // 分组工具栏控件
- plugins:plugins, // 插件(比如: advlist | link | image | preview等)
+ plugins: resolveTinymcePlugins(plugins),
object_resizing: false, // 是否禁用表格图片大小调整
end_container_on_empty_block: true, // enter键 分块
powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge
diff --git a/manager/src/components/editor/index.vue b/manager/src/components/editor/index.vue
index 1ca77c58..cf35cc55 100644
--- a/manager/src/components/editor/index.vue
+++ b/manager/src/components/editor/index.vue
@@ -9,7 +9,7 @@
-
-
diff --git a/seller/src/views/goods/goods-seller/goodsOperation.vue b/seller/src/views/goods/goods-seller/goodsOperation.vue
index 8bb67f9d..940475d1 100644
--- a/seller/src/views/goods/goods-seller/goodsOperation.vue
+++ b/seller/src/views/goods/goods-seller/goodsOperation.vue
@@ -1,7 +1,7 @@
-
+
@@ -20,7 +20,6 @@ export default {
return {
/** 当前激活步骤:1 填写详情,2 发布成功 */
activestep: 1,
- firstData: {},
};
},
mounted() {
diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
index bd110fd1..e815cff7 100644
--- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue
+++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
@@ -208,7 +208,7 @@
:show-file-list="false"
:before-upload="beforeVideoUpload"
:on-success="handleSuccessGoodsVideo"
- :on-error="() => { loadingVideo = false }"
+ :on-error="handleGoodsVideoUploadError"
>
{{ loadingVideo ? "正在上传..." : `${baseInfoForm.goodsVideo ? "已" : ""}上传视频` }}
@@ -578,12 +578,6 @@ export default {
vuedraggable,
ossManage,
},
- props: {
- firstData: {
- default: {},
- type: Object,
- },
- },
computed: {
/** 卡密商品:库存只读展示 quantity,提交时 quantity 传 0(FR-S-01 / P-02) */
isECouponGoods() {
@@ -630,6 +624,19 @@ export default {
goodsVideo: "",
showContent: false,
loadingVideo: false,
+ beforeVideoUpload: (file) => {
+ const allowed = /\.(avi|wmv|mpeg|mp4|mov)$/i;
+ if (!allowed.test((file && file.name) || "")) {
+ this.$Message.error("仅支持 avi、wmv、mpeg、mp4、mov 格式的视频");
+ return false;
+ }
+ if (file.size / 1024 / 1024 > 10) {
+ this.handleVideoMaxSize(file);
+ return false;
+ }
+ this.loadingVideo = true;
+ return true;
+ },
listImages: [],
newSkuValues: [],
contentImage: "",
@@ -870,6 +877,9 @@ export default {
desc: "视频大小不能超过10MB",
});
},
+ handleGoodsVideoUploadError() {
+ this.loadingVideo = false;
+ },
parseOssSelectionUrl(item) {
if (!item) return "";
if (typeof item === "string") {
@@ -1361,14 +1371,9 @@ export default {
});
},
// 编辑时获取商品信息
- async GET_GoodData(id, draftId) {
- let response = {};
- if (draftId) {
- response = await API_GOODS.getDraftGoodsDetail(draftId);
- } else {
- response = await API_GOODS.getGoods(id);
- this.goodsId = response.result.id;
- }
+ async GET_GoodData(id) {
+ const response = await API_GOODS.getGoods(id);
+ this.goodsId = response.result.id;
response.result.recommend
? (response.result.recommend = 1)
@@ -2467,15 +2472,11 @@ export default {
};
this.GET_ShipTemplate()
this.loadCategoryList();
- if (this.$route.query.id || this.$route.query.draftId) {
- // 编辑商品、模板
- this.GET_GoodData(this.$route.query.id, this.$route.query.draftId);
+ if (this.$route.query.id) {
+ this.GET_GoodData(this.$route.query.id);
} else if (this.$route.query.copyId) {
// 复制商品
this.GET_GoodData(this.$route.query.copyId);
- } else if (this.firstData.tempId) {
- // 选择模板
- this.GET_GoodData("", this.firstData.tempId);
} else {
// 新增商品
this.GET_GoodsUnit();
diff --git a/seller/src/views/home/home.vue b/seller/src/views/home/home.vue
index 99858c34..36c0ddc0 100644
--- a/seller/src/views/home/home.vue
+++ b/seller/src/views/home/home.vue
@@ -32,11 +32,11 @@
type="circle"
:width="120"
:stroke-width="5"
- :percentage="userData.serviceScore * 20"
+ :percentage="scorePercent(userData.serviceScore)"
color="#fecb89"
>
- {{ userData.serviceScore }}分
+ {{ formatScore(userData.serviceScore) }}分
服务得分
@@ -46,11 +46,11 @@
type="circle"
:width="120"
:stroke-width="5"
- :percentage="userData.deliveryScore * 20"
+ :percentage="scorePercent(userData.deliveryScore)"
color="#a7c5eb"
>
- {{ userData.deliveryScore }}分
+ {{ formatScore(userData.deliveryScore) }}分
交货得分
@@ -60,11 +60,11 @@
type="circle"
:width="120"
:stroke-width="5"
- :percentage="userData.descriptionScore * 20"
+ :percentage="scorePercent(userData.descriptionScore)"
color="#848ccf"
>
- {{ userData.descriptionScore }}分
+ {{ formatScore(userData.descriptionScore) }}分
评价得分
@@ -249,7 +249,7 @@ export default {
topGoodsData: [],
afterSaleNumData: {},
procurementStatusCount: {},
- userData: "",
+ userData: {},
notices: "",
noticesDetail: {
title: "",
@@ -301,9 +301,20 @@ export default {
if (t < y) return "compare-down";
return "compare-flat";
},
+ formatScore(score) {
+ const n = Number(score);
+ return Number.isFinite(n) ? n : 0;
+ },
+ scorePercent(score) {
+ const percent = this.formatScore(score) * 20;
+ return Math.min(100, Math.max(0, Number(percent.toFixed(2))));
+ },
async init() {
- const userInfo = JSON.parse(Cookies.get("userInfoSeller"));
- this.userData = userInfo;
+ try {
+ this.userData = JSON.parse(Cookies.get("userInfoSeller") || "{}") || {};
+ } catch (e) {
+ this.userData = {};
+ }
const res = await getHomeNotice();
if (res.success) {
diff --git a/seller/src/views/lili-components/editor/config.js b/seller/src/views/lili-components/editor/config.js
index 37c4e472..447dd8f7 100644
--- a/seller/src/views/lili-components/editor/config.js
+++ b/seller/src/views/lili-components/editor/config.js
@@ -1,13 +1,21 @@
import plugins from "./plugins";
import toobar from "./toolbar";
const localCDN = window.location.origin + process.env.BASE_URL + "tinymce"; //本地引入,兼容子路径部署(publicPath)
+
+const DEPRECATED_TINYMCE_PLUGINS = new Set(["template"]);
+
+export function resolveTinymcePlugins(list = plugins) {
+ const names = Array.isArray(list) ? list : String(list || "").split(/[ ,]+/);
+ return names.filter((name) => name && !DEPRECATED_TINYMCE_PLUGINS.has(name)).join(" ");
+}
+
export const initEditor = {
base_url: localCDN,
height: "400px",
language: "zh-Hans",
menubar: "file edit view format table", // 菜单:指定应该出现哪些菜单
toolbar: toobar, // 分组工具栏控件
- plugins:plugins, // 插件(比如: advlist | link | image | preview等)
+ plugins: resolveTinymcePlugins(plugins),
object_resizing: false, // 是否禁用表格图片大小调整
end_container_on_empty_block: true, // enter键 分块
powerpaste_word_import: "merge", // 是否保留word粘贴样式 clean | merge
diff --git a/seller/src/views/lili-components/editor/index.vue b/seller/src/views/lili-components/editor/index.vue
index 8210bca3..babe9824 100644
--- a/seller/src/views/lili-components/editor/index.vue
+++ b/seller/src/views/lili-components/editor/index.vue
@@ -9,7 +9,7 @@