diff --git a/.trae/documents/Fix TDesign form reset in Custom Words.md b/.trae/documents/Fix TDesign form reset in Custom Words.md new file mode 100644 index 00000000..0e5d2230 --- /dev/null +++ b/.trae/documents/Fix TDesign form reset in Custom Words.md @@ -0,0 +1,38 @@ +## 目标 +- 增加 Tabs 与内容的间距样式 +- 将“查看”弹窗统一为右侧抽屉并用 `t-descriptions` 展示 +- 修复自定义分词页面 `resetFields()` 报错为 TDesign 的 `reset()` + +## 涉及页面与改动 +### 1) 站内信模板 +- 文件:`manager/src/views/sys/message/noticeMessageTemplate.vue` +- 改动: + - 给 `t-tabs` 增加类名(如 `notice-tabs`),样式:`::v-deep(.notice-tabs .t-tabs__content){ padding-top:16px }` + - 在每个 `t-tab-panel` 内包裹 `div.tab-content` 并设 `padding-top:16px` + - 将查看详情 `t-dialog` 改为 `t-drawer`(`placement="right" size="800px"`),内容改为 `t-descriptions` 单列展示(标题、类型、模板内容等),保留编辑/发送交互不变 + +### 2) 意见反馈 +- 文件:`manager/src/views/page/feedback/feedback.vue` +- 改动: + - 将详情 `t-dialog` 改为 `t-drawer`(右侧展开) + - 只读内容用 `t-descriptions` 单列展示(用户名、手机、类型、内容、图片列表),移除禁用表单控件 + - 分页区域由 iView `Row/Page` 改为 `t-pagination`(保持现有页码/页大小逻辑) + - 抽屉底部仅保留“返回”按钮(左对齐) + +### 3) 自定义分词 +- 文件:`manager/src/views/custom-words/index.vue` +- 改动: + - 在 `add()` 等调用中,将 `this.$refs.form.resetFields()` 替换为: + - `if (this.$refs.form && typeof this.$refs.form.reset === 'function') { this.$refs.form.reset(); } else { this.form = { name: '' } }` + - 初始化 `this.form` 改为显式字段对象,确保校验兼容 + - 检查页面是否存在其他 iView API(如 `$Message/$Modal`),若有统一为 `MessagePlugin/DialogPlugin` + +## 验证 +- 打开对应页面,切换 Tabs,间距生效 +- 点击“查看”→ 抽屉从右侧展开,信息以 `t-descriptions` 单列展示,底部仅“返回”按钮 +- 自定义分词点击“添加”,不再出现 `resetFields` 报错,表单成功清空 +- 分页切换正常且无控制台警告 + +## 注意 +- 不改动现有业务接口与数据结构;仅替换 UI 容器与只读展示方式 +- 样式值可根据视觉反馈上调(如 20px) \ No newline at end of file diff --git a/.vercel/project.json b/.vercel/project.json new file mode 100644 index 00000000..812014f7 --- /dev/null +++ b/.vercel/project.json @@ -0,0 +1 @@ +{"neverMindDeployCard":true} \ No newline at end of file diff --git a/README.md b/README.md index c4f6d962..485a1101 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,13 @@ github 镜像: https://github.com/lilishop?tab=repositories 商城UI 项目下3个文件夹 buyer:买家PC端,seller:商家端,manager:后台管理端 +### 前端 UI 框架与版本 + +- manager:`tdesign-vue@^1.14.2`、`tdesign-icons-vue@^0.2.3`、`view-design@^4.7.0`、`vue@2.6.14` +- buyer:`view-design@^4.3.2`、`vue@^2.6.11` +- seller:`view-design@^4.6.1`、`vue@^2.6.10` +- im:`element-ui@^2.14.1`、`vue@^2.6.11` + ### 演示地址 PS:手机验证码为 ‘111111’ diff --git a/buyer/README.md b/buyer/README.md index e69de29b..8e65f535 100644 --- a/buyer/README.md +++ b/buyer/README.md @@ -0,0 +1,5 @@ +### UI 框架与版本 + +- `view-design@^4.3.2` +- `vue@^2.6.11` + diff --git a/buyer/src/api/cart.js b/buyer/src/api/cart.js index c8d13461..d7e68ec5 100644 --- a/buyer/src/api/cart.js +++ b/buyer/src/api/cart.js @@ -63,7 +63,7 @@ export function addCartGoods (params) { /** * 创建交易 - * @param client 客户端:H5/移动端 PC/PC端,WECHAT_MP/小程序端,APP/移动应用端 + * @param client 客户端:H5/移动端 PC/PC端,WECHAT_MP/小程序,APP/移动应用端 * @param way 购物车购买:CART/立即购买:BUY_NOW / 积分购买:POINT * @param remark 备注 非必填 */ diff --git a/manager/README.md b/manager/README.md index ec629e11..dac018f0 100644 --- a/manager/README.md +++ b/manager/README.md @@ -4,6 +4,12 @@ ### Customize configuration 详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/). +### UI 框架与版本 + +- `tdesign-vue@^1.14.2` +- `tdesign-icons-vue@^0.2.3` +- `vue@2.6.14` + #### login.vue页面,测试时不走权限,直接return 318行 #### Main.vue 页面,241行,修改,避免报错 diff --git a/manager/package.json b/manager/package.json index 0257c919..55560439 100644 --- a/manager/package.json +++ b/manager/package.json @@ -25,8 +25,10 @@ "sockjs-client": "^1.4.0", "swiper": "^6.3.5", "uuid": "^8.3.2", - "view-design": "^4.7.0", - "vue": "^2.6.10", + "tdesign-vue": "^1.14.2", + "tdesign-icons-vue": "^0.2.3", + "@vue/composition-api": "^1.7.1", + "vue": "2.6.14", "vue-awesome-swiper": "^4.1.1", "vue-i18n": "^8.15.1", "vue-json-excel": "^0.3.0", @@ -50,7 +52,7 @@ "style-resources-loader": "^1.3.2", "uglifyjs-webpack-plugin": "^2.2.0", "vue-cli-plugin-style-resources-loader": "^0.1.4", - "vue-template-compiler": "^2.6.10" + "vue-template-compiler": "2.6.14" }, "resolutions": { "minimatch": "^3.1.2", diff --git a/manager/src/api/common.js b/manager/src/api/common.js index 1fbe6886..8b476d8e 100644 --- a/manager/src/api/common.js +++ b/manager/src/api/common.js @@ -23,7 +23,7 @@ export const postVerifyImg = (params) => { // 获取系统基础信息 export const getBaseSite = () => { - return getRequest(`${commonUrl}/common/common/site`); + return getRequestWithNoToken(`${commonUrl}/common/common/site`); }; // 上传文件 diff --git a/manager/src/components/TdPage.vue b/manager/src/components/TdPage.vue new file mode 100644 index 00000000..1529b8c4 --- /dev/null +++ b/manager/src/components/TdPage.vue @@ -0,0 +1,44 @@ + + diff --git a/manager/src/components/editor/upload-image.vue b/manager/src/components/editor/upload-image.vue index c2498522..6751780a 100644 --- a/manager/src/components/editor/upload-image.vue +++ b/manager/src/components/editor/upload-image.vue @@ -1,7 +1,7 @@
- -
- +
+
- +
- + - - - + + + + diff --git a/manager/src/views/distribution/distributionApply.vue b/manager/src/views/distribution/distributionApply.vue index a440ed11..9a839077 100644 --- a/manager/src/views/distribution/distributionApply.vue +++ b/manager/src/views/distribution/distributionApply.vue @@ -1,61 +1,35 @@ - diff --git a/manager/src/views/goods/goods-manage/brand.vue b/manager/src/views/goods/goods-manage/brand.vue index 35374cfa..1c64e4c0 100644 --- a/manager/src/views/goods/goods-manage/brand.vue +++ b/manager/src/views/goods/goods-manage/brand.vue @@ -1,39 +1,39 @@ @@ -47,7 +47,8 @@ import { } from "@/api/goods"; import uploadPicInput from "@/components/lili/upload-pic-input"; -import {regular} from "@/utils"; +import { regular } from "@/utils"; +import { MessagePlugin, DialogPlugin } from "tdesign-vue"; export default { name: "brand", @@ -86,156 +87,21 @@ export default { }, submitLoading: false, // 添加或编辑提交状态 columns: [ - { - title: "品牌名称", - key: "name", - width: 200, - resizable: true, - sortable: false, - }, - { - title: "品牌图标", - key: "logo", - align: "left", - render: (h, params) => { - return h("img", { - attrs: { - src: params.row.logo || '', - alt: "加载图片失败", - }, - style: { - cursor: "pointer", - width: "80px", - height: "60px", - margin: "10px 0", - "object-fit": "contain", - }, - }); - }, - }, - { - title: "状态", - key: "deleteFlag", - align: "left", - render: (h, params) => { - if (params.row.deleteFlag == 0) { - return h("Tag", {props: {color: "green",},}, "启用"); - } else if (params.row.deleteFlag == 1) { - return h("Tag", {props: {color: "volcano",},}, "禁用"); - } - }, - filters: [ - { - label: "启用", - value: 0, - }, - { - label: "禁用", - value: 1, - }, - ], - filterMultiple: false, - filterMethod(value, row) { - if (value == 0) { - return row.deleteFlag == 0; - } else if (value == 1) { - return row.deleteFlag == 1; - } - }, - }, - { - title: "操作", - key: "action", - width: 180, - align: "center", - fixed: "right", - render: (h, params) => { - let enableOrDisable = ""; - if (params.row.deleteFlag == 0) { - enableOrDisable = h( - "a", - { - style: { - color: "#2d8cf0", - cursor: "pointer", - textDecoration: "none", - marginRight: "5px", - }, - on: { - click: () => { - this.disable(params.row); - }, - }, - }, - "禁用" - ); - } else { - enableOrDisable = h( - "a", - { - style: { - color: "#2d8cf0", - cursor: "pointer", - textDecoration: "none", - marginRight: "5px", - }, - on: { - click: () => { - this.enable(params.row); - }, - }, - }, - "启用" - ); - } - return h("div", [ - h( - "a", - { - style: { - color: "#2d8cf0", - cursor: "pointer", - textDecoration: "none", - marginRight: "5px", - }, - on: { - click: () => { - this.edit(params.row); - }, - }, - }, - "编辑" - ), - h( - "span", - { style: { margin: "0 8px", color: "#dcdee2" } }, - "|" - ), - enableOrDisable, - h( - "span", - { style: { margin: "0 8px", color: "#dcdee2" } }, - "|" - ), - h( - "a", - { - style: { - color: "#2d8cf0", - cursor: "pointer", - textDecoration: "none", - }, - on: { - click: () => { - this.delBrand(params.row.id); - }, - }, - }, - "删除" - ), - ]); - }, - }, + { title: "品牌名称", colKey: "name", width: 200 }, + { title: "品牌图标", colKey: "logo", align: "left", cell: (h, { row }) => h("img", { attrs: { src: row.logo || '', alt: "加载图片失败" }, style: { cursor: "pointer", width: "48px", height: "36px", margin: "6px 0", objectFit: "contain" } }) }, + { title: "状态", colKey: "deleteFlag", align: "left", cell: (h, { row }) => row.deleteFlag == 0 ? h("t-tag", { props: { theme: "success", variant: "light" } }, "启用") : h("t-tag", { props: { theme: "warning", variant: "light" } }, "禁用") }, + { title: "操作", colKey: "action", width: 180, align: "center", fixed: "right", cell: (h, { row }) => { + const enableOrDisable = row.deleteFlag == 0 + ? h("a", { style: { color: "#2d8cf0", cursor: "pointer", textDecoration: "none", marginRight: "5px" }, on: { click: () => this.disable(row) } }, "禁用") + : h("a", { style: { color: "#2d8cf0", cursor: "pointer", textDecoration: "none", marginRight: "5px" }, on: { click: () => this.enable(row) } }, "启用"); + return h("div", [ + h("a", { style: { color: "#2d8cf0", cursor: "pointer", textDecoration: "none", marginRight: "5px" }, on: { click: () => this.edit(row) } }, "编辑"), + h("span", { style: { margin: "0 8px", color: "#dcdee2" } }, "|"), + enableOrDisable, + h("span", { style: { margin: "0 8px", color: "#dcdee2" } }, "|"), + h("a", { style: { color: "#2d8cf0", cursor: "pointer", textDecoration: "none" }, on: { click: () => this.confirmDel(row) } }, "删除"), + ]); + } }, ], data: [], // 表单数据 total: 0, // 表单数据总数 @@ -244,13 +110,22 @@ export default { methods: { // 删除品牌 async delBrand(id) { - let res = await delBrand(id); - + const res = await delBrand(id); if (res.success) { - this.$Message.success("品牌删除成功!"); + MessagePlugin.success("品牌删除成功!"); this.getDataList(); } }, + confirmDel(row) { + DialogPlugin.confirm({ + header: "确认删除", + content: "您确认要删除品牌 " + row.name + " ?", + theme: "warning", + onConfirm: () => { + this.delBrand(row.id); + }, + }); + }, // 初始化数据 init() { this.getDataList(); @@ -265,12 +140,30 @@ export default { this.searchForm.pageSize = v; this.getDataList(); }, + onPaginationChange(info) { + if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) { + this.changePageSize(info.pageSize); + } + if (info && typeof info.current !== "undefined") { + this.changePage(info.current); + } + }, // 搜索 handleSearch() { this.searchForm.pageNumber = 1; this.searchForm.pageSize = 20; this.getDataList(); }, + handleReset() { + this.searchForm = { + pageNumber: 1, + pageSize: 20, + sort: "create_time", + order: "desc", + name: "", + }; + this.getDataList(); + }, // 获取数据 getDataList() { this.loading = true; @@ -293,7 +186,7 @@ export default { addBrand(this.form).then((res) => { this.submitLoading = false; if (res.success) { - this.$Message.success("操作成功"); + MessagePlugin.success("操作成功"); this.getDataList(); this.modalVisible = false; } @@ -303,7 +196,7 @@ export default { updateBrand(this.form).then((res) => { this.submitLoading = false; if (res.success) { - this.$Message.success("操作成功"); + MessagePlugin.success("操作成功"); this.getDataList(); this.modalVisible = false; } @@ -316,7 +209,7 @@ export default { add() { this.modalType = 0; this.modalTitle = "添加"; - this.$refs.form.resetFields(); + this.$refs.form.reset(); delete this.form.id; this.modalVisible = true; }, @@ -325,7 +218,7 @@ export default { edit(v) { this.modalType = 1; this.modalTitle = "编辑"; - this.$refs.form.resetFields(); + this.$refs.form.reset(); // 转换null为"" for (let attr in v) { if (v[attr] === null) { @@ -339,15 +232,14 @@ export default { }, // 启用品牌 enable(v) { - this.$Modal.confirm({ - title: "确认启用", + DialogPlugin.confirm({ + header: "确认启用", content: "您确认要启用品牌 " + v.name + " ?", - loading: true, - onOk: () => { + theme: "warning", + onConfirm: () => { disableBrand(v.id, {disable: false}).then((res) => { - this.$Modal.remove(); if (res.success) { - this.$Message.success("操作成功"); + MessagePlugin.success("操作成功"); this.getDataList(); } }); @@ -356,15 +248,14 @@ export default { }, // 禁用 disable(v) { - this.$Modal.confirm({ - title: "确认禁用", + DialogPlugin.confirm({ + header: "确认禁用", content: "您确认要禁用品牌 " + v.name + " ?", - loading: true, - onOk: () => { + theme: "warning", + onConfirm: () => { disableBrand(v.id, {disable: true}).then((res) => { - this.$Modal.remove(); if (res.success) { - this.$Message.success("操作成功"); + MessagePlugin.success("操作成功"); this.getDataList(); } }); diff --git a/manager/src/views/goods/goods-manage/category.vue b/manager/src/views/goods/goods-manage/category.vue index f8e94911..3f88db1c 100644 --- a/manager/src/views/goods/goods-manage/category.vue +++ b/manager/src/views/goods/goods-manage/category.vue @@ -1,181 +1,84 @@ diff --git a/manager/src/views/main.scss b/manager/src/views/main.scss index f5691e76..293301a9 100644 --- a/manager/src/views/main.scss +++ b/manager/src/views/main.scss @@ -52,7 +52,7 @@ box-sizing: border-box; position: fixed; display: block; - padding-left: 180px; + padding-left: 312px; width: 100%; height: 100px; z-index: 20; @@ -218,12 +218,12 @@ .single-page-con { min-width: 740px; position: relative; - left: 180px; + left: 312px; top: 100px; right: 0; bottom: 0; height: calc(100% - 110px); - width: calc(100% - 180px); + width: calc(100% - 312px); overflow: auto; background-color: #f0f0f0; z-index: 1; diff --git a/manager/src/views/member/advance/recharge.vue b/manager/src/views/member/advance/recharge.vue index 4ac09553..bdd97b7a 100644 --- a/manager/src/views/member/advance/recharge.vue +++ b/manager/src/views/member/advance/recharge.vue @@ -1,208 +1,178 @@ diff --git a/manager/src/views/member/advance/walletLog.vue b/manager/src/views/member/advance/walletLog.vue index 9b6e65ff..118fac2e 100644 --- a/manager/src/views/member/advance/walletLog.vue +++ b/manager/src/views/member/advance/walletLog.vue @@ -1,26 +1,26 @@ @@ -30,112 +30,123 @@ export default { name: "walletLog", data() { return { - loading: true, // 表单加载状态 - searchForm: { - // 搜索框初始化对象 - pageNumber: 1, // 当前页数 - pageSize: 20, // 页面大小 - sort: "createTime", // 默认排序字段 - order: "desc", // 默认排序方式 - startDate: "", // 起始时间 - endDate: "", // 终止时间 - memberName: "", - }, - selectDate: null, // 选择时间段 + loading: true, + searchForm: { + pageNumber: 1, + pageSize: 20, + sort: "createTime", + order: "desc", + startDate: "", + endDate: "", + memberName: "", + }, + selectDate: [], columns: [ - // 表头 { title: "会员名称", - key: "memberName", + colKey: "memberName", minWidth: 100, + align: "left", }, { title: "变动金额", - key: "money", + colKey: "money", width: 150, - render: (h, params) => { - if (params.row.money >0) { - return h("priceColorScheme", {props:{value:params.row.money,color:'green'}} ); + align: "left", + cell: (h, params) => { + if (params.row.money > 0) { + return h("priceColorScheme", { props: { value: params.row.money, color: "green" } }); } else if (params.row.money < 0) { - return h("priceColorScheme", {props:{value:params.row.money,color:this.$mainColor}} ); + return h("priceColorScheme", { props: { value: params.row.money, color: this.$mainColor } }); } }, }, - { title: "变更时间", - key: "createTime", + colKey: "createTime", width: 200, + align: "left", }, { title: "业务类型", - key: "serviceType", + colKey: "serviceType", width: 200, - render: (h, params) => { - if (params.row.serviceType == "WALLET_WITHDRAWAL") { - return h("div", [h("span", {}, "余额提现")]); - } else if (params.row.serviceType == "WALLET_PAY") { - return h("div", [h("span", {}, "余额支付")]); - } else if (params.row.serviceType == "WALLET_REFUND") { - return h("div", [h("span", {}, "余额退款")]); - } else if (params.row.serviceType == "WALLET_RECHARGE") { - return h("div", [h("span", {}, "余额充值")]); - } else { - return h("div", [h("span", {}, "佣金提成")]); - } + align: "left", + cell: (h, params) => { + const map = { + WALLET_WITHDRAWAL: "余额提现", + WALLET_PAY: "余额支付", + WALLET_REFUND: "余额退款", + WALLET_RECHARGE: "余额充值", + }; + return h("div", [h("span", {}, map[params.row.serviceType] || "佣金提成")]); }, }, { title: "详细", - key: "detail", + colKey: "detail", minWidth: 300, tooltip: true, + align: "left", }, ], - data: [], // 表单数据 - total: 0, // 表单数据总数 + data: [], + total: 0, }; }, methods: { - // 初始化数据 init() { this.getDataList(); }, - // 分页 改变页码 changePage(v) { this.searchForm.pageNumber = v; this.getDataList(); }, - // 分页 改变页数 changePageSize(v) { - this.searchForm.pageNumber = 1; this.searchForm.pageSize = v; this.getDataList(); }, - // 搜索 + onPaginationChange(info) { + if (info && typeof info.pageSize !== "undefined" && info.pageSize !== this.searchForm.pageSize) { + this.changePageSize(info.pageSize); + } + if (info && typeof info.current !== "undefined") { + this.changePage(info.current); + } + }, handleSearch() { this.searchForm.pageNumber = 1; this.searchForm.pageSize = 20; this.getDataList(); }, - // 时间段赋值 + handleReset() { + this.searchForm.pageNumber = 1; + this.searchForm.pageSize = 20; + this.searchForm.memberName = ""; + this.searchForm.startDate = ""; + this.searchForm.endDate = ""; + this.selectDate = []; + this.getDataList(); + }, selectDateRange(v) { if (v) { this.searchForm.startDate = v[0]; this.searchForm.endDate = v[1]; } }, - // 获取列表数据 getDataList() { - getUserWallet(this.searchForm).then((res) => { - this.loading = false; - if (res.success) { - this.data = res.result.records; - this.total = res.result.total; - } - }); - this.total = this.data.length; - this.loading = false; + this.loading = true; + getUserWallet(this.searchForm) + .then((res) => { + this.loading = false; + if (res.success) { + this.data = res.result.records; + this.total = res.result.total; + } + }) + .catch(() => { + this.loading = false; + }); }, }, mounted() { diff --git a/manager/src/views/member/advance/withdrawApply.vue b/manager/src/views/member/advance/withdrawApply.vue index 1f7b6aba..81f4166e 100644 --- a/manager/src/views/member/advance/withdrawApply.vue +++ b/manager/src/views/member/advance/withdrawApply.vue @@ -1,212 +1,169 @@ diff --git a/manager/src/views/member/list/memberRecycle.vue b/manager/src/views/member/list/memberRecycle.vue index d41a987c..393eece5 100644 --- a/manager/src/views/member/list/memberRecycle.vue +++ b/manager/src/views/member/list/memberRecycle.vue @@ -1,158 +1,107 @@ - + diff --git a/manager/src/views/order/after-order/afterSale.vue b/manager/src/views/order/after-order/afterSale.vue index 14ba957d..fd7cf86c 100644 --- a/manager/src/views/order/after-order/afterSale.vue +++ b/manager/src/views/order/after-order/afterSale.vue @@ -1,137 +1,62 @@ diff --git a/manager/src/views/page-decoration/floorList.vue b/manager/src/views/page-decoration/floorList.vue index e1d737ae..75b12435 100644 --- a/manager/src/views/page-decoration/floorList.vue +++ b/manager/src/views/page-decoration/floorList.vue @@ -1,6 +1,6 @@ diff --git a/manager/src/views/page-decoration/modelForm.vue b/manager/src/views/page-decoration/modelForm.vue index 0a2ea394..d1295987 100644 --- a/manager/src/views/page-decoration/modelForm.vue +++ b/manager/src/views/page-decoration/modelForm.vue @@ -8,8 +8,8 @@ >
- 编辑
@@ -20,16 +20,15 @@
  • 请登录
  • 我的订单
  • 我的足迹
  • -
  • 购物车
  • +
  • 购物车
  • 店铺入驻
  • @@ -66,13 +65,11 @@ -
    - 图片链接: + 选择链接
    - 选择图片:选择图片 
    -
    选择背景色:
    +
    选择背景色:
    -
    - + - + - + - + - + diff --git a/manager/src/views/page/article-manage/template/historyHotWords.vue b/manager/src/views/page/article-manage/template/historyHotWords.vue index 77d0b4d6..5bdeb872 100644 --- a/manager/src/views/page/article-manage/template/historyHotWords.vue +++ b/manager/src/views/page/article-manage/template/historyHotWords.vue @@ -1,25 +1,11 @@