From e6f6b6253bf313b133ab7de64c7b29fb12c22541 Mon Sep 17 00:00:00 2001 From: wangfukang <15630117759@163.com> Date: Tue, 10 Nov 2026 15:21:30 +0800 Subject: [PATCH] 1 --- package.json | 4 +- src/views/app/shop/dictManage.vue | 104 ++++++++-- src/views/app/shopArea/shopArea.vue | 40 ++++ src/views/sys/dict-manage/dictManage.vue | 25 +++ .../sys/setting-manage/settingManage.vue | 7 + src/views/sys/upApp/appUpload.vue | 191 ++++++++++++++++++ src/views/sys/upApp/upApp.vue | 31 ++- src/views/sys/user-manage/addEdit.vue | 2 + 8 files changed, 388 insertions(+), 16 deletions(-) create mode 100644 src/views/sys/upApp/appUpload.vue diff --git a/package.json b/package.json index 768da85..91efff6 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "dev": "vue-cli-service serve", "build": "vue-cli-service build", "dev:nw": "nw", - "build:nw": "npm run build && build --tasks win-x86 --mirror https://npm.taobao.org/mirrors/nwjs/ .", - "build:nw:all": "npm run build && build --tasks win-x86,win-x64,linux-x86,linux-x64,mac-x64 --mirror https://npm.taobao.org/mirrors/nwjs/ ." + "build:nw": "npm run build && build --tasks win-x86 --mirror https://npmmirror.com/mirrors/nwjs/ .", + "build:nw:all": "npm run build && build --tasks win-x86,win-x64,linux-x86,linux-x64,mac-x64 --mirror https://npmmirror.com/mirrors/nwjs/ ." }, "dependencies": { "@mapbox/mapbox-gl-geocoder": "^5.0.0", diff --git a/src/views/app/shop/dictManage.vue b/src/views/app/shop/dictManage.vue index 147263e..5365e13 100644 --- a/src/views/app/shop/dictManage.vue +++ b/src/views/app/shop/dictManage.vue @@ -377,6 +377,26 @@ + + + + +
@@ -541,6 +561,7 @@ }], sellTime:0, //可售时间 isMoreBuy:0, //加料 + moreBuyProductIds:[], sellBeginTime:'', //可售时段自定义---开始时间 sellEndTime:'', //可售时段自定义---结束时间 attributeList:'', @@ -921,6 +942,8 @@ }, ], submitLoading: false, // 添加或编辑提交状态 + moreBuyProductLoading: false, + moreBuyProductOptions: [], data: [], //表单数据 total: 0, // 表单数据总数 screenWidth: 0, @@ -1044,6 +1067,48 @@ isRequestSuccess(res) { return res && (res.success || res.code == 200); }, + normalizeMoreBuyProductIds(value) { + if (Array.isArray(value)) { + return value.filter(item => item !== "" && item !== null && item !== undefined).map(String); + } + if (value === "" || value === null || value === undefined) { + return []; + } + return String(value).split(",").map(item => item.trim()).filter(item => item); + }, + getSubmitMoreBuyProductIds() { + if (Number(this.addGoodsForm.isMoreBuy) === 1) { + return ""; + } + return this.normalizeMoreBuyProductIds(this.addGoodsForm.moreBuyProductIds).join(","); + }, + handleMoreBuySelectOpen(open) { + if (open) { + this.getMoreBuyProductOptions(); + } + }, + getMoreBuyProductOptions() { + const shopId = this.shopId || this.addGoodsForm.shopId; + if (!shopId) { + this.moreBuyProductOptions = []; + return Promise.resolve(); + } + this.moreBuyProductLoading = true; + return getShareList({ + shopId: shopId, + isMoreBuy: 1, + pageNum: 1, + pageSize: 1000, + }).then((res) => { + this.moreBuyProductLoading = false; + if (this.isRequestSuccess(res) && res.result) { + const records = Array.isArray(res.result.records) ? res.result.records : []; + this.moreBuyProductOptions = records.filter(item => item.id != this.addGoodsForm.id); + } + }).catch(() => { + this.moreBuyProductLoading = false; + }); + }, openAttributeManage() { if (!this.attrId) { this.$Message.warning("当前店铺未配置属性分类"); @@ -1472,6 +1537,10 @@ this.addGoodsForm.isMoreBuy = type; if (this.addGoodsForm.isMoreBuy == 1) { this.addGoodsForm.lunchBox = 0; + this.addGoodsForm.moreBuyProductIds = []; + } else { + this.addGoodsForm.moreBuyProductIds = this.normalizeMoreBuyProductIds(this.addGoodsForm.moreBuyProductIds); + this.getMoreBuyProductOptions(); } }, checkSpecValue(index){ @@ -1757,6 +1826,7 @@ }], sellTime:0, //可售时间 isMoreBuy:0, //加料 + moreBuyProductIds:[], sellBeginTime:'', //可售时段自定义---开始时间 sellEndTime:'', //可售时段自定义---结束时间 attributeList:'', @@ -1769,6 +1839,7 @@ this.addGoodsForm.shopId = this.shopId this.addGoodsForm.categoryId = this.selectNode.id this.addGoodsForm.categoryName = this.selectNode.categoryName + this.getMoreBuyProductOptions(); this.modalVisible = true; }, edit(v) { @@ -1801,6 +1872,7 @@ if(this.addGoodsForm.isMoreBuy === '' || this.addGoodsForm.isMoreBuy === undefined || this.addGoodsForm.isMoreBuy === null){ this.addGoodsForm.isMoreBuy = 0 } + this.addGoodsForm.moreBuyProductIds = this.normalizeMoreBuyProductIds(this.addGoodsForm.moreBuyProductIds) this.addGoodsForm.attributeList1 = JSON.parse(this.addGoodsForm.attributeList) this.addGoodsForm.attributeList1 = new Map(Object.entries(this.addGoodsForm.attributeList1)); // 兼容历史数据:如果没有canbuy字段,默认设为1 @@ -1823,6 +1895,9 @@ this.$set(this.addGoodsForm, "sellTime", this.addGoodsForm.sellBeginTime != "" ? 1 : 0) this.setGoodsCategoryName(this.addGoodsForm.categoryId) + if (this.addGoodsForm.isMoreBuy != 1) { + this.getMoreBuyProductOptions(); + } this.modalVisible = true; }, handelSubmit() { @@ -1836,14 +1911,16 @@ this.submitLoading = true; if (this.modalType == 0) { // 添加 避免编辑后传入id等数据 记得删除 - delete this.addGoodsForm.id; - if(this.addGoodsForm.isMoreBuy != 1){ - this.addGoodsForm.isMoreBuy = 0 + const submitForm = Object.assign({}, this.addGoodsForm); + delete submitForm.id; + if(submitForm.isMoreBuy != 1){ + submitForm.isMoreBuy = 0 } - this.addGoodsForm.attributeListPrice = JSON.stringify(this.addGoodsForm.attributeListPrice) - this.addGoodsForm.attributeList = Object.fromEntries(this.addGoodsForm.attributeList1) - this.addGoodsForm.attributeList = JSON.stringify(this.addGoodsForm.attributeList) - productSave(this.addGoodsForm).then((res) => { + submitForm.moreBuyProductIds = this.getSubmitMoreBuyProductIds() + submitForm.attributeListPrice = JSON.stringify(submitForm.attributeListPrice) + submitForm.attributeList = Object.fromEntries(submitForm.attributeList1) + submitForm.attributeList = JSON.stringify(submitForm.attributeList) + productSave(submitForm).then((res) => { this.submitLoading = false; if (res.success) { this.$Message.success("操作成功"); @@ -1853,12 +1930,13 @@ }); } else if (this.modalType == 1) { // 编辑 - - this.addGoodsForm.attributeListPrice = JSON.stringify(this.addGoodsForm.attributeListPrice) - this.addGoodsForm.attributeList = Object.fromEntries(this.addGoodsForm.attributeList1) - this.addGoodsForm.attributeList = JSON.stringify(this.addGoodsForm.attributeList) - this.addGoodsForm.productPictures = [] - productEdit(this.addGoodsForm).then((res) => { + const submitForm = Object.assign({}, this.addGoodsForm); + submitForm.moreBuyProductIds = this.getSubmitMoreBuyProductIds() + submitForm.attributeListPrice = JSON.stringify(submitForm.attributeListPrice) + submitForm.attributeList = Object.fromEntries(submitForm.attributeList1) + submitForm.attributeList = JSON.stringify(submitForm.attributeList) + submitForm.productPictures = [] + productEdit(submitForm).then((res) => { this.submitLoading = false; if (res.success) { this.$Message.success("操作成功"); diff --git a/src/views/app/shopArea/shopArea.vue b/src/views/app/shopArea/shopArea.vue index becef5a..7f2d4c9 100644 --- a/src/views/app/shopArea/shopArea.vue +++ b/src/views/app/shopArea/shopArea.vue @@ -172,6 +172,18 @@
社会区域首页展示待成团,可单独配置快递/跑腿入口
+ + + 开启 + 关闭 + +
开启后社会区域用户端仅文案按校园区域展示,业务逻辑仍按社会区域处理
+
社会区域首页展示待成团,可单独配置快递/跑腿入口
+ + + 开启 + 关闭 + +
开启后社会区域用户端仅文案按校园区域展示,业务逻辑仍按社会区域处理
+
+ + + @@ -200,6 +207,7 @@ // 添加或编辑表单对象初始化数据 title: "", value: "", + merchantType: 0, status: 0, description: "", sortOrder: 0, @@ -247,6 +255,20 @@ minWidth: 160, sortable: true, }, + { + title: "分类用途", + key: "merchantType", + width: 120, + align: "center", + render: (h, params) => { + const typeMap = { + 0: "不区分", + 1: "外卖分类", + 2: "团购分类", + }; + return h("span", typeMap[params.row.merchantType] || "-"); + }, + }, { title: "备注", key: "description", @@ -570,6 +592,7 @@ this.modalTitle = "添加字典 " + this.editTitle + " 的数据"; this.$refs.form.resetFields(); this.form.sortOrder = this.data.length + 1; + this.form.merchantType = 0; this.modalVisible = true; }, edit(v) { @@ -588,6 +611,7 @@ } let str = JSON.stringify(v); let data = JSON.parse(str); + data.merchantType = Number(data.merchantType || 0); this.form = data; this.modalVisible = true; }, @@ -595,6 +619,7 @@ this.$refs.form.validate((valid) => { if (valid) { this.submitLoading = true; + this.form.merchantType = Number(this.form.merchantType || 0); if (this.modalType == 0) { // 添加 避免编辑后传入id等数据 记得删除 delete this.form.id; diff --git a/src/views/sys/setting-manage/settingManage.vue b/src/views/sys/setting-manage/settingManage.vue index 40a9561..d2b40f4 100644 --- a/src/views/sys/setting-manage/settingManage.vue +++ b/src/views/sys/setting-manage/settingManage.vue @@ -23,6 +23,7 @@ 审核管理 系统公告配置 APP热更新 + APP上传 其他配置 @@ -220,6 +221,10 @@
APP热更新
+
+
APP上传
+ +
其他配置
@@ -300,6 +305,7 @@ import sms from "./sms.vue"; import stopWord from "./stopWord.vue"; import protocol from "./protocol.vue"; import upApp from "../upApp/upApp.vue"; +import appUpload from "../upApp/appUpload.vue"; export default { name: "setting-manage", components: { @@ -308,6 +314,7 @@ export default { stopWord, protocol, upApp, + appUpload, }, data() { return { diff --git a/src/views/sys/upApp/appUpload.vue b/src/views/sys/upApp/appUpload.vue new file mode 100644 index 0000000..02a35ad --- /dev/null +++ b/src/views/sys/upApp/appUpload.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/src/views/sys/upApp/upApp.vue b/src/views/sys/upApp/upApp.vue index 184efc0..1c8a489 100644 --- a/src/views/sys/upApp/upApp.vue +++ b/src/views/sys/upApp/upApp.vue @@ -15,6 +15,9 @@ + + + @@ -42,6 +45,7 @@ submitLoading: false, accessToken: {}, uploadData: {}, + cnameDomain: "https://static.hbkuaishi.com", form:{ url: "", version: "", @@ -87,6 +91,7 @@ } } this.form = res.result; + this.form.url = this.buildCnameUrl(this.form.url); } }); }, @@ -100,7 +105,7 @@ handleSuccess(res, file, fileList) { if (res.success) { this.$Message.success("上传文件 " + file.name + " 成功"); - this.form.url = res.result; + this.form.url = this.buildCnameUrl(res.result); this.form.fileName = file.name; } else { file.percentage = 0; @@ -115,6 +120,30 @@ handleFormatError(file) { this.$Message.error(file.name + " 不是wgt格式文件"); }, + buildCnameUrl(url) { + const domain = this.normalizeDomain(this.cnameDomain); + if (!url || !domain) { + return url || ""; + } + try { + const parsed = new URL(url); + return domain + parsed.pathname + parsed.search + parsed.hash; + } catch (e) { + const path = url.charAt(0) === "/" ? url : "/" + url; + return domain + path; + } + }, + normalizeDomain(domain) { + let value = domain ? domain.trim() : ""; + if (!value) { + return ""; + } + value = value.replace(/\/+$/, ""); + if (!/^https?:\/\//i.test(value)) { + value = "https://" + value; + } + return value; + }, handelSubmit() { this.$refs.form.validate((valid) => { if (!valid) { diff --git a/src/views/sys/user-manage/addEdit.vue b/src/views/sys/user-manage/addEdit.vue index a5459bd..d8b090a 100644 --- a/src/views/sys/user-manage/addEdit.vue +++ b/src/views/sys/user-manage/addEdit.vue @@ -274,6 +274,8 @@ export default { params.birth = this.format(params.birth, "yyyy-MM-dd"); } delete params.realNameAuthTime; + delete params.inviteRewardTime; + delete params.inviteTransferAuthTime; if (this.type == "1") { // 编辑 this.submitLoading = true;